Skip to content

Commit 015cfa8

Browse files
authored
Fix FGP's generateLockfiles task always executing its action at configuration time (#162220)
![drake](https://github.com/user-attachments/assets/50ffcda6-263d-48c8-8853-207e757da6e0) This PR attempts to fix #110559 This PR supersedes #147837 Original attempt at fixing this by @GaryQian: #112723 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
1 parent 052be9c commit 015cfa8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/flutter_tools/gradle/src/main/groovy/flutter.groovy

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ class FlutterPlugin implements Plugin<Project> {
186186
Project rootProject = project.rootProject
187187
if (isFlutterAppProject()) {
188188
rootProject.tasks.register("generateLockfiles") {
189-
rootProject.subprojects.each { subproject ->
190-
String gradlew = (OperatingSystem.current().isWindows()) ?
191-
"${rootProject.projectDir}/gradlew.bat" : "${rootProject.projectDir}/gradlew"
192-
rootProject.exec {
193-
workingDir(rootProject.projectDir)
194-
executable(gradlew)
195-
args(":${subproject.name}:dependencies", "--write-locks")
189+
doLast {
190+
rootProject.subprojects.each { subproject ->
191+
String gradlew = (OperatingSystem.current().isWindows()) ?
192+
"${rootProject.projectDir}/gradlew.bat" : "${rootProject.projectDir}/gradlew"
193+
rootProject.exec {
194+
workingDir(rootProject.projectDir)
195+
executable(gradlew)
196+
args(":${subproject.name}:dependencies", "--write-locks")
197+
}
196198
}
197199
}
198200
}

0 commit comments

Comments
 (0)