getXcScheme static method

String getXcScheme(
  1. String appName
)

Implementation

static String getXcScheme(String appName) {
  return '''
    <PreActions>
       <ExecutionAction
          ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
          <ActionContent
             title = "Run Script"
             scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;function entry_decode() { echo &quot;\${*}&quot; | base64 --decode; }&#10;&#x200b;&#10;IFS=&apos;,&apos; read -r -a define_items &lt;&lt;&lt; &quot;\$DART_DEFINES&quot;&#10;&#x200b;&#10;result=[]&#10;resultIndex=0&#10;result[0]=&quot;APP_NAME=${appName}_DEV&quot;&#10;result[1]=&quot;APP_SUFFIX=.dev&quot;;&#10;&#x200b;&#10;for index in &quot;\${!define_items[@]}&quot;&#10;do&#10;    if [ \$(entry_decode &quot;\${define_items[\$index]}&quot;) == &quot;APP_ENV=dev&quot; ]; then&#10;        result[\$resultIndex]=&quot;APP_NAME=${appName}_DEV&quot;;&#10;        resultIndex=\$((resultIndex+1))&#10;        result[\$resultIndex]=&quot;APP_SUFFIX=.dev&quot;;&#10;    fi&#10;&#x200b;&#10;    if [ \$(entry_decode &quot;\${define_items[\$index]}&quot;) == &quot;APP_ENV=pro&quot; ]; then&#10;        result[\$resultIndex]=&quot;APP_NAME=$appName&quot;;&#10;        resultIndex=\$((resultIndex+1))&#10;        result[\$resultIndex]=&quot;APP_SUFFIX=&quot;;&#10;    fi&#10;done&#10;&#x200b;&#10;printf &quot;%s\\n&quot; &quot;\${result[@]}&quot;|grep &apos;^APP_&apos; &gt; \${SRCROOT}/Flutter/DartEnvConfig.xcconfig&#10;">
             <EnvironmentBuildable>
                <BuildableReference
                   BuildableIdentifier = "primary"
                   BlueprintIdentifier = "97C146ED1CF9000F007C117D"
                   BuildableName = "Runner.app"
                   BlueprintName = "Runner"
                   ReferencedContainer = "container:Runner.xcodeproj">
                </BuildableReference>
             </EnvironmentBuildable>
          </ActionContent>
       </ExecutionAction>
    </PreActions>''';
}