Class AndroidProjectPlugin
- java.lang.Object
-
- io.freefair.gradle.plugins.android.AndroidProjectPlugin
-
- Direct Known Subclasses:
AndroidAspectJPostCompileWeavingPlugin
,AndroidAspectJTransformPlugin
,AndroidCodeQualityHelper
,AndroidComponentPlugin
,AndroidJavadocJarPlugin
,AndroidJavadocPlugin
,AndroidLombokPlugin
,AndroidMavenPublishAllVariantsPlugin
,AndroidMavenPublishBasePlugin
,AndroidMavenPublishPlugin
,AndroidSourcesJarPlugin
,CiDexPlugin
,CiLintPlugin
public abstract class AndroidProjectPlugin extends Object implements Plugin<Project>
Abstract base class for all android relatedplugins
. Provides type-safe access to theandroid
-extension and thevariant
collection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AndroidProjectPlugin.ProjectType
-
Constructor Summary
Constructors Constructor Description AndroidProjectPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Project project)
protected static Provider<FileTree>
getAllJava(com.android.build.gradle.api.BaseVariant androidSourceSet)
All Java source files for this source set.com.android.build.gradle.TestedExtension
getAndroidExtension()
DomainObjectSet<? extends com.android.build.gradle.api.BaseVariant>
getAndroidVariants()
protected Provider<FileCollection>
getCompileClasspath(com.android.build.gradle.api.BaseVariant variant)
Returns the classpath used to compile this source.protected Provider<FileTree>
getOutput(com.android.build.gradle.api.BaseVariant androidSourceSet)
Project
getProject()
AndroidProjectPlugin.ProjectType
getProjectType()
protected static String
getTaskName(com.android.build.gradle.api.BaseVariant variant, String verb, String target)
Returns the name of a task for this source set.DomainObjectSet<com.android.build.gradle.api.TestVariant>
getTestVariants()
DomainObjectSet<com.android.build.gradle.api.UnitTestVariant>
getUnitTestVariants()
protected boolean
publishVariant(com.android.build.gradle.api.BaseVariant variant)
protected void
withAndroid(com.android.build.gradle.TestedExtension extension)
-
-
-
Method Detail
-
withAndroid
protected void withAndroid(com.android.build.gradle.TestedExtension extension)
-
getAndroidExtension
public com.android.build.gradle.TestedExtension getAndroidExtension()
-
getAndroidVariants
public DomainObjectSet<? extends com.android.build.gradle.api.BaseVariant> getAndroidVariants()
-
getTestVariants
@Nonnull public DomainObjectSet<com.android.build.gradle.api.TestVariant> getTestVariants()
-
getUnitTestVariants
@Nonnull public DomainObjectSet<com.android.build.gradle.api.UnitTestVariant> getUnitTestVariants()
-
publishVariant
protected boolean publishVariant(com.android.build.gradle.api.BaseVariant variant)
-
getTaskName
protected static String getTaskName(com.android.build.gradle.api.BaseVariant variant, String verb, String target)
Returns the name of a task for this source set.- Parameters:
verb
- The action, may be null.target
- The target, may be null- Returns:
- The task name, generally of the form ${verb}${name}${noun}
- See Also:
SourceSet.getTaskName(String, String)
-
getCompileClasspath
protected Provider<FileCollection> getCompileClasspath(com.android.build.gradle.api.BaseVariant variant)
Returns the classpath used to compile this source.- Returns:
- The classpath. Never returns null.
- See Also:
SourceSet.getCompileClasspath()
-
getAllJava
protected static Provider<FileTree> getAllJava(com.android.build.gradle.api.BaseVariant androidSourceSet)
All Java source files for this source set. This includes, for example, source which is directly compiled, and source which is indirectly compiled through joint compilation.- Returns:
- the Java source. Never returns null.
- See Also:
SourceSet.getAllJava()
-
getOutput
protected Provider<FileTree> getOutput(com.android.build.gradle.api.BaseVariant androidSourceSet)
- See Also:
SourceSet.getOutput()
-
getProjectType
@Nullable public AndroidProjectPlugin.ProjectType getProjectType()
-
getProject
public Project getProject()
-
-