yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
7.08k stars 820 forks source link

Enable Swift 6 support #1504

Closed vicajilau closed 1 month ago

vicajilau commented 2 months ago

Using the new version of Xcode 16 that supports Swift 6. When I try to set the Swift version to the latest version using SWIFT_VERSION = 6 in the project.yml file, it does not produce the expected output. However, I can go to Xcode 16 and set it manually.

CraigSiemens commented 2 months ago

Would you be able to share your project.yml?

The following is setting the swift version in the generated project correctly.

name: MyProject
settings:
  GENERATE_INFOPLIST_FILE: true
  SWIFT_VERSION: 6
targets:
  placeholder:
    platform: iOS
    type: application
vicajilau commented 2 months ago

Of course. I just modified a bits of private info but there it is:

name: MY_APP
options:
  deploymentTarget:
    iOS: "15.0"
  hideSchemes: true
configs:
  Debug: debug
  Debug_UAT: debug
  Debug_PREPROD: debug
  Debug_PROD: debug
  AdHoc_UAT: release
  AdHoc_PREPROD: release
  AdHoc_PROD: release
  Release: release
settings:
  DEVELOPMENT_TEAM: MY_DEVELOPMENT_TEAM
  CODE_SIGN_STYLE: Automatic
  CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED: YES
  ENABLE_USER_SCRIPT_SANDBOXING: NO
  ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS: YES
packages:
  TrustKit:
    url: https://github.com/datatheorem/TrustKit.git
    from: 3.0.4
  ScanbotSDK:
    url: https://github.com/doo/scanbot-sdk-ios-spm
    from: 5.1.0
  EasyPeasy:
    url: https://github.com/nakiostudio/EasyPeasy
    from: 1.10.0
  Alamofire:
    url: https://github.com/Alamofire/Alamofire
    from: 5.9.1
  AlamofireImage:
    url: https://github.com/Alamofire/AlamofireImage.git
    from: 4.3.0
  XCGLogger:
    url: https://github.com/DaveWoodCom/XCGLogger.git
    from: 7.1.5
  CryptoSwift:
    url: https://github.com/krzyzanowskim/CryptoSwift
    from: 1.8.2
  Starscream:
    url: https://github.com/daltoniam/Starscream.git
    from: 4.0.8
  SDWebImage:
    url: https://github.com/SDWebImage/SDWebImage
    from: 5.19.2
  libPhoneNumber:
    url: https://github.com/iziz/libPhoneNumber-iOS.git
    from: 1.1.0
  AdaptiveCards:
    url: https://github.com/hggz/AdaptiveCards-Mobile.git
    branch: hggz/swift_pm_fix
    revision: 32af76185fa1e9885cb861d267321428a01622ac
  Firebase:
    url: https://github.com/firebase/firebase-ios-sdk.git
    from: 11.0.0
  Apollo:
    url: https://github.com/apollographql/apollo-ios.git
    from: 0.53.0
  OHHTTPStubs:
    url: https://github.com/AliSoftware/OHHTTPStubs.git
    from: 9.1.0
