Commit 239a717d authored by Todd Volkert's avatar Todd Volkert

Revert "Pass the local engine config through Xcode (#4190)"

This reverts commit 8f69cccc.
parent bc35d09b
......@@ -10,8 +10,6 @@ import '../globals.dart';
typedef String StringConverter(String string);
final Map<String, String> childEnvironmentOverrides = new Map<String, String>();
/// This runs the command in the background from the specified working
/// directory. Completes when the process has been started.
Future<Process> runCommand(List<String> cmd, { String workingDirectory }) async {
......@@ -21,8 +19,7 @@ Future<Process> runCommand(List<String> cmd, { String workingDirectory }) async
Process process = await Process.start(
executable,
arguments,
workingDirectory: workingDirectory,
environment: childEnvironmentOverrides
workingDirectory: workingDirectory
);
return process;
}
......@@ -112,11 +109,8 @@ String _runWithLoggingSync(List<String> cmd, {
if (truncateCommand && cmdText.length > 160)
cmdText = cmdText.substring(0, 160) + '…';
printTrace(cmdText);
ProcessResult results = Process.runSync(
cmd[0], cmd.getRange(1, cmd.length).toList(),
workingDirectory: workingDirectory,
environment: childEnvironmentOverrides
);
ProcessResult results =
Process.runSync(cmd[0], cmd.getRange(1, cmd.length).toList(), workingDirectory: workingDirectory);
printTrace('Exit code ${results.exitCode} from: ${cmd.join(' ')}');
......
......@@ -151,8 +151,7 @@ Future<bool> buildIOSXcodeProject(ApplicationPackage app, BuildMode mode,
printTrace(commands.join(' '));
ProcessResult result = Process.runSync(
commands.first, commands.sublist(1), workingDirectory: app.rootPath,
environment: childEnvironmentOverrides
commands.first, commands.sublist(1), workingDirectory: app.rootPath
);
if (result.exitCode != 0) {
......
......@@ -21,7 +21,6 @@ import '../version.dart';
const String kFlutterRootEnvironmentVariableName = 'FLUTTER_ROOT'; // should point to //flutter/ (root of flutter/flutter repo)
const String kFlutterEngineEnvironmentVariableName = 'FLUTTER_ENGINE'; // should point to //engine/src/ (root of flutter/engine repo)
const String kFlutterBuildConfigEnvironmentVariableName = 'FLUTTER_BUILD_CONFIG'; // the directory in the out directory to use for local builds
const String kSnapshotFileName = 'flutter_tools.snapshot'; // in //flutter/bin/cache/
const String kFlutterToolsScriptFileName = 'flutter_tools.dart'; // in //flutter/packages/flutter_tools/bin/
const String kFlutterEnginePackageName = 'sky_engine';
......@@ -77,7 +76,6 @@ class FlutterCommandRunner extends CommandRunner {
hide: !verboseHelp,
help:
'Name of a build output within the engine out directory, if you are building Flutter locally.\n'
'Defaults to \$$kFlutterBuildConfigEnvironmentVariableName if set.\n'
'Use this to select a specific version of the engine if you have built multiple engine targets.\n'
'This path is relative to --local-engine-src-path/out.');
}
......@@ -156,11 +154,6 @@ class FlutterCommandRunner extends CommandRunner {
if (enginePath != null) {
ToolConfiguration.instance.engineSrcPath = enginePath;
ToolConfiguration.instance.engineBuildPath = _findEngineBuildPath(globalResults, enginePath);
// Forwards configuration information to recursive runs of the tool.
if (globalResults['local-engine-src-path'] != null)
childEnvironmentOverrides[kFlutterEngineEnvironmentVariableName] = globalResults['local-engine-src-path'];
if (globalResults['local-engine'] != null)
childEnvironmentOverrides[kFlutterBuildConfigEnvironmentVariableName] = globalResults['local-engine'];
}
// The Android SDK could already have been set by tests.
......@@ -187,12 +180,10 @@ class FlutterCommandRunner extends CommandRunner {
return null;
}
String _getLocalBuildConfig(ArgResults globalResults) => globalResults['local-engine'] ?? Platform.environment[kFlutterBuildConfigEnvironmentVariableName];
String _findEnginePath(ArgResults globalResults) {
String engineSourcePath = globalResults['local-engine-src-path'] ?? Platform.environment[kFlutterEngineEnvironmentVariableName];
if (engineSourcePath == null && _getLocalBuildConfig(globalResults) != null) {
if (engineSourcePath == null && globalResults['local-engine'] != null) {
try {
Uri engineUri = PackageMap.instance.map[kFlutterEnginePackageName];
engineSourcePath = path.dirname(path.dirname(path.dirname(path.dirname(engineUri.path))));
......@@ -224,13 +215,15 @@ class FlutterCommandRunner extends CommandRunner {
}
String _findEngineBuildPath(ArgResults globalResults, String enginePath) {
String buildConfig = _getLocalBuildConfig(globalResults);
if (buildConfig == null) {
String localEngine;
if (globalResults['local-engine'] != null) {
localEngine = globalResults['local-engine'];
} else {
printError('You must specify --local-engine if you are using a locally built engine.');
throw new ProcessExit(2);
}
String engineBuildPath = path.normalize(path.join(enginePath, 'out', buildConfig));
String engineBuildPath = path.normalize(path.join(enginePath, 'out', localEngine));
if (!FileSystemEntity.isDirectorySync(engineBuildPath)) {
printError('No Flutter engine build found at $engineBuildPath.');
throw new ProcessExit(2);
......
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