0

这是我的代码片段

val applicationId = when {
    this.name.contains("test") -> this.mergedFlavor.applicationId + ".test"
    this.name.contains("paidDebug") -> this.mergedFlavor.applicationId + ".dbg"
    this.name.contains("freeDebud") -> this.mergedFlavor.applicationId + ".dbg"
    this.name.contains("paidRelease") -> this.mergedFlavor.applicationId+ ".release"
    this.name.contains("freeRelease") -> this.mergedFlavor.applicationId+ ".release"
    else -> this.mergedFlavor.applicationId + ".development"
}
println(applicationId)
defaultConfig.applicationId = applicationId
println(this.applicationId)

但是将其更改为 defaultConfig 不会更改 applicationId。

4

0 回答 0