How to set project format to use Xcode version?

Question

Currently the generated iOS project is using Xcode 14.0.

I am wondering how to set project format to use Xcode 16.3? Thank you! :smiley:

Context

  • Tuist version: 4.81.1

Reproduction (mandatory for problems)

Here are my files:

Tuist.swift

import ProjectDescription

let tuist = Tuist(project: .tuist())

Project.swift

import Foundation
import ProjectDescription

let swiftVersion = try! String(
  contentsOfFile: ".swift-version",
  encoding: .utf8
).trimmingCharacters(in: .whitespacesAndNewlines)

let project = Project(
  name: "mobile-ios",
  settings: .settings(
    base: [
      "SWIFT_VERSION": .string(swiftVersion)
    ]
  ),
  targets: [
    .target(
      name: "mobile-ios",
      destinations: .iOS,
      product: .app,
      bundleId: "dev.tuist.mobile-ios",
      infoPlist: .extendingDefault(
        with: [
          "UILaunchScreen": [
            "UIColorName": "",
            "UIImageName": "",
          ]
        ]
      ),
      buildableFolders: [
        "mobile-ios/Sources",
        "mobile-ios/Resources",
      ],
      dependencies: []
    ),
    .target(
      name: "mobile-iosTests",
      destinations: .iOS,
      product: .unitTests,
      bundleId: "dev.tuist.mobile-iosTests",
      infoPlist: .default,
      buildableFolders: [
        "mobile-ios/Tests"
      ],
      dependencies: [.target(name: "mobile-ios")]
    ),
  ],
  schemes: [
    .scheme(
      name: "mobile-ios",
      shared: true,
      buildAction: .buildAction(
        targets: [
          .target("mobile-ios")
        ]
      ),
      testAction: .targets(
        [
          .testableTarget(target: "mobile-iosTests")
        ],
        options: .options(
          coverage: true,
          codeCoverageTargets: [
            .target("mobile-ios")
          ]
        )
      )
    )
  ]
)

Hi @hongbo-miao

Tuist sets a default version in the generated projects. We could expose an API to make that configurable. What’s the motivation behind it? Are you limited when the Xcode project version is lower than the one that you expect?

1 Like

Hi @pepicrft thanks for the info! :smiley:

I was hoping to stay up to date in case future Xcode drops old project format. But I am not currently limited by using an older Xcode project version.

Regarding whether it makes sense to expose an API to make that configurable, here is some additional info I found that might help with the decision: https://stackoverflow.com/questions/31455012/xcode-project-format-what-are-the-differences-between-3-1-3-2-6-3-and-8-0

Thanks a lot @hongbo-miao. It’s very unlikely that old project formats are dropped. If you would like to add an API to set that manually, you are more than welcome to open a PR agains the repository :slight_smile: . We’ll happily review it.