Android插件DSL参考

版本3.1.0

介绍(Introduction)
  • 这是Android gradle DSL插件的参考文档。
  • 阅读时找到您正在使用的插件的扩展类型,例如AppExtension。
扩展类型(Extension types)

下面列出了各个插件使用的Gradle扩展类型

Type(类型) Description(描述)
App扩展 AppExtension 安卓扩展com.android.application工程
安卓库扩展 LibraryExtension 安卓扩展 com.android.library 工程
测试扩展TestExtension 安卓com.android.test 工程
及时应用FeatureExtension 安卓com.android. feature 工程
配置块(Configuration blocks)

下面列举了在android下可用的配置块。

Block Description 描述
aaptOptions { } Specifies options for the Android Asset Packaging Tool (AAPT). 指定Android资产打包工具(AAPT)的选项。
adbOptions { } Specifies options for the Android Debug Bridge (ADB), such as APK installation options. 指定Android调试桥(ADB)的选项,例如APK安装选项。
buildTypes { } Encapsulates all build type configurations for this project. 封装此项目的所有构建类型配置。
compileOptions { } Specifies Java compiler options, such as the language level of the Java source code and generated bytecode. 指定Java编译器选项,例如Java源代码的语言级别和生成的字节码。
dataBinding { } Specifies options for the Data Binding Library. 指定数据绑定库的选项
defaultConfig { } Specifies defaults for variant properties that the Android plugin applies to all build variants. 指定Android插件应用于所有构建变体的变体属性的默认值。
dexOptions { } Specifies options for the DEX tool, such as enabling library pre-dexing. 指定DEX工具的选项,例如启用库预分离。
externalNativeBuild { } Configures external native build using CMake or ndk-build. 使用CMake或ndk-build配置外部原生构建。
jacoco { } Configuring JaCoCo using this block is deprecated. 使用此块配置JaCoCo已弃用
lintOptions { } Specifies options for the lint tool. 指定lint工具的选项
packagingOptions { } Specifies options and rules that determine which files the Android plugin packages into your APK. 指定用于确定Android插件打包到APK中的哪些文件的选项和规则。
productFlavors { } Encapsulates all product flavors configurations for this project. 封装此项目的所有产品口味配置。
signingConfigs { } Encapsulates signing configurations that you can apply to BuildType and ProductFlavorconfigurations. 封装您可以应用于BuildType和ProductFlavor配置的签名配置。
sourceSets { } Encapsulates source set configurations for all variants. 封装所有变体的源设置配置。
splits { } Specifies configurations for building multiple APKs or APK splits. 指定用于构建多个APK或APK拆分的配置。
testOptions { } Specifies options for how the Android plugin should run local and instrumented tests. 指定Android插件如何运行本地和仪器测试的选项。

你可能感兴趣的:(Android插件DSL参考)