From 0e720e84a42626594fd67a7d69c7350f4d69366b Mon Sep 17 00:00:00 2001 From: Mohellebi abdessalem Date: Mon, 5 Aug 2024 14:56:14 +0100 Subject: [PATCH] reduce warnings inside flutter.groovy file (#152073) In the context of [issue #146036](https://github.com/flutter/flutter/issues/146036), the flutter.groovy file, considering [issue #147122](https://github.com/flutter/flutter/issues/147122), currently has only two of the buildDir instances replaced. The other two instances have issues that require more investigation. --- .../flutter_tools/gradle/src/main/groovy/flutter.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy index 22efaf3ff4..094d9361df 100644 --- a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy +++ b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy @@ -332,7 +332,7 @@ class FlutterPlugin implements Plugin { // -> Kotlin migration, we should remove this complexity and perform the checks inside // of the main Flutter Gradle Plugin. // See https://github.com/flutter/flutter/issues/121541#issuecomment-1920363687. - final Boolean shouldSkipDependencyChecks = project.hasProperty("skipDependencyChecks") && project.getProperty("skipDependencyChecks"); + final Boolean shouldSkipDependencyChecks = project.hasProperty("skipDependencyChecks") && project.getProperty("skipDependencyChecks") if (!shouldSkipDependencyChecks) { try { final String dependencyCheckerPluginPath = Paths.get(flutterRoot.absolutePath, @@ -1272,7 +1272,7 @@ class FlutterPlugin implements Plugin { trackWidgetCreation(trackWidgetCreationValue) targetPlatformValues = targetPlatforms sourceDir(getFlutterSourceDirectory()) - intermediateDir(project.file("${project.buildDir}/$INTERMEDIATES_DIR/flutter/${variant.name}/")) + intermediateDir(project.file(project.layout.buildDirectory.dir("$INTERMEDIATES_DIR/flutter/${variant.name}/"))) frontendServerStarterPath(frontendServerStarterPathValue) extraFrontEndOptions(extraFrontEndOptionsValue) extraGenSnapshotOptions(extraGenSnapshotOptionsValue) @@ -1287,7 +1287,7 @@ class FlutterPlugin implements Plugin { validateDeferredComponents(validateDeferredComponentsValue) flavor(flavorValue) } - File libJar = project.file("${project.buildDir}/$INTERMEDIATES_DIR/flutter/${variant.name}/libs.jar") + File libJar = project.file(project.layout.buildDirectory.dir("$INTERMEDIATES_DIR/flutter/${variant.name}/libs.jar")) Task packJniLibsTask = project.tasks.create(name: "packJniLibs${FLUTTER_BUILD_PREFIX}${variant.name.capitalize()}", type: Jar) { destinationDirectory = libJar.parentFile archiveFileName = libJar.name