Commit f410ca80 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Include target in revision string, since it affects the xcode config (#4795)

parent 14c53211
...@@ -106,7 +106,7 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -106,7 +106,7 @@ Future<XcodeBuildResult> buildXcodeProject({
}) async { }) async {
String flutterProjectPath = Directory.current.path; String flutterProjectPath = Directory.current.path;
if (xcodeProjectRequiresUpdate(mode)) { if (xcodeProjectRequiresUpdate(mode, target)) {
printTrace('Initializing the Xcode project.'); printTrace('Initializing the Xcode project.');
if ((await setupXcodeProjectHarness(flutterProjectPath, mode, target)) != 0) { if ((await setupXcodeProjectHarness(flutterProjectPath, mode, target)) != 0) {
printError('Could not initialize the Xcode project.'); printError('Could not initialize the Xcode project.');
......
...@@ -42,7 +42,7 @@ void updateXcodeGeneratedProperties(String projectPath, BuildMode mode, String t ...@@ -42,7 +42,7 @@ void updateXcodeGeneratedProperties(String projectPath, BuildMode mode, String t
localsFile.writeAsStringSync(localsBuffer.toString()); localsFile.writeAsStringSync(localsBuffer.toString());
} }
bool xcodeProjectRequiresUpdate(BuildMode mode) { bool xcodeProjectRequiresUpdate(BuildMode mode, String target) {
File revisionFile = new File(path.join(Directory.current.path, 'ios', '.generated', 'REVISION')); File revisionFile = new File(path.join(Directory.current.path, 'ios', '.generated', 'REVISION'));
// If the revision stamp does not exist, the Xcode project definitely requires // If the revision stamp does not exist, the Xcode project definitely requires
...@@ -52,7 +52,7 @@ bool xcodeProjectRequiresUpdate(BuildMode mode) { ...@@ -52,7 +52,7 @@ bool xcodeProjectRequiresUpdate(BuildMode mode) {
return true; return true;
} }
if (revisionFile.readAsStringSync() != _getCurrentXcodeRevisionString(mode)) { if (revisionFile.readAsStringSync() != _getCurrentXcodeRevisionString(mode, target)) {
printTrace("The revision stamp and the Flutter engine revision differ or the build mode has changed."); printTrace("The revision stamp and the Flutter engine revision differ or the build mode has changed.");
printTrace("Project needs to be updated."); printTrace("Project needs to be updated.");
return true; return true;
...@@ -75,7 +75,7 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode, ...@@ -75,7 +75,7 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode,
// Step 3: Write the REVISION file // Step 3: Write the REVISION file
File revisionFile = new File(path.join(xcodeProjectPath, 'REVISION')); File revisionFile = new File(path.join(xcodeProjectPath, 'REVISION'));
revisionFile.createSync(); revisionFile.createSync();
revisionFile.writeAsStringSync(_getCurrentXcodeRevisionString(mode)); revisionFile.writeAsStringSync(_getCurrentXcodeRevisionString(mode, target));
// Step 4: Tell the user the location of the generated project. // Step 4: Tell the user the location of the generated project.
printStatus('Xcode project created in $iosFilesPath/.'); printStatus('Xcode project created in $iosFilesPath/.');
...@@ -83,7 +83,8 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode, ...@@ -83,7 +83,8 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode,
return 0; return 0;
} }
String _getCurrentXcodeRevisionString(BuildMode mode) => (new StringBuffer() String _getCurrentXcodeRevisionString(BuildMode mode, String target) => (new StringBuffer()
..write('${FlutterVersion.getVersion().frameworkRevision}') ..write('${FlutterVersion.getVersion().frameworkRevision}')
..write('-${tools.isLocalEngine ? tools.engineBuildPath : getModeName(mode)}') ..write('-${tools.isLocalEngine ? tools.engineBuildPath : getModeName(mode)}')
..write('::$target')
).toString(); ).toString();
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