diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-05-08 18:17:45 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-08 18:17:45 +0000 |
commit | 18c1c14ad4d869c627655cf2204b70d440b7692b (patch) | |
tree | c4efb96abd28c58f6dc220fdcc8ee8ab69f7ca38 /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DefaultSourceChangeHandler.java | |
parent | f1a59c98333d28b04b74772f204bcc1df6e83634 (diff) | |
parent | ccad5384d77328ff1843f4d9296f36a0c3f60343 (diff) | |
download | sdk-18c1c14ad4d869c627655cf2204b70d440b7692b.tar.gz |
Merge "Remove all non-Apache2 licensed files from sdk" am: 106d12a4f8 am: 7cb6fc634a am: ccad5384d7
Change-Id: Iaaff1e1152ae574f85e78797ecb849e29c805ef8
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DefaultSourceChangeHandler.java')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DefaultSourceChangeHandler.java | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DefaultSourceChangeHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DefaultSourceChangeHandler.java deleted file mode 100644 index ea0d695d1..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DefaultSourceChangeHandler.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.ide.eclipse.adt.internal.build; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResourceDelta; - -import java.util.HashSet; -import java.util.Set; - -/** - * Base source change handler for the {@link SourceProcessor} classes. - * - * It can be used as is, as long as the matching {@link SourceProcessor} properly implements - * its abstract methods, and the processor does not output resource files, - * or can be extended to provide custom implementation for: - * {@link #handleSourceFile(IFile, int)} - * {@link #handleGeneratedFile(IFile, int)} - * {@link #handleResourceFile(IFile, int)} - * {@link #filterResourceFolder(IContainer)} - * - */ -public class DefaultSourceChangeHandler implements SourceChangeHandler { - - private SourceProcessor mProcessor; - - /** List of source files found that are modified or new. */ - private final Set<IFile> mToCompile = new HashSet<IFile>(); - - /** List of source files that have been removed. */ - private final Set<IFile> mRemoved = new HashSet<IFile>(); - - @Override - public boolean handleGeneratedFile(IFile file, int kind) { - if (kind == IResourceDelta.REMOVED || kind == IResourceDelta.CHANGED) { - IFile sourceFile = mProcessor.isOutput(file); - if (sourceFile != null) { - mToCompile.add(sourceFile); - return true; - } - } - - return false; - } - - @Override - public void handleSourceFile(IFile file, int kind) { - // first the file itself if this is a match for the processor's extension - if (mProcessor.getExtensions().contains(file.getFileExtension())) { - if (kind == IResourceDelta.REMOVED) { - mRemoved.add(file); - } else { - mToCompile.add(file); - } - } - - // now the dependencies. In all case we compile the files that depend on the - // added/changed/removed file. - mToCompile.addAll(mProcessor.isDependency(file)); - } - - protected void addFileToCompile(IFile file) { - mToCompile.add(file); - } - - Set<IFile> getFilesToCompile() { - return mToCompile; - } - - protected void addRemovedFile(IFile file) { - mRemoved.add(file); - } - - Set<IFile> getRemovedFiles() { - return mRemoved; - } - - public void reset() { - mToCompile.clear(); - mRemoved.clear(); - } - - protected SourceProcessor getProcessor() { - return mProcessor; - } - - void init(SourceProcessor processor) { - mProcessor = processor; - } -} |