targets:
  MY_APP:
    type: application
    platform: iOS
    sources:
      - path: MY_APP
        excludes:
          - "ApolloClient/scripts/apollo/**/*" # excludes all files
          - "MyAppUI/**/*.md" # excludes all files with the .md extension
          - "MyAppUI/**/*.TXT" # excludes all files with the .txt extension
    settings:
      OTHER_SWIFT_FLAGS:
        - $(inherited)
        - -D
      INFOPLIST_FILE: "MY_APP/Resources/Info.plist"
      SWIFT_VERSION: "6"
      FRAMEWORK_SEARCH_PATHS: [$(inherited), $(PROJECT_DIR)]
      configs:
        Debug:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: DEVELOPMENT
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_uat.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: DEV
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        Debug_UAT:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconUAT
          MYAPP_BUILD_TYPE: UAT
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_uat.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: UAT
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.uat
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        Debug_PREPROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconPREPROD
          MYAPP_BUILD_TYPE: PREPROD
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_preprod.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: PREPROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.preprod
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        Debug_PROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_prod
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_prod.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: PROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        AdHoc_UAT:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconUAT
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_uat.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: UAT
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-dev.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.uat
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0-UAT"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
        AdHoc_PREPROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconPREPROD
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_preprod.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: PREPROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-dev.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.preprod
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0-PREPROD"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
        AdHoc_PROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_prod
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_prod.json
          MYAPP_DEBUG_LABELS_ENABLED: NO
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: PROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-dev.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0-PROD"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
        Release:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_prod
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_prod.json
          MYAPP_DEBUG_LABELS_ENABLED: NO
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: PROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-release.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_PROD.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
    dependencies:
      - package: TrustKit
      - package: ScanbotSDK
      - package: EasyPeasy
      - package: Alamofire
      - package: AlamofireImage
      - package: XCGLogger
      - package: CryptoSwift
      - package: Starscream
      - package: SDWebImage
      - package: libPhoneNumber
      - package: AdaptiveCards
      - package: Firebase
        products: [FirebaseRemoteConfig, FirebaseCrashlytics]
      - package: Apollo
      - framework: TCCore.xcframework
      - framework: TCSDK.xcframework
    preBuildScripts:
      - script: |
          "${PROJECT_DIR}/MY_APP/MyAppUI/GraphQL/generate"
        name: Generate Apollo GraphQL API
        basedOnDependencyAnalysis: false
      - script: |
          "${PROJECT_DIR}/MY_APP/DirectLine/XIBs/move_resources"
        name: Custom Adaptive Cards
        basedOnDependencyAnalysis: false
      - script: |
          "${PROJECT_DIR}/MY_APP/Config/swiftlint-config"
        name: SwiftLint
        basedOnDependencyAnalysis: false
    postBuildScripts:
      - script: |
          "${PROJECT_DIR}/MY_APP/Config/copyconfig"
        name: Copy Config
        basedOnDependencyAnalysis: false
      - script: |
          "${PROJECT_DIR}/MY_APP/Firebase/copyfirebaseconfig"
        name: Copy GoogleServices Config
        basedOnDependencyAnalysis: false
      - script: |
          "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
        name: FirebaseCrashlytics
        inputFiles:
          - ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}
          - ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}
          - ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist
          - $(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist
          - $(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)
        basedOnDependencyAnalysis: false
  MY_APP_Tests:
    type: bundle.unit-test
    platform: iOS
    sources:
      - MY_APP_Tests
      - MY_APP
    excludes:
      - "ApolloClient/scripts/apollo/**/*" # excludes all files
      - "MyAppUI/**/*.md" # excludes all files with the .md extension
      - "MyAppUI/**/*.TXT" # excludes all files with the .txt extension
      - "MyAppUI/Classes/Utils/MyAPPUtils.swift"
    dependencies:
      - package: TrustKit
      - package: ScanbotSDK
      - package: EasyPeasy
      - package: Alamofire
      - package: AlamofireImage
      - package: XCGLogger
      - package: CryptoSwift
      - package: Starscream
      - package: SDWebImage
      - package: libPhoneNumber
      - package: AdaptiveCards
      - package: Firebase
        products: [FirebaseRemoteConfig, FirebaseCrashlytics]
      - package: OHHTTPStubs
      - package: Apollo
      - framework: TCCore.xcframework
      - framework: TCSDK.xcframework
    preBuildScripts:
      - script: |
          "${PROJECT_DIR}/MY_APP/Config/swiftlint-config"
        name: SwiftLint
        basedOnDependencyAnalysis: false
    settings:
      OTHER_SWIFT_FLAGS:
        - $(inherited)
        - -D
      SWIFT_VERSION: "6"
      PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.MyAPP-Tests
      DEVELOPMENT_TEAM: "MY_DEVELOPMENT_TEAM"
      INFOPLIST_FILE: MY_APP/Resources/Info.plist
      configs:
        Debug:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: DEVELOPMENT
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_uat.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: DEV
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        Debug_UAT:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconUAT
          MYAPP_BUILD_TYPE: UAT
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_uat.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: UAT
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.uat
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        Debug_PREPROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconPREPROD
          MYAPP_BUILD_TYPE: PREPROD
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_preprod.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: PREPROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.preprod
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        Debug_PROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_prod
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_prod.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: YES
          MYAPP_ENVIRONMENT: PROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-debug.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "DEBUG=1", "SWIFT_PACKAGE=1"]
        AdHoc_UAT:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconUAT
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_uat.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: UAT
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-dev.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.uat
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0-UAT"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
        AdHoc_PREPROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIconPREPROD
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_preprod.json
          MYAPP_DEBUG_LABELS_ENABLED: YES
          MYAPP_DEBUG_TOOLS_ENABLED: YES
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: PREPROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-dev.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example.preprod
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0-PREPROD"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
        AdHoc_PROD:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_prod
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_prod.json
          MYAPP_DEBUG_LABELS_ENABLED: NO
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: PROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-dev.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_DEV.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0-PROD"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
        Release:
          ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_prod
          ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
          MYAPP_BUILD_TYPE: PRODUCTION
          MYAPP_CONFIGURATION_FILE: MY_APP/Config/myapp_config_prod.json
          MYAPP_DEBUG_LABELS_ENABLED: NO
          MYAPP_DEBUG_TOOLS_ENABLED: NO
          MTL_ENABLE_DEBUG_INFO: NO
          MYAPP_ENVIRONMENT: PROD
          MYAPP_GOOGLESERVICES_CONFIGURATION_FILE: MY_APP/Firebase/GoogleService-Info-release.plist
          CODE_SIGN_ENTITLEMENTS: MY_APP/MY_APP_PROD.entitlements
          PRODUCT_BUNDLE_IDENTIFIER: com.myapp.example
          CURRENT_PROJECT_VERSION: 120400
          MARKETING_VERSION: "12.4.0"
          PRODUCT_NAME: MY_APP
          TARGETED_DEVICE_FAMILY: 1
          DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym"
          GCC_PREPROCESSOR_DEFINITIONS: ["$(inherited)", "SWIFT_PACKAGE=1"]
