com.android.build.gradle.tasks.AidlCompile.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-core Show documentation
Show all versions of gradle-core Show documentation
Core library to build Android Gradle plugin.
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
*
* 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.build.gradle.tasks
import com.android.annotations.NonNull
import com.android.annotations.Nullable
import com.android.annotations.concurrency.GuardedBy
import com.android.build.gradle.internal.tasks.IncrementalTask
import com.android.builder.compiling.DependencyFileProcessor
import com.android.builder.internal.incremental.DependencyData
import com.android.builder.internal.incremental.DependencyDataStore
import com.android.ide.common.internal.WaitableExecutor
import com.android.ide.common.res2.FileStatus
import com.google.common.collect.Lists
import com.google.common.collect.Multimap
import org.gradle.api.file.FileTree
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.util.PatternSet
import java.util.concurrent.Callable
/**
* Task to compile aidl files. Supports incremental update.
*/
public class AidlCompile extends IncrementalTask {
private static final String DEPENDENCY_STORE = "dependency.store"
// ----- PUBLIC TASK API -----
@OutputDirectory
File sourceOutputDir
@OutputDirectory @Optional
File aidlParcelableDir
// ----- PRIVATE TASK API -----
@Input
String getBuildToolsVersion() {
getBuildTools().getRevision()
}
List sourceDirs
@InputFiles
List importDirs
final PatternSet patternSet = new PatternSet().include("**/*.aidl")
@InputFiles
FileTree getSourceFiles() {
FileTree src = null
Set sources = getSourceDirs()
if (!sources.isEmpty()) {
src = getProject().files(new ArrayList