Commit 1c0f8254 authored by dacaiguoguo's avatar dacaiguoguo Committed by Dan Field

Set custom flutter_assets by add FLTAssetsPath to AppFrameworkInfo.plist (#29499)

* Get FLTAssetsPath from AppFrameworkInfo.plist
parent 8220f8f4
......@@ -46,6 +46,19 @@ BuildApp() {
target_path="${FLUTTER_TARGET}"
fi
local derived_dir="${SOURCE_ROOT}/Flutter"
if [[ -e "${project_path}/.ios" ]]; then
derived_dir="${project_path}/.ios/Flutter"
fi
# Default value of assets_path is flutter_assets
local assets_path="flutter_assets"
# The value of assets_path can set by add FLTAssetsPath to AppFrameworkInfo.plist
FLTAssetsPath=$(/usr/libexec/PlistBuddy -c "Print :FLTAssetsPath" "${derived_dir}/AppFrameworkInfo.plist" 2>/dev/null)
if [[ -n "$FLTAssetsPath" ]]; then
assets_path="${FLTAssetsPath}"
fi
# Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name
# This means that if someone wants to use an Xcode build config other than Debug/Profile/Release,
# they _must_ set FLUTTER_BUILD_MODE so we know what type of artifact to build.
......@@ -87,10 +100,6 @@ BuildApp() {
AssertExists "${framework_path}"
AssertExists "${project_path}"
local derived_dir="${SOURCE_ROOT}/Flutter"
if [[ -e "${project_path}/.ios" ]]; then
derived_dir="${project_path}/.ios/Flutter"
fi
RunCommand mkdir -p -- "$derived_dir"
AssertExists "$derived_dir"
......@@ -248,7 +257,7 @@ BuildApp() {
--target="${target_path}" \
--${build_mode} \
--depfile="${build_dir}/snapshot_blob.bin.d" \
--asset-dir="${derived_dir}/App.framework/flutter_assets" \
--asset-dir="${derived_dir}/App.framework/${assets_path}" \
${precompilation_flag} \
${flutter_engine_flag} \
${local_engine_flag} \
......
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