Tried to name my productFlavor as "test" and received the error:
ERROR: ProductFlavor names cannot start with 'test'
From the source code I see the simple check:
private void addBuildType(BuildType buildType) {
if (buildType.name.startsWith("test")) {
throw new RuntimeException("BuildType names cannot start with 'test'")
}...
}
Appears I can use names like "myTest", "aTest", etc., but not "test1", "test2" etc. Any possible reason for this? Thanks.
As you can see in this Google repository line 93
private void addBuildType(BuildType buildType) {
if (buildType.name.startsWith("test")) {
throw new RuntimeException("BuildType names cannot start with 'test'")
}
if (productFlavors.containsKey(buildType.name)) {
throw new RuntimeException("BuildType names cannot collide with ProductFlavor names")
}
def sourceSet = project.sourceSets.add(buildType.name)
BuildTypeData buildTypeData = new BuildTypeData(buildType, sourceSet, project)
project.tasks.assemble.dependsOn buildTypeData.assembleTask
buildTypes[buildType.name] = buildTypeData
}
So addBuildType
method has its own exception about not using test
name . you can't use this . and why they made this decision. No one can answer except google.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With