有没有办法对要重用的 gradle 属性进行分组?我可以通过拥有重复的属性来完成以下操作,但我试图通过将它们分组到一个公共位置来避免这种情况。我有以下构建类型
buildTypes {
debug {}
qa {
applicationIdSuffix = ".qa" //Duplicate
}
qa2 {
applicationIdSuffix = ".qa" //Duplicate
}
release {}
}
flavors {
flagship {}
other1 {}
other2 {}
}
我已经定义了不同的风格,所以我认为我不能将共同的属性放在不同的风格中。我希望我能做类似的事情
def commonQaProps {
applicationIdSuffix = ".qa"
//Other properties
}
然后有
qa { commonQaProps }
qa2 { commonQaProps }
这样的事情可能吗?