Commit 422e56c2 authored by Jorge Coca's avatar Jorge Coca Committed by Todd Volkert

Added support for Gradle productFlavors that are not only lowercase (#22767)

Fixes https://github.com/flutter/flutter/issues/19507
parent 8bfb4b3e
......@@ -503,8 +503,8 @@ class GradleProject {
String _productFlavorFor(BuildInfo buildInfo) {
if (buildInfo.flavor == null)
return productFlavors.isEmpty ? '' : null;
else if (productFlavors.contains(buildInfo.flavor.toLowerCase()))
return buildInfo.flavor.toLowerCase();
else if (productFlavors.contains(buildInfo.flavor))
return buildInfo.flavor;
else
return null;
}
......
......@@ -138,6 +138,10 @@ someOtherTask
expect(project.assembleTaskFor(const BuildInfo(BuildMode.release, 'paid')), 'assemblePaidRelease');
expect(project.assembleTaskFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
});
test('should respect format of the flavored build types', () {
final GradleProject project = GradleProject(<String>['debug'], <String>['randomFlavor'], fs.directory('/some/dir'));
expect(project.assembleTaskFor(const BuildInfo(BuildMode.debug, 'randomFlavor')), 'assembleRandomFlavorDebug');
});
});
group('Gradle local.properties', () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment