@@ -38,32 +38,6 @@ AssertExists() {
3838 return 0
3939}
4040
41- ParseFlutterBuildMode () {
42- # Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name
43- # This means that if someone wants to use an Xcode build config other than Debug/Profile/Release,
44- # they _must_ set FLUTTER_BUILD_MODE so we know what type of artifact to build.
45- local build_mode=" $( echo " ${FLUTTER_BUILD_MODE:- ${CONFIGURATION} } " | tr " [:upper:]" " [:lower:]" ) "
46-
47- case " $build_mode " in
48- * release* ) build_mode=" release" ;;
49- * profile* ) build_mode=" profile" ;;
50- * debug* ) build_mode=" debug" ;;
51- * )
52- EchoError " ========================================================================"
53- EchoError " ERROR: Unknown FLUTTER_BUILD_MODE: ${build_mode} ."
54- EchoError " Valid values are 'Debug', 'Profile', or 'Release' (case insensitive)."
55- EchoError " This is controlled by the FLUTTER_BUILD_MODE environment variable."
56- EchoError " If that is not set, the CONFIGURATION environment variable is used."
57- EchoError " "
58- EchoError " You can fix this by either adding an appropriately named build"
59- EchoError " configuration, or adding an appropriate value for FLUTTER_BUILD_MODE to the"
60- EchoError " .xcconfig file for the current build configuration (${CONFIGURATION} )."
61- EchoError " ========================================================================"
62- exit -1;;
63- esac
64- echo " ${build_mode} "
65- }
66-
6741BuildApp () {
6842 local project_path=" ${SOURCE_ROOT} /.."
6943 if [[ -n " $FLUTTER_APPLICATION_PATH " ]]; then
@@ -98,12 +72,24 @@ BuildApp() {
9872 # Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name
9973 # This means that if someone wants to use an Xcode build config other than Debug/Profile/Release,
10074 # they _must_ set FLUTTER_BUILD_MODE so we know what type of artifact to build.
101- local build_mode=" $( ParseFlutterBuildMode ) "
75+ local build_mode=" $( echo " ${FLUTTER_BUILD_MODE :- ${CONFIGURATION} } " | tr " [:upper:] " " [:lower:] " ) "
10276 local artifact_variant=" unknown"
10377 case " $build_mode " in
104- release ) artifact_variant=" ios-release" ;;
105- profile ) artifact_variant=" ios-profile" ;;
106- debug ) artifact_variant=" ios" ;;
78+ * release* ) build_mode=" release" ; artifact_variant=" ios-release" ;;
79+ * profile* ) build_mode=" profile" ; artifact_variant=" ios-profile" ;;
80+ * debug* ) build_mode=" debug" ; artifact_variant=" ios" ;;
81+ * )
82+ EchoError " ========================================================================"
83+ EchoError " ERROR: Unknown FLUTTER_BUILD_MODE: ${build_mode} ."
84+ EchoError " Valid values are 'Debug', 'Profile', or 'Release' (case insensitive)."
85+ EchoError " This is controlled by the FLUTTER_BUILD_MODE environment variable."
86+ EchoError " If that is not set, the CONFIGURATION environment variable is used."
87+ EchoError " "
88+ EchoError " You can fix this by either adding an appropriately named build"
89+ EchoError " configuration, or adding an appropriate value for FLUTTER_BUILD_MODE to the"
90+ EchoError " .xcconfig file for the current build configuration (${CONFIGURATION} )."
91+ EchoError " ========================================================================"
92+ exit -1;;
10793 esac
10894
10995 # Warn the user if not archiving (ACTION=install) in release mode.
@@ -141,7 +127,7 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr
141127 fi
142128
143129 local bitcode_flag=" "
144- if [[ " $ENABLE_BITCODE " == " YES" ]]; then
130+ if [[ $ENABLE_BITCODE == " YES" ]]; then
145131 bitcode_flag=" true"
146132 fi
147133
@@ -320,32 +306,6 @@ EmbedFlutterFrameworks() {
320306 RunCommand codesign --force --verbose --sign " ${EXPANDED_CODE_SIGN_IDENTITY} " -- " ${xcode_frameworks_dir} /App.framework/App"
321307 RunCommand codesign --force --verbose --sign " ${EXPANDED_CODE_SIGN_IDENTITY} " -- " ${xcode_frameworks_dir} /Flutter.framework/Flutter"
322308 fi
323-
324- AddObservatoryBonjourService
325- }
326-
327- # Add the observatory publisher Bonjour service to the produced app bundle Info.plist.
328- AddObservatoryBonjourService () {
329- local build_mode=" $( ParseFlutterBuildMode) "
330- # Debug and profile only.
331- if [[ " ${build_mode} " == " release" ]]; then
332- return
333- fi
334- local built_products_plist=" ${BUILT_PRODUCTS_DIR} /${INFOPLIST_PATH} "
335-
336- # If there are already NSBonjourServices specified by the app (uncommon), insert the observatory service name to the existing list.
337- if plutil -extract NSBonjourServices xml1 -o - " ${built_products_plist} " ; then
338- RunCommand plutil -insert NSBonjourServices.0 -string " _dartobservatory._tcp" " ${built_products_plist} "
339- else
340- # Otherwise, add the NSBonjourServices key and observatory service name.
341- RunCommand plutil -insert NSBonjourServices -json " [\" _dartobservatory._tcp\" ]" " ${built_products_plist} "
342- fi
343-
344- # Don't override the local network description the Flutter app developer specified (uncommon).
345- # This text will appear below the "Your app would like to find and connect to devices on your local network" permissions popup.
346- if ! plutil -extract NSLocalNetworkUsageDescription xml1 -o - " ${built_products_plist} " ; then
347- RunCommand plutil -insert NSLocalNetworkUsageDescription -string " Allow Flutter tools on your computer to connect and debug your application. This prompt will not appear on release builds." " ${built_products_plist} "
348- fi
349309}
350310
351311EmbedAndThinFrameworks () {
368328 EmbedFlutterFrameworks ;;
369329 " embed_and_thin" )
370330 EmbedAndThinFrameworks ;;
371- " test_observatory_bonjour_service" )
372- # Exposed for integration testing only.
373- AddObservatoryBonjourService ;;
374331 esac
375332fi
0 commit comments