@@ -618,29 +618,20 @@ class FlutterPlugin implements Plugin<Project> {
618618 }
619619
620620 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 ;
625622 }
626623
627624 private Boolean useLocalEngine () {
628625 return project. hasProperty(' local-engine-repo' )
629626 }
630627
631628 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 ;
636630 }
637631
638632 /* * Whether to build the debug app in "fast-start" mode. */
639633 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 ;
644635 }
645636
646637 private static Boolean isBuiltAsApp (Project project ) {
@@ -877,15 +868,21 @@ class FlutterPlugin implements Plugin<Project> {
877868 }
878869 String variantBuildMode = buildModeFor(variant. buildType)
879870 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()`).
880877 FlutterTask compileTask = project. tasks. create(name : taskName, type : FlutterTask ) {
881878 flutterRoot this . flutterRoot
882879 flutterExecutable this . flutterExecutable
883880 buildMode variantBuildMode
884881 localEngine this . localEngine
885882 localEngineSrcPath this . localEngineSrcPath
886883 targetPath getFlutterTarget()
887- verbose isVerbose()
888- fastStart isFastStart()
884+ verbose this . isVerbose()
885+ fastStart this . isFastStart()
889886 fileSystemRoots fileSystemRootsValue
890887 fileSystemScheme fileSystemSchemeValue
891888 trackWidgetCreation trackWidgetCreationValue
@@ -1089,7 +1086,7 @@ abstract class BaseFlutterTask extends DefaultTask {
10891086 Boolean fastStart
10901087 @Input
10911088 String targetPath
1092- @Optional @Internal
1089+ @Optional @Input
10931090 Boolean verbose
10941091 @Optional @Input
10951092 String [] fileSystemRoots
0 commit comments