-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add Gradle lockfiles and tool to generate them #83067
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
Conversation
@@ -2,14 +2,24 @@ | |||
// Use of this source code is governed by a BSD-style license that can be | |||
// found in the LICENSE file. | |||
|
|||
// This file is auto generated. | |||
// To update all the build.gradle files in the Flutter repo, | |||
// See dev/tools/bin/generate_gradle_lockfiles.dart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root build.gradle file will be auto-generated after this PR, and every plugin with Gradle dependency will also have its own lockfile. See https://github.com/flutter/flutter/tree/46d887f30003b5843911cf665af942c9c37fb23b/dev/benchmarks/complex_layout/android
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nits. I think making the script work on Windows would be beneficial.
Please revert the unrelated files (*.xcconfig, *.h, *.cc).
Consider landing this in two steps: one where we just update all the gradle deps, and one where we actually add the lock files (or vice versa). Right now doing both may make it harder to bisect if anything goes wrong in devicelab.
@@ -1 +1,2 @@ | |||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unrelated to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmagman would it be ok to add this file to .gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files were created after flutter pub get
, which is required prior to creating the lockfiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just go through and update all of these then in a separate pr. Or alternatively gitignore them and remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These xcconfigs should be checked into the project, not gitignored. I'm not sure why it's not already for dev/benchmarks/complex_layout
. I can look into that in another PR.
|
||
void main(List<String> arguments) { | ||
print( | ||
"Usage: find . -type d -name 'android' | dart dev/tools/bin/generate_gradle_lockfiles.dart\n\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also nit: this makes it harder for developers on windows to run this script. Consider changing this to a file path argument where we just read the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be the issue? I have added a section about how to enter the files manually to write to the stdin pipe.
FWIW, the blaze command (internally) works this way for running multiple targets at once. I don't know what part wouldn't work on Windows since powershell also has support for the pipe operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh ok, so I guess on Windows you could just use something like gci -Recurse -Directory -Name "android" | dart ...
. That should be fine then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@godofredoc I'd like to see if this change also makes Gradle builds fasters. Is there a SQL I could run to see the before/after of this change? |
@@ -1 +0,0 @@ | |||
#include "Generated.xcconfig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't delete this file.
@@ -1 +0,0 @@ | |||
#include "Generated.xcconfig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When will generate_gradle_lockfiles need to be run?
@jmagman it would need to be run if a Gradle dependencies is added or modified from these apps. That includes modifying Flutter plugins. I've added a custom Gradle error to https://github.com/flutter/flutter/pull/83067/files#diff-c0a1cddc5ca2d811173e4bd32e800ed637b1203c37a22907703b2eaa00899dbb to guide folks on how to resolve this issue on their own. |
Here: flutter/packages/flutter_tools/lib/src/android/gradle_errors.dart Lines 436 to 459 in a7cd63e
|
…restore testing deprecated (plugins.each) state
…each) (#140037) Restore testing deprecated settings.gradle (plugins.each). Updated presumably by accident in #83067 Split from #137115 See also #137115 (comment)
…each) (flutter#140037) Restore testing deprecated settings.gradle (plugins.each). Updated presumably by accident in flutter#83067 Split from flutter#137115 See also flutter#137115 (comment)
Related issue: #82745
Checks in the .lockfiles and adds a tool to generate them across the Flutter repo.
To regenerate these files, run
find . -type d -name 'android' | dart dev/tools/bin/generate_gradle_lockfiles.dart
from the root of the Flutter repo.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.