Emit additional Xcode settings in flutter create (#8125)

On flutter run, we update ios/Flutter/Generated.xcconfig with various
Flutter-specific settings required by xcode_backend.sh during a build
from Xcode. These settings need to be present at the time the project is
loaded since Xcode doesn't pick up live updates to these files.

Without these settings, Xcode fails to locate xcode_backend.sh itself,
causing the build to fail until the Xcode project has been closed and
re-opened. This also prevents Xcode's project updater from 'helpfully'
suggesting to clean up and delete the Generated.xcconfig file.
This commit is contained in:
Chris Bracken
2017-02-14 09:56:57 -08:00
committed by GitHub
parent 8857fa080e
commit 43650e93f4
3 changed files with 15 additions and 3 deletions

View File

@@ -66,6 +66,15 @@ void main() {
expect(original, formatted, reason: file.path);
}
}
// Generated Xcode settings
String xcodeConfigPath = fs.path.join('ios', 'Flutter', 'Generated.xcconfig');
expectExists(xcodeConfigPath);
File xcodeConfigFile = fs.file(fs.path.join(temp.path, xcodeConfigPath));
String xcodeConfig = xcodeConfigFile.readAsStringSync();
expect(xcodeConfig, contains('FLUTTER_ROOT='));
expect(xcodeConfig, contains('FLUTTER_APPLICATION_PATH='));
expect(xcodeConfig, contains('FLUTTER_FRAMEWORK_DIR='));
});
// Verify that we can regenerate over an existing project.