Add a FLUTTER_MODE variable to the generated Xcconfig and fix snapshot generation on all targets. (#4362)

Get rid of the DART_EXPERIMENTAL_INTERPRETER_FLAG.
This commit is contained in:
Chinmay Garde
2016-06-03 13:55:57 -07:00
parent 26076d9efd
commit 8756a094a9
3 changed files with 16 additions and 7 deletions

View File

@@ -57,17 +57,23 @@ BuildApp() {
local_engine_flag="--local-engine=$LOCAL_ENGINE"
fi
local flutter_mode="release"
if [[ -n "$FLUTTER_MODE" ]]; then
flutter_mode=${FLUTTER_MODE}
fi
if [[ $CURRENT_ARCH != "x86_64" ]]; then
local interpreter_flag="--interpreter"
if [[ "$DART_EXPERIMENTAL_INTERPRETER" != "1" ]]; then
interpreter_flag=""
local aot_flags=""
if [[ "$flutter_mode" == "debug" ]]; then
aot_flags="--interpreter --debug"
else
aot_flags="--${flutter_mode}"
fi
RunCommand ${FLUTTER_ROOT}/bin/flutter --suppress-analytics build aot \
--target-platform=ios \
--target=${target_path} \
--release \
${interpreter_flag} \
${aot_flags} \
${local_engine_flag}
if [[ $? -ne 0 ]]; then
@@ -81,7 +87,7 @@ BuildApp() {
fi
local precompilation_flag=""
if [[ $CURRENT_ARCH != "x86_64" ]] && [[ "$DART_EXPERIMENTAL_INTERPRETER" != "1" ]]; then
if [[ $CURRENT_ARCH != "x86_64" ]] && [[ "$flutter_mode" != "debug" ]]; then
precompilation_flag="--precompiled"
fi

View File

@@ -107,7 +107,7 @@ Future<String> _buildAotSnapshot(
String outputPath: _kDefaultAotOutputDir,
bool interpreter: false
}) async {
if (!isAotBuildMode(buildMode)) {
if (!isAotBuildMode(buildMode) && !interpreter) {
printError('${toTitleCase(getModeName(buildMode))} mode does not support AOT compilation.');
return null;
}

View File

@@ -69,6 +69,9 @@ void updateXcodeGeneratedProperties(String projectPath, BuildMode mode, String t
// Relative to FLUTTER_APPLICATION_PATH, which is [Directory.current].
localsBuffer.writeln('FLUTTER_TARGET=$target');
// The runtime mode for the current build.
localsBuffer.writeln('FLUTTER_MODE=${getModeName(mode)}');
String flutterFrameworkDir = path.normalize(tools.getEngineArtifactsDirectory(TargetPlatform.ios, mode).path);
localsBuffer.writeln('FLUTTER_FRAMEWORK_DIR=$flutterFrameworkDir');