Building and Tasks(构建和任务)
我们前面提到每一个Build Type会创建自己的assemble< name >task,但是Build Variant是Build Type和Product Flavor的组合。
当使用Product Flavor的时候,将会创建更多的assemble-type task。分别是:
- assemble< Variant Name >
允许直接构建一个Variant版本,例如
assembleFlavor1Debug
。 - assemble< Build Type Name >
允许构建指定Build Type的所有APK,例如
assembleDebug
将会构建Flavor1Debug和Flavor2Debug两个Variant版本。 - assemble< Product Flavor Name >
允许构建指定flavor的所有APK,例如
assembleFlavor1
将会构建Flavor1Debug和Flavor1Release两个Variant版本。
另外assemble
task会构建所有可能组合的Variant版本。