Commit 8756a094 authored by Chinmay Garde's avatar Chinmay Garde

Add a FLUTTER_MODE variable to the generated Xcconfig and fix snapshot...

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.
parent 26076d9e
...@@ -57,17 +57,23 @@ BuildApp() { ...@@ -57,17 +57,23 @@ BuildApp() {
local_engine_flag="--local-engine=$LOCAL_ENGINE" local_engine_flag="--local-engine=$LOCAL_ENGINE"
fi fi
local flutter_mode="release"
if [[ -n "$FLUTTER_MODE" ]]; then
flutter_mode=${FLUTTER_MODE}
fi
if [[ $CURRENT_ARCH != "x86_64" ]]; then if [[ $CURRENT_ARCH != "x86_64" ]]; then
local interpreter_flag="--interpreter" local aot_flags=""
if [[ "$DART_EXPERIMENTAL_INTERPRETER" != "1" ]]; then if [[ "$flutter_mode" == "debug" ]]; then
interpreter_flag="" aot_flags="--interpreter --debug"
else
aot_flags="--${flutter_mode}"
fi fi
RunCommand ${FLUTTER_ROOT}/bin/flutter --suppress-analytics build aot \ RunCommand ${FLUTTER_ROOT}/bin/flutter --suppress-analytics build aot \
--target-platform=ios \ --target-platform=ios \
--target=${target_path} \ --target=${target_path} \
--release \ ${aot_flags} \
${interpreter_flag} \
${local_engine_flag} ${local_engine_flag}
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
...@@ -81,7 +87,7 @@ BuildApp() { ...@@ -81,7 +87,7 @@ BuildApp() {
fi fi
local precompilation_flag="" 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" precompilation_flag="--precompiled"
fi fi
......
...@@ -107,7 +107,7 @@ Future<String> _buildAotSnapshot( ...@@ -107,7 +107,7 @@ Future<String> _buildAotSnapshot(
String outputPath: _kDefaultAotOutputDir, String outputPath: _kDefaultAotOutputDir,
bool interpreter: false bool interpreter: false
}) async { }) async {
if (!isAotBuildMode(buildMode)) { if (!isAotBuildMode(buildMode) && !interpreter) {
printError('${toTitleCase(getModeName(buildMode))} mode does not support AOT compilation.'); printError('${toTitleCase(getModeName(buildMode))} mode does not support AOT compilation.');
return null; return null;
} }
......
...@@ -69,6 +69,9 @@ void updateXcodeGeneratedProperties(String projectPath, BuildMode mode, String t ...@@ -69,6 +69,9 @@ void updateXcodeGeneratedProperties(String projectPath, BuildMode mode, String t
// Relative to FLUTTER_APPLICATION_PATH, which is [Directory.current]. // Relative to FLUTTER_APPLICATION_PATH, which is [Directory.current].
localsBuffer.writeln('FLUTTER_TARGET=$target'); 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); String flutterFrameworkDir = path.normalize(tools.getEngineArtifactsDirectory(TargetPlatform.ios, mode).path);
localsBuffer.writeln('FLUTTER_FRAMEWORK_DIR=$flutterFrameworkDir'); localsBuffer.writeln('FLUTTER_FRAMEWORK_DIR=$flutterFrameworkDir');
......
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