schemes:
  MY_APP_UAT:
    build:
      targets:
        MY_APP: all
    run:
      config: Debug_UAT
      environmentVariables:
        - variable: IDEPreferLogStreaming
          value: YES
    test:
      config: Debug_UAT
      testPlans:
        - path: MY_APP_Tests/MY_APP_UAT.xctestplan
          defaultPlan: true
    profile:
      config: Debug_UAT
    analyze:
      config: Debug_UAT
    archive:
      config: AdHoc_UAT
  MY_APP_PREPROD:
    build:
      targets:
        MY_APP: all
    run:
      config: Debug_PREPROD
      environmentVariables:
        - variable: IDEPreferLogStreaming
          value: YES
    test:
      config: Debug_PREPROD
    profile:
      config: Debug_PREPROD
    analyze:
      config: Debug_PREPROD
    archive:
      config: AdHoc_PREPROD
  MY_APP_PROD:
    build:
      targets:
        MY_APP: all
    run:
      config: Debug_PROD
      environmentVariables:
        - variable: IDEPreferLogStreaming
          value: YES
    test:
      config: Debug_PROD
      environmentVariables:
        - variable: TEST_LANGUAGE
          value: en
    profile:
      config: Debug_PROD
    analyze:
      config: Debug_PROD
    archive:
      config: AdHoc_PROD
  MY_APP_STORE:
    build:
      targets:
        MY_APP: all
    run:
      config: Debug_PROD
      environmentVariables:
        - variable: IDEPreferLogStreaming
          value: YES
    test:
      config: Debug_PROD
    profile:
      config: Debug_PROD
    analyze:
      config: Debug_PROD
    archive:
      config: Release
yonaskolb commented 1 month ago

Ah, I can see your issue. In your settings in the targets, you are are specifying settings for each config. This is fine, but if you do that the rest of the settings have to go into a base dictionary. It means a bunch of your settings aren't being read. You can also put common settings like this at the top in the project settings instead of in each target. More info here https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#settings

yours:

settings:
  SWIFT_VERSION: "6"
  configs:
    Debug:
      ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat

correct:

settings:
  base:
    SWIFT_VERSION: "6"
  configs:
    Debug:
      ASSETS_DEFAULT_STRINGS_FILENAME: extended_strings_uat
vicajilau commented 1 month ago

Many thanks @yonaskolb!! This fixed my issue 😊