Unverified Commit f86bdf1a authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Fix bug where gradle build rule would rerun on switching from (#23183)

--track-widget-creation=false to
--track-widget-creation=true
but not when switching from
--track-widget-creation=true
to
--track-widget-creation=false

due to the surprising behavior of Gradle @Optional inputs.
parent 8b0de38e
...@@ -418,7 +418,7 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -418,7 +418,7 @@ abstract class BaseFlutterTask extends DefaultTask {
String[] fileSystemRoots String[] fileSystemRoots
@Optional @Input @Optional @Input
String fileSystemScheme String fileSystemScheme
@Optional @Input @Input
Boolean trackWidgetCreation Boolean trackWidgetCreation
@Optional @Input @Optional @Input
String compilationTraceFilePath String compilationTraceFilePath
......
...@@ -365,8 +365,8 @@ Future<void> _buildGradleProjectV2( ...@@ -365,8 +365,8 @@ Future<void> _buildGradleProjectV2(
if (target != null) { if (target != null) {
command.add('-Ptarget=$target'); command.add('-Ptarget=$target');
} }
if (buildInfo.trackWidgetCreation) assert(buildInfo.trackWidgetCreation != null);
command.add('-Ptrack-widget-creation=true'); command.add('-Ptrack-widget-creation=${buildInfo.trackWidgetCreation}');
if (buildInfo.compilationTraceFilePath != null) if (buildInfo.compilationTraceFilePath != null)
command.add('-Pprecompile=${buildInfo.compilationTraceFilePath}'); command.add('-Pprecompile=${buildInfo.compilationTraceFilePath}');
if (buildInfo.buildHotUpdate) if (buildInfo.buildHotUpdate)
......
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