Gradle实现多渠道打包
前言
待梳理
示例Gradle文件
apply plugin: 'com.android.application'
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:26.1.0'
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
lintOptions {
checkReleaseBuilds false
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
applicationId "com.qweasdd.auth"
minSdkVersion 15
targetSdkVersion 26
versionCode 1010102
versionName "1.01.01.01"
flavorDimensions "auth"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
//配置编译时需要编译的版本
productFlavors {
/*beta {
applicationId "com.qweasdd.auth"
dimension "auth"
buildConfigField 'int', 'MarketCode', '100'
}*/
bjctv {
applicationId "com.qweasdd.authority_bpackj"
dimension "auth"
minSdkVersion 19
targetSdkVersion 25
versionCode 22
versionName '1.22'
buildConfigField 'int', 'MarketCode', '101'
buildConfigField 'String', 'PackageName', '"com.qweasdd.authority_bpackj"'
buildConfigField 'String', 'MainClassName', '"com.qweasdd.authority.activity.AuthentyActivity"'
}
haincmv {