/// 获取渠道参数使用,这里设置一下默认值
def dartEnvironmentVariables = [
// 这里尽量不使用默认值,确保总是拿到命令行参数
channel: '_channel',
]
if (project.hasProperty('dart-defines')) {
dartEnvironmentVariables = dartEnvironmentVariables + project.property('dart-defines')
.split(',')
.collectEntries { entry ->
def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
[(pair.first()): pair.last()]
}
}
android {
if (dartEnvironmentVariables.channel == "google") {
// Instead, use the bundle block to control which types of configuration APKs
// you want your app bundle to support.
bundle {
language {
// Specifies that the app bundle should not support
// configuration APKs for language resources. These
// resources are instead packaged with each base and
// feature APK.
enableSplit = false
}
density {
// This property is set to true by default.
enableSplit = false
}
abi {
// This property is set to true by default.
enableSplit = false
}
}
}
}