Fix xcode build settings parsing (#14672)

This commit is contained in:
Mikkel Nygaard Ravn
2018-02-13 22:19:03 +01:00
committed by GitHub
parent ea4dc12486
commit 8507b72af5

View File

@@ -12,7 +12,7 @@ import '../build_info.dart';
import '../cache.dart';
import '../globals.dart';
final RegExp _settingExpr = new RegExp(r'(\w+)\s*=\s*(\S+)');
final RegExp _settingExpr = new RegExp(r'(\w+)\s*=\s*(.*)$');
final RegExp _varExpr = new RegExp(r'\$\((.*)\)');
String flutterFrameworkDir(BuildMode mode) {
@@ -77,9 +77,10 @@ Map<String, String> getXcodeBuildSettings(String xcodeProjPath, String target) {
Map<String, String> parseXcodeBuildSettings(String showBuildSettingsOutput) {
final Map<String, String> settings = <String, String>{};
for (String line in showBuildSettingsOutput.split('\n').where(_settingExpr.hasMatch)) {
final Match match = _settingExpr.firstMatch(line);
settings[match[1]] = match[2];
for (Match match in showBuildSettingsOutput.split('\n').map(_settingExpr.firstMatch)) {
if (match != null) {
settings[match[1]] = match[2];
}
}
return settings;
}