Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IDE Gradle sync being slow because of lockfile generation #147837

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/flutter_tools/gradle/src/main/groovy/flutter.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,20 @@ class FlutterPlugin implements Plugin<Project> {
this.project = project

Project rootProject = project.rootProject
if (isFlutterAppProject()) {
boolean lockfilesExist = true
rootProject.subprojects.each { subproject ->
File projectLockfile = subproject.file("project-${subproject.name}.lockfile")
File buildscriptLockfile = subproject.file("buildscript-gradle.lockfile")

// project.logger.quiet("Project lockfile: ${projectLockfile}")
// project.logger.quiet("Buildscript lockfile: ${buildscriptLockfile}")

if (!(projectLockfile.exists() && subprojectLockfile.exists())) {
lockfilesExist = false
}
}

if (isFlutterAppProject() && !lockfilesExist) {
rootProject.tasks.register("generateLockfiles") {
rootProject.subprojects.each { subproject ->
String gradlew = (OperatingSystem.current().isWindows()) ?
Expand Down