abstract class BaseExtension extends Object
Base 'android' extension for all android plugins.
This is never used directly. Instead,
com.android.application
uses AppExtensioncom.android.library
uses LibraryExtensioncom.android.test
uses TestedExtensionType | Name and description |
---|---|
AaptOptions |
aaptOptions Options for aapt, tool for packaging resources. |
AdbOptions |
adbOptions Adb options |
org.gradle.api.NamedDomainObjectContainer<BuildType> |
buildTypes Build types used by this project. |
CompileOptions |
compileOptions Compile options |
ProductFlavor |
defaultConfig Default config, shared by all flavors. |
DexOptions |
dexOptions Dex options. |
List<String> |
flavorDimensionList |
boolean |
generatePureSplits |
JacocoExtension |
jacoco JaCoCo options. |
LintOptions |
lintOptions Lint options. |
PackagingOptions |
packagingOptions Packaging options. |
PreprocessingOptions |
preprocessingOptions Options to control resources preprocessing. |
org.gradle.api.NamedDomainObjectContainer<CoreProductFlavor> |
productFlavors All product flavors used by this project. |
String |
resourcePrefix A prefix to be used when creating new resources. |
org.gradle.api.NamedDomainObjectContainer<SigningConfig> |
signingConfigs Signing configs used by this project. |
org.gradle.api.NamedDomainObjectContainer<AndroidSourceSet> |
sourceSetsContainer The source sets container. |
Splits |
splits APK splits options. |
TestOptions |
testOptions Options for running tests. |
Constructor and description |
---|
BaseExtension
(org.gradle.api.internal.project.ProjectInternal project, org.gradle.internal.reflect.Instantiator instantiator, AndroidBuilder androidBuilder, SdkHandler sdkHandler, org.gradle.api.NamedDomainObjectContainer<BuildType> buildTypes, org.gradle.api.NamedDomainObjectContainer<ProductFlavor> productFlavors, org.gradle.api.NamedDomainObjectContainer<SigningConfig> signingConfigs, ExtraModelInfo extraModelInfo, boolean isLibrary) |
Type | Name and description |
---|---|
void |
aaptOptions(org.gradle.api.Action<AaptOptions> action) Configures aapt options. |
void |
adbOptions(org.gradle.api.Action<AdbOptions> action) Configures adb options. |
void |
addVariant(BaseVariant variant) |
void |
buildToolsVersion(String version) |
void |
buildTypes(org.gradle.api.Action<? super org.gradle.api.NamedDomainObjectContainer<BuildType>> action) Configures the build types. |
protected def |
checkWritability() |
void |
compileOptions(org.gradle.api.Action<CompileOptions> action) Configures compile options. |
void |
compileSdkVersion(String version) Sets the compile SDK version, based on full SDK version string, e.g. |
void |
compileSdkVersion(int apiLevel) Sets the compile SDK version, based on API level, e.g. 21 for Lollipop. |
protected void |
createConfiguration(org.gradle.api.artifacts.ConfigurationContainer configurations, String configurationName, String configurationDescription) |
void |
defaultConfig(org.gradle.api.Action<ProductFlavor> action) The default configuration, inherited by all build flavors (if any are defined). |
void |
defaultPublishConfig(String value) |
void |
deviceProvider(com.android.builder.testing.api.DeviceProvider deviceProvider) |
void |
dexOptions(org.gradle.api.Action<DexOptions> action) Configures dex options. |
void |
disableWrite() Disallow further modification on the extension. |
void |
enforceUniquePackageName(boolean value) |
void |
flavorDimensions(String... dimensions) |
void |
generatePureSplits(boolean flag) |
File |
getAdbExe() |
List<File> |
getBootClasspath() |
com.android.sdklib.repository.FullRevision |
getBuildToolsRevision() |
String |
getBuildToolsVersion() Required. |
String |
getCompileSdkVersion() Required. |
File |
getDefaultProguardFile(String name) |
String |
getDefaultPublishConfig() Name of the configuration used to build the default artifact of this project. |
List<com.android.builder.testing.api.DeviceProvider> |
getDeviceProviders() |
boolean |
getEnforceUniquePackageName() |
Collection<LibraryRequest> |
getLibraryRequests() |
File |
getNdkDirectory() |
Boolean |
getPackageBuildConfig() |
boolean |
getPublishNonDefault() Whether to publish artifacts for all configurations, not just the default one. |
File |
getSdkDirectory() |
org.gradle.api.NamedDomainObjectContainer<AndroidSourceSet> |
getSourceSets() All source sets. |
List<com.android.builder.testing.api.TestServer> |
getTestServers() |
Closure<Void> |
getVariantFilter() A variant filter to control which variants are excluded. |
void |
jacoco(org.gradle.api.Action<JacocoExtension> action) Configures JaCoCo options. |
void |
lintOptions(org.gradle.api.Action<LintOptions> action) Configure lint options. |
void |
packagingOptions(org.gradle.api.Action<PackagingOptions> action) Configures packaging options. |
void |
preprocessingOptions(org.gradle.api.Action<PreprocessingOptions> action) Configures preprocessing options. |
void |
productFlavors(org.gradle.api.Action<? super org.gradle.api.NamedDomainObjectContainer<CoreProductFlavor>> action) Configures the product flavors. |
void |
publishNonDefault(boolean value) |
void |
registerArtifactType(String name, boolean isTest, int artifactType) |
void |
registerBuildTypeSourceProvider(String name, BuildType buildType, com.android.builder.model.SourceProvider sourceProvider) |
void |
registerJavaArtifact(String name, BaseVariant variant, String assembleTaskName, String javaCompileTaskName, Collection<File> generatedSourceFolders, Iterable<String> ideSetupTaskNames, org.gradle.api.artifacts.Configuration configuration, File classesFolder, File javaResourceFolder, com.android.builder.model.SourceProvider sourceProvider) |
void |
registerMultiFlavorSourceProvider(String name, String flavorName, com.android.builder.model.SourceProvider sourceProvider) |
void |
registerProductFlavorSourceProvider(String name, CoreProductFlavor productFlavor, com.android.builder.model.SourceProvider sourceProvider) |
void |
resourcePrefix(String prefix) |
void |
setBuildToolsVersion(String version) |
void |
setCompileSdkVersion(int apiLevel) |
void |
setCompileSdkVersion(String target) |
void |
setDefaultPublishConfig(String value) |
void |
setEnforceUniquePackageName(boolean value) |
void |
setVariantFilter(Closure<Void> filter) |
void |
signingConfigs(org.gradle.api.Action<? super org.gradle.api.NamedDomainObjectContainer<SigningConfig>> action) Configures the signing configs. |
void |
sourceSets(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<AndroidSourceSet>> action) Configures the source sets. |
void |
splits(org.gradle.api.Action<Splits> action) Configures APK splits. |
void |
testOptions(org.gradle.api.Action<TestOptions> action) Configures the test options. |
void |
testServer(com.android.builder.testing.api.TestServer testServer) |
void |
useLibrary(String name) Request the use a of Library. |
void |
useLibrary(String name, boolean required) Request the use a of Library. |
void |
variantFilter(Closure<Void> filter) |
com.android.builder.model.SourceProvider |
wrapJavaSourceSet(org.gradle.api.tasks.SourceSet sourceSet) |
Options for aapt, tool for packaging resources.
Adb options
Build types used by this project.
Compile options
Default config, shared by all flavors.
Dex options.
JaCoCo options.
Lint options.
Packaging options.
Options to control resources preprocessing. Not finalized yet.
All product flavors used by this project.
A prefix to be used when creating new resources. Used by Studio
Signing configs used by this project.
The source sets container.
APK splits options.
See APK Splits.
Options for running tests.
Configures aapt options.
Configures adb options.
Configures the build types.
Configures compile options.
Sets the compile SDK version, based on full SDK version string, e.g.
android-21
for Lollipop.
Sets the compile SDK version, based on API level, e.g. 21 for Lollipop.
The default configuration, inherited by all build flavors (if any are defined).
Configures dex options.
Disallow further modification on the extension.
Required. Version of the build tools to use.
Value assigned to this property is parsed and stored in a normalized form, so reading it back may give a slightly different string.
Required. Compile SDK version.
Your code will be compiled against the android.jar from this API level. You should generally use the most up-to-date SDK version here. Use the Lint tool to make sure you don't use APIs not available in earlier platform version without checking.
Setter can be called with a string like "android-21" or a number.
Value assigned to this property is parsed and stored in a normalized form, so reading it back may give a slightly different string.
Name of the configuration used to build the default artifact of this project.
Whether to publish artifacts for all configurations, not just the default one.
All source sets. Note that the Android plugin uses its own implementation of source sets, AndroidSourceSet.
A variant filter to control which variants are excluded.
The filter is a closure which is passed a single object of type VariantFilter. It should set the VariantFilter.setIgnore flag to filter out the given variant.
Configures JaCoCo options.
Configure lint options.
Configures packaging options.
Configures preprocessing options.
Configures the product flavors.
Configures the signing configs.
Configures the source sets. Note that the Android plugin uses its own implementation of source sets, AndroidSourceSet.
Configures APK splits.
Configures the test options.
Request the use a of Library. The library is then added to the classpath.
name
- the name of the library.Request the use a of Library. The library is then added to the classpath.
name
- the name of the library.required
- if using the library requires a manifest entry, the entry will
indicate that the library is not required.Gradle API 1.3.0