Commit c26fcfdf authored by Adam Barth's avatar Adam Barth

Update xcodebuild for Generated.xcconfig (#4268)

This patch updates how we generate xcconfig files to match what
xcode_backend.sh expects.
parent ad4148bf
8a4dba983fad1f2523c8fddb6bd89b7ca79d58de a943c732d5057b2314166c37d0d8eaed0f861986
...@@ -108,7 +108,7 @@ Future<XcodeBuildResult> buildXcodeProject(ApplicationPackage app, BuildMode mod ...@@ -108,7 +108,7 @@ Future<XcodeBuildResult> buildXcodeProject(ApplicationPackage app, BuildMode mod
return new XcodeBuildResult(false); return new XcodeBuildResult(false);
} }
} else { } else {
updateXcodeLocalProperties(flutterProjectPath); updateXcodeGeneratedProperties(flutterProjectPath, mode);
} }
if (!_validateEngineRevision(app)) if (!_validateEngineRevision(app))
......
...@@ -11,7 +11,6 @@ import '../base/process.dart'; ...@@ -11,7 +11,6 @@ import '../base/process.dart';
import '../build_info.dart'; import '../build_info.dart';
import '../cache.dart'; import '../cache.dart';
import '../globals.dart'; import '../globals.dart';
import '../runner/flutter_command_runner.dart';
bool _inflateXcodeArchive(String directory, List<int> archiveBytes) { bool _inflateXcodeArchive(String directory, List<int> archiveBytes) {
printStatus('Unzipping Xcode project to local directory...'); printStatus('Unzipping Xcode project to local directory...');
...@@ -55,25 +54,25 @@ bool _inflateXcodeArchive(String directory, List<int> archiveBytes) { ...@@ -55,25 +54,25 @@ bool _inflateXcodeArchive(String directory, List<int> archiveBytes) {
return true; return true;
} }
void updateXcodeLocalProperties(String projectPath) { void updateXcodeGeneratedProperties(String projectPath, BuildMode mode) {
StringBuffer localsBuffer = new StringBuffer(); StringBuffer localsBuffer = new StringBuffer();
localsBuffer.writeln('// This is a generated file; do not edit or check into version control.'); localsBuffer.writeln('// This is a generated file; do not edit or check into version control.');
String flutterRoot = path.normalize(Platform.environment[kFlutterRootEnvironmentVariableName]); String flutterRoot = path.normalize(Cache.flutterRoot);
localsBuffer.writeln('FLUTTER_ROOT=$flutterRoot'); localsBuffer.writeln('FLUTTER_ROOT=$flutterRoot');
// This holds because requiresProjectRoot is true for this command // This holds because requiresProjectRoot is true for this command
String applicationRoot = path.normalize(Directory.current.path); String applicationRoot = path.normalize(Directory.current.path);
localsBuffer.writeln('FLUTTER_APPLICATION_PATH=$applicationRoot'); localsBuffer.writeln('FLUTTER_APPLICATION_PATH=$applicationRoot');
String dartSDKPath = path.normalize(path.join(Platform.resolvedExecutable, '..', '..')); String flutterFrameworkDir = path.normalize(tools.getEngineArtifactsDirectory(TargetPlatform.ios, mode).path);
localsBuffer.writeln('DART_SDK_PATH=$dartSDKPath'); localsBuffer.writeln('FLUTTER_FRAMEWORK_DIR=$flutterFrameworkDir');
if (tools.isLocalEngine) if (tools.isLocalEngine)
localsBuffer.writeln('LOCAL_ENGINE=${tools.engineBuildPath}'); localsBuffer.writeln('LOCAL_ENGINE=${tools.engineBuildPath}');
File localsFile = new File(path.join(projectPath, 'ios', '.generated', 'Local.xcconfig')); File localsFile = new File(path.join(projectPath, 'ios', '.generated', 'Flutter', 'Generated.xcconfig'));
localsFile.createSync(recursive: true); localsFile.createSync(recursive: true);
localsFile.writeAsStringSync(localsBuffer.toString()); localsFile.writeAsStringSync(localsBuffer.toString());
} }
...@@ -119,8 +118,8 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode) ...@@ -119,8 +118,8 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode)
return 1; return 1;
} }
// Step 3: Populate the Local.xcconfig with project specific paths // Step 3: Populate the Generated.xcconfig with project specific paths
updateXcodeLocalProperties(flutterProjectPath); updateXcodeGeneratedProperties(flutterProjectPath, mode);
// Step 4: Write the REVISION file // Step 4: Write the REVISION file
File revisionFile = new File(path.join(xcodeprojPath, 'REVISION')); File revisionFile = new File(path.join(xcodeprojPath, 'REVISION'));
......
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