안드로이드 개발 컴파일 빠르게
android {
...
flavorDimensions "stage", "mode"
productFlavors {
dev {
dimension "stage"
versionCode 100
minSdkVersion 21
aaptOptions.cruncherEnabled = false
resConfigs "ko", "xxxhdpi"
}
prd {
dimension "stage"
versionCode new Date().format('yyMMddHHmm').toInteger()
}
free {
dimension "mode"
applicationIdSuffix ".free"
}
paid {
dimension "mode"
applicationIdSuffix ".paid"
}
}
splits {
abi {
enable true
reset()
include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
universalApk false
}
}
android.variantFilter { variant ->
def buildName = variant.buildType.name;
def flavorName = variant.getFlavors().get(0).name;
if (flavorName == 'dev' && buildName == 'release'
|| flavorName == 'prd' && buildName == 'debug') {
variant.setIgnore(true);
}
splits.abi.enable = (flavorName == 'prd');
}
}