-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Use FlutterProject to locate files #18913
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
mravn-google
left a comment
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
| copyDirectorySync( | ||
| cache.getArtifactDirectory('gradle_wrapper'), | ||
| fs.directory(fs.path.join(projectDir, 'android')), | ||
| project.directory.childDirectory('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.
project.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.
Done
| final File file = iosProject.xcodeConfigFor(mode); | ||
| if (file.existsSync()) { | ||
| final String content = file.readAsStringSync(); | ||
| final String content = iosProject.xcodeConfigFor(mode).readAsStringSync(); |
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.
Could we not retain the use of file here?
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.
Yes!
Done
|
|
||
| final File podfileFile = iosProject.podfile; | ||
| final File podfileLockFile = iosProject.podfileLock; | ||
| final File manifestLockFile =iosProject.podManifestLock; |
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.
Add space after =
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.
Done
| if (!Cache.instance.fileOlderThanToolsStamp(propertiesFile)) { | ||
| Future<void> generateXcodeProperties({FlutterProject project}) async { | ||
| if ((await project.manifest).isModule || | ||
| project.directory.childDirectory('ios').existsSync()) { |
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.
project.ios.directory.existsSync()?
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.
Done
| 'main', | ||
| 'java', | ||
| ); | ||
| final String registryPath = fs.path.join(javaSourcePath, |
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] Move javaSourcePath, to the next line.
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.
Done
| Future<File> _androidLocalPropertiesFile; | ||
|
|
||
| Future<File> get generatedXcodePropertiesFile { | ||
| return _generatedXcodeProperties ??= manifest.then((FlutterManifest manifest) { |
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.
Add <File> after 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.
Done
| IosModuleProject get iosModule => new IosModuleProject(directory.childDirectory('.ios')); | ||
|
|
||
| Future<File> get androidLocalPropertiesFile { | ||
| return _androidLocalPropertiesFile ??= manifest.then((FlutterManifest manifest) { |
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.
Add <File> after 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.
Done
| } | ||
| File _flutterPluginsDotFile; | ||
|
|
||
| Future<Directory> get androidPluginRegistrantDirectory async { |
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.
This Directory is not where we should place the registrant. It is the Android sub project in which we should place the registrant. This discrepancy might be confusing.
Maybe androidPluginHost or similar?
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.
Better!
Done
| } | ||
| Future<Directory> _androidPluginRegistrantDirectory; | ||
|
|
||
| Future<Directory> get iosPluginRegistrantDirectory async { |
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.
Similarly here.
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.
Done
| new FlutterProject(directory).directory.absolute.path, | ||
| directory.absolute.path, | ||
| ); | ||
| directory.absolute.path,); |
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.
Please put the ); back to whence it came.
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.
ok, ok... will do );
sigurdm
left a comment
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.
Thanks for the review!
| copyDirectorySync( | ||
| cache.getArtifactDirectory('gradle_wrapper'), | ||
| fs.directory(fs.path.join(projectDir, 'android')), | ||
| project.directory.childDirectory('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.
Done
| final File file = iosProject.xcodeConfigFor(mode); | ||
| if (file.existsSync()) { | ||
| final String content = file.readAsStringSync(); | ||
| final String content = iosProject.xcodeConfigFor(mode).readAsStringSync(); |
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.
Yes!
Done
|
|
||
| final File podfileFile = iosProject.podfile; | ||
| final File podfileLockFile = iosProject.podfileLock; | ||
| final File manifestLockFile =iosProject.podManifestLock; |
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.
Done
| if (!Cache.instance.fileOlderThanToolsStamp(propertiesFile)) { | ||
| Future<void> generateXcodeProperties({FlutterProject project}) async { | ||
| if ((await project.manifest).isModule || | ||
| project.directory.childDirectory('ios').existsSync()) { |
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.
Done
| 'main', | ||
| 'java', | ||
| ); | ||
| final String registryPath = fs.path.join(javaSourcePath, |
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.
Done
| Future<File> _androidLocalPropertiesFile; | ||
|
|
||
| Future<File> get generatedXcodePropertiesFile { | ||
| return _generatedXcodeProperties ??= manifest.then((FlutterManifest manifest) { |
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.
Done
| } | ||
| Future<File> _generatedXcodeProperties; | ||
|
|
||
| File get flutterPluginsDotFile { |
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.
Done
| } | ||
| File _flutterPluginsDotFile; | ||
|
|
||
| Future<Directory> get androidPluginRegistrantDirectory async { |
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.
Better!
Done
| } | ||
| Future<Directory> _androidPluginRegistrantDirectory; | ||
|
|
||
| Future<Directory> get iosPluginRegistrantDirectory async { |
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.
Done
| new FlutterProject(directory).directory.absolute.path, | ||
| directory.absolute.path, | ||
| ); | ||
| directory.absolute.path,); |
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.
ok, ok... will do );
|
@szakarias Could you take a look. Especially the latest commit? |
# Conflicts: # packages/flutter_tools/lib/src/plugins.dart
szakarias
left a comment
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
| class AndroidApk extends ApplicationPackage { | ||
| /// Path to the actual apk file. | ||
| final String apkPath; | ||
| final File apk; |
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.
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.
Done
| const String gradleManifestPath = 'android/app/src/main/AndroidManifest.xml'; | ||
| const String gradleAppOutV1 = 'android/app/build/outputs/apk/app-debug.apk'; | ||
| const String gradleAppOutDirV1 = 'android/app/build/outputs/apk'; | ||
|
|
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.
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.
Removed
| // command will grab a new AndroidApk after building, to get the updated | ||
| // IDs. | ||
| manifestPath = gradleManifestPath; | ||
| manifest = androidProject.gradleManifestFile; |
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.
set manifest outside the if and place it together with the exists check.
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.
Done
| return null; | ||
|
|
||
| final String manifestString = fs.file(manifestPath).readAsStringSync(); | ||
| final String manifestString = fs.file(manifest).readAsStringSync(); |
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.
manifest is now a 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.
Done
| /// Creates a new IOSApp from an existing app bundle or IPA. | ||
| factory IOSApp.fromPrebuiltApp(String applicationBinary) { | ||
| final FileSystemEntityType entityType = fs.typeSync(applicationBinary); | ||
| factory IOSApp.fromPrebuiltApp(File apk) { |
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.
Keep applicationBinary as name?
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.
Done
|
|
||
| Future<ApplicationPackage> getApplicationPackageForPlatform(TargetPlatform platform, { | ||
| String applicationBinary | ||
| File apk |
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.
Keep applicationBinary ?
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.
Done
| package = await getApplicationPackageForPlatform( | ||
| targetPlatform, | ||
| applicationBinary: hotRunner.applicationBinary | ||
| apk: hotRunner.applicationBinary |
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.
Keep applicationBinary ?
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.
Done
# Conflicts: # packages/flutter_tools/test/android/gradle_test.dart # packages/flutter_tools/test/ios/xcodeproj_test.dart
This reverts commit 57d78cc.
* flutter_master: (810 commits) Revert engine roll to 316b026 roll engine to 316b026 (flutter#19419) Revert "enable lint unnecessary_const (flutter#19342)" (flutter#19423) enable lint unnecessary_const (flutter#19342) Chevrons in month picker are semi-transparent when the month is scrolled (flutter#19363) Revert "Use FlutterProject to locate files (flutter#18913)" (flutter#19409) Extra debug information in run_release_test (flutter#19405) Fix typo (flutter#19402) Use FlutterProject to locate files (flutter#18913) Revert "roll engine to 9af920e (flutter#19365)" (flutter#19376) roll engine to 9af920e (flutter#19365) increase cache size if image is loaded that is larger than max size (flutter#19352) Add Bash and Zsh command-line completion for flutter (flutter#19243) Support keyboardAppearance field for iOS (flutter#19244) Add option to silence driver extension errors (flutter#19247) Add HeroController to CupertinoApp (flutter#19326) have text finder convert Text.rich to plain text for comparison (flutter#19270) Correct contentPadding type in InputDecoration.debugFillProperties (flutter#19318) Revert "Revert "Use runTests in fuchsia tester. (flutter#19178)" (flutter#19321)" (flutter#19327) Roll engine to c5a63d (flutter#19288) ...
…lutter#19409)" This reverts commit 6a8f904.
A bit of cleanup of flutter_tools' handling of project directories and manifests.