Unverified Commit d099ae60 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Add ephemeral iOS directory to put future generated files (#76830)

parent f5903a91
...@@ -92,6 +92,7 @@ unlinked_spec.ds ...@@ -92,6 +92,7 @@ unlinked_spec.ds
**/ios/Flutter/Flutter.framework **/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec **/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig **/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx **/ios/Flutter/app.flx
**/ios/Flutter/app.zip **/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/ **/ios/Flutter/flutter_assets/
......
...@@ -18,6 +18,7 @@ Flutter/App.framework ...@@ -18,6 +18,7 @@ Flutter/App.framework
Flutter/Flutter.framework Flutter/Flutter.framework
Flutter/Flutter.podspec Flutter/Flutter.podspec
Flutter/Generated.xcconfig Flutter/Generated.xcconfig
Flutter/ephemeral
Flutter/app.flx Flutter/app.flx
Flutter/app.zip Flutter/app.zip
Flutter/flutter_assets/ Flutter/flutter_assets/
......
...@@ -18,6 +18,7 @@ Flutter/App.framework ...@@ -18,6 +18,7 @@ Flutter/App.framework
Flutter/Flutter.framework Flutter/Flutter.framework
Flutter/Flutter.podspec Flutter/Flutter.podspec
Flutter/Generated.xcconfig Flutter/Generated.xcconfig
Flutter/ephemeral
Flutter/app.flx Flutter/app.flx
Flutter/app.zip Flutter/app.zip
Flutter/flutter_assets/ Flutter/flutter_assets/
......
...@@ -18,6 +18,7 @@ Flutter/App.framework ...@@ -18,6 +18,7 @@ Flutter/App.framework
Flutter/Flutter.framework Flutter/Flutter.framework
Flutter/Flutter.podspec Flutter/Flutter.podspec
Flutter/Generated.xcconfig Flutter/Generated.xcconfig
Flutter/ephemeral
Flutter/app.flx Flutter/app.flx
Flutter/app.zip Flutter/app.zip
Flutter/flutter_assets/ Flutter/flutter_assets/
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
**/ios/Flutter/Flutter.framework **/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec **/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig **/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx **/ios/Flutter/app.flx
**/ios/Flutter/app.zip **/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/ **/ios/Flutter/flutter_assets/
......
...@@ -421,7 +421,7 @@ abstract class IosAssetBundle extends Target { ...@@ -421,7 +421,7 @@ abstract class IosAssetBundle extends Target {
// TODO(jonahwilliams): add plist to inputs // TODO(jonahwilliams): add plist to inputs
final FlutterProject flutterProject = FlutterProject.fromDirectory(environment.projectDir); final FlutterProject flutterProject = FlutterProject.fromDirectory(environment.projectDir);
final Directory plistRoot = flutterProject.isModule final Directory plistRoot = flutterProject.isModule
? flutterProject.ios.ephemeralDirectory ? flutterProject.ios.ephemeralModuleDirectory
: environment.projectDir.childDirectory('ios'); : environment.projectDir.childDirectory('ios');
plistRoot plistRoot
.childDirectory('Flutter') .childDirectory('Flutter')
......
...@@ -51,6 +51,7 @@ class CleanCommand extends FlutterCommand { ...@@ -51,6 +51,7 @@ class CleanCommand extends FlutterCommand {
deleteFile(flutterProject.android.ephemeralDirectory); deleteFile(flutterProject.android.ephemeralDirectory);
deleteFile(flutterProject.ios.ephemeralDirectory); deleteFile(flutterProject.ios.ephemeralDirectory);
deleteFile(flutterProject.ios.ephemeralModuleDirectory);
deleteFile(flutterProject.ios.generatedXcodePropertiesFile); deleteFile(flutterProject.ios.generatedXcodePropertiesFile);
deleteFile(flutterProject.ios.generatedEnvironmentVariableExportScript); deleteFile(flutterProject.ios.generatedEnvironmentVariableExportScript);
deleteFile(flutterProject.ios.deprecatedCompiledDartFramework); deleteFile(flutterProject.ios.deprecatedCompiledDartFramework);
......
...@@ -428,7 +428,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -428,7 +428,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
static const String _productBundleIdVariable = r'$(PRODUCT_BUNDLE_IDENTIFIER)'; static const String _productBundleIdVariable = r'$(PRODUCT_BUNDLE_IDENTIFIER)';
static const String _hostAppProjectName = 'Runner'; static const String _hostAppProjectName = 'Runner';
Directory get ephemeralDirectory => parent.directory.childDirectory('.ios'); Directory get ephemeralModuleDirectory => parent.directory.childDirectory('.ios');
Directory get _editableDirectory => parent.directory.childDirectory('ios'); Directory get _editableDirectory => parent.directory.childDirectory('ios');
/// This parent folder of `Runner.xcodeproj`. /// This parent folder of `Runner.xcodeproj`.
...@@ -436,7 +436,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -436,7 +436,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
if (!isModule || _editableDirectory.existsSync()) { if (!isModule || _editableDirectory.existsSync()) {
return _editableDirectory; return _editableDirectory;
} }
return ephemeralDirectory; return ephemeralModuleDirectory;
} }
/// The root directory of the iOS wrapping of Flutter and plugins. This is the /// The root directory of the iOS wrapping of Flutter and plugins. This is the
...@@ -445,7 +445,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -445,7 +445,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// ///
/// This is the same as [hostAppRoot] except when the project is /// This is the same as [hostAppRoot] except when the project is
/// a Flutter module with an editable host app. /// a Flutter module with an editable host app.
Directory get _flutterLibRoot => isModule ? ephemeralDirectory : _editableDirectory; Directory get _flutterLibRoot => isModule ? ephemeralModuleDirectory : _editableDirectory;
/// True, if the parent Flutter project is a module project. /// True, if the parent Flutter project is a module project.
bool get isModule => parent.isModule; bool get isModule => parent.isModule;
...@@ -453,6 +453,9 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -453,6 +453,9 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// Whether the flutter application has an iOS project. /// Whether the flutter application has an iOS project.
bool get exists => hostAppRoot.existsSync(); bool get exists => hostAppRoot.existsSync();
/// Put generated files here.
Directory get ephemeralDirectory => _flutterLibRoot.childDirectory('Flutter').childDirectory('ephemeral');
@override @override
File xcodeConfigFor(String mode) => _flutterLibRoot.childDirectory('Flutter').childFile('$mode.xcconfig'); File xcodeConfigFor(String mode) => _flutterLibRoot.childDirectory('Flutter').childFile('$mode.xcconfig');
...@@ -664,29 +667,29 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -664,29 +667,29 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
return; return;
} }
final bool pubspecChanged = globals.fsUtils.isOlderThanReference( final bool pubspecChanged = globals.fsUtils.isOlderThanReference(
entity: ephemeralDirectory, entity: ephemeralModuleDirectory,
referenceFile: parent.pubspecFile, referenceFile: parent.pubspecFile,
); );
final bool toolingChanged = globals.cache.isOlderThanToolsStamp(ephemeralDirectory); final bool toolingChanged = globals.cache.isOlderThanToolsStamp(ephemeralModuleDirectory);
if (!pubspecChanged && !toolingChanged) { if (!pubspecChanged && !toolingChanged) {
return; return;
} }
_deleteIfExistsSync(ephemeralDirectory); _deleteIfExistsSync(ephemeralModuleDirectory);
await _overwriteFromTemplate( await _overwriteFromTemplate(
globals.fs.path.join('module', 'ios', 'library'), globals.fs.path.join('module', 'ios', 'library'),
ephemeralDirectory, ephemeralModuleDirectory,
); );
// Add ephemeral host app, if a editable host app does not already exist. // Add ephemeral host app, if a editable host app does not already exist.
if (!_editableDirectory.existsSync()) { if (!_editableDirectory.existsSync()) {
await _overwriteFromTemplate( await _overwriteFromTemplate(
globals.fs.path.join('module', 'ios', 'host_app_ephemeral'), globals.fs.path.join('module', 'ios', 'host_app_ephemeral'),
ephemeralDirectory, ephemeralModuleDirectory,
); );
if (hasPlugins(parent)) { if (hasPlugins(parent)) {
await _overwriteFromTemplate( await _overwriteFromTemplate(
globals.fs.path.join('module', 'ios', 'host_app_ephemeral_cocoapods'), globals.fs.path.join('module', 'ios', 'host_app_ephemeral_cocoapods'),
ephemeralDirectory, ephemeralModuleDirectory,
); );
} }
// Use release mode so host project can link on bitcode variant. // Use release mode so host project can link on bitcode variant.
...@@ -759,7 +762,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -759,7 +762,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
Directory get engineCopyDirectory { Directory get engineCopyDirectory {
return isModule return isModule
? ephemeralDirectory.childDirectory('Flutter').childDirectory('engine') ? ephemeralModuleDirectory.childDirectory('Flutter').childDirectory('engine')
: hostAppRoot.childDirectory('Flutter'); : hostAppRoot.childDirectory('Flutter');
} }
......
...@@ -18,6 +18,7 @@ Flutter/App.framework ...@@ -18,6 +18,7 @@ Flutter/App.framework
Flutter/Flutter.framework Flutter/Flutter.framework
Flutter/Flutter.podspec Flutter/Flutter.podspec
Flutter/Generated.xcconfig Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx Flutter/app.flx
Flutter/app.zip Flutter/app.zip
Flutter/flutter_assets/ Flutter/flutter_assets/
......
...@@ -60,6 +60,7 @@ build/ ...@@ -60,6 +60,7 @@ build/
**/ios/Flutter/Flutter.framework **/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec **/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig **/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx **/ios/Flutter/app.flx
**/ios/Flutter/app.zip **/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/ **/ios/Flutter/flutter_assets/
......
...@@ -34,4 +34,5 @@ Icon? ...@@ -34,4 +34,5 @@ Icon?
.tags* .tags*
/Flutter/Generated.xcconfig /Flutter/Generated.xcconfig
/Flutter/ephemeral/
/Flutter/flutter_export_environment.sh /Flutter/flutter_export_environment.sh
\ No newline at end of file
...@@ -53,6 +53,7 @@ void main() { ...@@ -53,6 +53,7 @@ void main() {
projectUnderTest.android.ephemeralDirectory.createSync(recursive: true); projectUnderTest.android.ephemeralDirectory.createSync(recursive: true);
projectUnderTest.ios.ephemeralDirectory.createSync(recursive: true); projectUnderTest.ios.ephemeralDirectory.createSync(recursive: true);
projectUnderTest.ios.ephemeralModuleDirectory.createSync(recursive: true);
projectUnderTest.ios.generatedXcodePropertiesFile.createSync(recursive: true); projectUnderTest.ios.generatedXcodePropertiesFile.createSync(recursive: true);
projectUnderTest.ios.generatedEnvironmentVariableExportScript.createSync(recursive: true); projectUnderTest.ios.generatedEnvironmentVariableExportScript.createSync(recursive: true);
projectUnderTest.ios.deprecatedCompiledDartFramework.createSync(recursive: true); projectUnderTest.ios.deprecatedCompiledDartFramework.createSync(recursive: true);
...@@ -77,6 +78,7 @@ void main() { ...@@ -77,6 +78,7 @@ void main() {
expect(projectUnderTest.android.ephemeralDirectory.existsSync(), isFalse); expect(projectUnderTest.android.ephemeralDirectory.existsSync(), isFalse);
expect(projectUnderTest.ios.ephemeralDirectory.existsSync(), isFalse); expect(projectUnderTest.ios.ephemeralDirectory.existsSync(), isFalse);
expect(projectUnderTest.ios.ephemeralModuleDirectory.existsSync(), isFalse);
expect(projectUnderTest.ios.generatedXcodePropertiesFile.existsSync(), isFalse); expect(projectUnderTest.ios.generatedXcodePropertiesFile.existsSync(), isFalse);
expect(projectUnderTest.ios.generatedEnvironmentVariableExportScript.existsSync(), isFalse); expect(projectUnderTest.ios.generatedEnvironmentVariableExportScript.existsSync(), isFalse);
expect(projectUnderTest.ios.deprecatedCompiledDartFramework.existsSync(), isFalse); expect(projectUnderTest.ios.deprecatedCompiledDartFramework.existsSync(), isFalse);
......
...@@ -18,6 +18,7 @@ Flutter/App.framework ...@@ -18,6 +18,7 @@ Flutter/App.framework
Flutter/Flutter.framework Flutter/Flutter.framework
Flutter/Flutter.podspec Flutter/Flutter.podspec
Flutter/Generated.xcconfig Flutter/Generated.xcconfig
Flutter/ephemeral
Flutter/app.flx Flutter/app.flx
Flutter/app.zip Flutter/app.zip
Flutter/flutter_assets/ Flutter/flutter_assets/
......
...@@ -34,4 +34,5 @@ Icon? ...@@ -34,4 +34,5 @@ Icon?
.tags* .tags*
/Flutter/Generated.xcconfig /Flutter/Generated.xcconfig
/Flutter/ephemeral
/Flutter/flutter_export_environment.sh /Flutter/flutter_export_environment.sh
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment