@@ -618,29 +618,20 @@ class FlutterPlugin implements Plugin<Project> {
618
618
}
619
619
620
620
private Boolean shouldSplitPerAbi () {
621
- if (project. hasProperty(' split-per-abi' )) {
622
- return project. property(' split-per-abi' ). toBoolean()
623
- }
624
- return false ;
621
+ return project. findProperty(' split-per-abi' )?. toBoolean() ?: false ;
625
622
}
626
623
627
624
private Boolean useLocalEngine () {
628
625
return project. hasProperty(' local-engine-repo' )
629
626
}
630
627
631
628
private Boolean isVerbose () {
632
- if (project. hasProperty(' verbose' )) {
633
- return project. property(' verbose' ). toBoolean()
634
- }
635
- return false
629
+ return project. findProperty(' verbose' )?. toBoolean() ?: false ;
636
630
}
637
631
638
632
/* * Whether to build the debug app in "fast-start" mode. */
639
633
private Boolean isFastStart () {
640
- if (project. hasProperty(" fast-start" )) {
641
- return project. property(" fast-start" ). toBoolean()
642
- }
643
- return false
634
+ return project. findProperty(" fast-start" )?. toBoolean() ?: false ;
644
635
}
645
636
646
637
private static Boolean isBuiltAsApp (Project project ) {
@@ -877,15 +868,21 @@ class FlutterPlugin implements Plugin<Project> {
877
868
}
878
869
String variantBuildMode = buildModeFor(variant. buildType)
879
870
String taskName = toCamelCase([" compile" , FLUTTER_BUILD_PREFIX , variant. name])
871
+ // Be careful when configuring task below, Groovy has bizarre
872
+ // scoping rules: writing `verbose isVerbose()` means calling
873
+ // `isVerbose` on the task itself - which would return `verbose`
874
+ // original value. You either need to hoist the value
875
+ // into a separate variable `verbose verboseValue` or prefix with
876
+ // `this` (`verbose this.isVerbose()`).
880
877
FlutterTask compileTask = project. tasks. create(name : taskName, type : FlutterTask ) {
881
878
flutterRoot this . flutterRoot
882
879
flutterExecutable this . flutterExecutable
883
880
buildMode variantBuildMode
884
881
localEngine this . localEngine
885
882
localEngineSrcPath this . localEngineSrcPath
886
883
targetPath getFlutterTarget()
887
- verbose isVerbose()
888
- fastStart isFastStart()
884
+ verbose this . isVerbose()
885
+ fastStart this . isFastStart()
889
886
fileSystemRoots fileSystemRootsValue
890
887
fileSystemScheme fileSystemSchemeValue
891
888
trackWidgetCreation trackWidgetCreationValue
@@ -1089,7 +1086,7 @@ abstract class BaseFlutterTask extends DefaultTask {
1089
1086
Boolean fastStart
1090
1087
@Input
1091
1088
String targetPath
1092
- @Optional @Internal
1089
+ @Optional @Input
1093
1090
Boolean verbose
1094
1091
@Optional @Input
1095
1092
String [] fileSystemRoots
0 commit comments