mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #1943 from chinmaygarde/master
Perform an engine version check on start and update the Xcode project if necessary
This commit is contained in:
commit
ce009e4fa4
@ -560,8 +560,8 @@ String _getIOSEngineRevision(ApplicationPackage app) {
|
||||
}
|
||||
|
||||
Future<bool> _buildIOSXcodeProject(ApplicationPackage app, { bool buildForDevice }) async {
|
||||
if (!FileSystemEntity.isDirectorySync(app.localPath)) {
|
||||
printTrace('Path "${path.absolute(app.localPath)}" does not exist. Initializing the Xcode project.');
|
||||
if (xcodeProjectRequiresUpdate()) {
|
||||
printTrace('Initializing the Xcode project.');
|
||||
if ((await setupXcodeProjectHarness()) != 0) {
|
||||
printError('Could not initialize the Xcode project.');
|
||||
return false;
|
||||
|
||||
@ -111,6 +111,25 @@ void _setupXcodeProjXcconfig(String filePath) {
|
||||
localsFile.writeAsStringSync(localsBuffer.toString());
|
||||
}
|
||||
|
||||
bool xcodeProjectRequiresUpdate() {
|
||||
File revisionFile = new File(path.join(Directory.current.path, 'ios', '.generated', 'REVISION'));
|
||||
|
||||
// If the revision stamp does not exist, the Xcode project definitely requires
|
||||
// an update
|
||||
if (!revisionFile.existsSync()) {
|
||||
printTrace("A revision stamp does not exist. The Xcode project has never been initialized.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (revisionFile.readAsStringSync() != ArtifactStore.engineRevision) {
|
||||
printTrace("The revision stamp and the Flutter engine revision differ. Project needs to be updated.");
|
||||
return true;
|
||||
}
|
||||
|
||||
printTrace("Xcode project is up to date.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<int> setupXcodeProjectHarness() async {
|
||||
// Step 1: Fetch the archive from the cloud
|
||||
String iosFilesPath = path.join(Directory.current.path, 'ios');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user