mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Update xcodebuild for Generated.xcconfig (#4268)
This patch updates how we generate xcconfig files to match what xcode_backend.sh expects.
This commit is contained in:
parent
ad4148bf32
commit
c26fcfdfaa
2
bin/cache/engine.version
vendored
2
bin/cache/engine.version
vendored
@ -1 +1 @@
|
||||
8a4dba983fad1f2523c8fddb6bd89b7ca79d58de
|
||||
a943c732d5057b2314166c37d0d8eaed0f861986
|
||||
|
@ -108,7 +108,7 @@ Future<XcodeBuildResult> buildXcodeProject(ApplicationPackage app, BuildMode mod
|
||||
return new XcodeBuildResult(false);
|
||||
}
|
||||
} else {
|
||||
updateXcodeLocalProperties(flutterProjectPath);
|
||||
updateXcodeGeneratedProperties(flutterProjectPath, mode);
|
||||
}
|
||||
|
||||
if (!_validateEngineRevision(app))
|
||||
|
@ -11,7 +11,6 @@ import '../base/process.dart';
|
||||
import '../build_info.dart';
|
||||
import '../cache.dart';
|
||||
import '../globals.dart';
|
||||
import '../runner/flutter_command_runner.dart';
|
||||
|
||||
bool _inflateXcodeArchive(String directory, List<int> archiveBytes) {
|
||||
printStatus('Unzipping Xcode project to local directory...');
|
||||
@ -55,25 +54,25 @@ bool _inflateXcodeArchive(String directory, List<int> archiveBytes) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void updateXcodeLocalProperties(String projectPath) {
|
||||
void updateXcodeGeneratedProperties(String projectPath, BuildMode mode) {
|
||||
StringBuffer localsBuffer = new StringBuffer();
|
||||
|
||||
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');
|
||||
|
||||
// This holds because requiresProjectRoot is true for this command
|
||||
String applicationRoot = path.normalize(Directory.current.path);
|
||||
localsBuffer.writeln('FLUTTER_APPLICATION_PATH=$applicationRoot');
|
||||
|
||||
String dartSDKPath = path.normalize(path.join(Platform.resolvedExecutable, '..', '..'));
|
||||
localsBuffer.writeln('DART_SDK_PATH=$dartSDKPath');
|
||||
String flutterFrameworkDir = path.normalize(tools.getEngineArtifactsDirectory(TargetPlatform.ios, mode).path);
|
||||
localsBuffer.writeln('FLUTTER_FRAMEWORK_DIR=$flutterFrameworkDir');
|
||||
|
||||
if (tools.isLocalEngine)
|
||||
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.writeAsStringSync(localsBuffer.toString());
|
||||
}
|
||||
@ -119,8 +118,8 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Step 3: Populate the Local.xcconfig with project specific paths
|
||||
updateXcodeLocalProperties(flutterProjectPath);
|
||||
// Step 3: Populate the Generated.xcconfig with project specific paths
|
||||
updateXcodeGeneratedProperties(flutterProjectPath, mode);
|
||||
|
||||
// Step 4: Write the REVISION file
|
||||
File revisionFile = new File(path.join(xcodeprojPath, 'REVISION'));
|
||||
|
Loading…
Reference in New Issue
Block a user