Use FlutterProject to locate files #18913
Conversation
| copyDirectorySync( | ||
| cache.getArtifactDirectory('gradle_wrapper'), | ||
| fs.directory(fs.path.join(projectDir, 'android')), | ||
| project.directory.childDirectory('android'), |
| 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.
Could we not retain the use of file here?
|
|
||
| final File podfileFile = iosProject.podfile; | ||
| final File podfileLockFile = iosProject.podfileLock; | ||
| final File manifestLockFile =iosProject.podManifestLock; |
| 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.
project.ios.directory.existsSync()?
| 'main', | ||
| 'java', | ||
| ); | ||
| final String registryPath = fs.path.join(javaSourcePath, |
There was a problem hiding this comment.
[nit] Move javaSourcePath, to the next line.
| Future<File> _androidLocalPropertiesFile; | ||
|
|
||
| Future<File> get generatedXcodePropertiesFile { | ||
| return _generatedXcodeProperties ??= manifest.then((FlutterManifest manifest) { |
There was a problem hiding this comment.
Add <File> after then
| 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.
Add <File> after then.
| } | ||
| File _flutterPluginsDotFile; | ||
|
|
||
| Future<Directory> get androidPluginRegistrantDirectory async { |
There was a problem hiding this comment.
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?
| } | ||
| Future<Directory> _androidPluginRegistrantDirectory; | ||
|
|
||
| Future<Directory> get iosPluginRegistrantDirectory async { |
| new FlutterProject(directory).directory.absolute.path, | ||
| directory.absolute.path, | ||
| ); | ||
| directory.absolute.path,); |
There was a problem hiding this comment.
Please put the ); back to whence it came.
There was a problem hiding this comment.
ok, ok... will do );
sigurdm
left a comment
There was a problem hiding this comment.
Thanks for the review!
| copyDirectorySync( | ||
| cache.getArtifactDirectory('gradle_wrapper'), | ||
| fs.directory(fs.path.join(projectDir, 'android')), | ||
| project.directory.childDirectory('android'), |
| final File file = iosProject.xcodeConfigFor(mode); | ||
| if (file.existsSync()) { | ||
| final String content = file.readAsStringSync(); | ||
| final String content = iosProject.xcodeConfigFor(mode).readAsStringSync(); |
|
|
||
| final File podfileFile = iosProject.podfile; | ||
| final File podfileLockFile = iosProject.podfileLock; | ||
| final File manifestLockFile =iosProject.podManifestLock; |
| if (!Cache.instance.fileOlderThanToolsStamp(propertiesFile)) { | ||
| Future<void> generateXcodeProperties({FlutterProject project}) async { | ||
| if ((await project.manifest).isModule || | ||
| project.directory.childDirectory('ios').existsSync()) { |
| 'main', | ||
| 'java', | ||
| ); | ||
| final String registryPath = fs.path.join(javaSourcePath, |
| Future<File> _androidLocalPropertiesFile; | ||
|
|
||
| Future<File> get generatedXcodePropertiesFile { | ||
| return _generatedXcodeProperties ??= manifest.then((FlutterManifest manifest) { |
| } | ||
| Future<File> _generatedXcodeProperties; | ||
|
|
||
| File get flutterPluginsDotFile { |
| } | ||
| File _flutterPluginsDotFile; | ||
|
|
||
| Future<Directory> get androidPluginRegistrantDirectory async { |
| } | ||
| Future<Directory> _androidPluginRegistrantDirectory; | ||
|
|
||
| Future<Directory> get iosPluginRegistrantDirectory async { |
| new FlutterProject(directory).directory.absolute.path, | ||
| directory.absolute.path, | ||
| ); | ||
| directory.absolute.path,); |
There was a problem hiding this comment.
ok, ok... will do );
|
@szakarias Could you take a look. Especially the latest commit? |
# Conflicts: # packages/flutter_tools/lib/src/plugins.dart
| class AndroidApk extends ApplicationPackage { | ||
| /// Path to the actual apk file. | ||
| final String apkPath; | ||
| final File apk; |
| 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'; | ||
|
|
| // 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.
set manifest outside the if and place it together with the exists check.
| return null; | ||
|
|
||
| final String manifestString = fs.file(manifestPath).readAsStringSync(); | ||
| final String manifestString = fs.file(manifest).readAsStringSync(); |
| /// 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.
Keep applicationBinary as name?
|
|
||
| Future<ApplicationPackage> getApplicationPackageForPlatform(TargetPlatform platform, { | ||
| String applicationBinary | ||
| File apk |
| package = await getApplicationPackageForPlatform( | ||
| targetPlatform, | ||
| applicationBinary: hotRunner.applicationBinary | ||
| apk: hotRunner.applicationBinary |
# 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.