tuist

tuist 的头像作者 tuist

Tuist项目的最佳实践。在使用Tuist清单、生成项目或在Tuist项目中使用xcodebuild构建时使用。

📖 中文导读:Tuist项目的最佳实践。在使用Tuist清单、生成项目或在Tuist项目中使用xcodebuild构建时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: tuist description: Best practices for Tuist projects. Use when working with Tuist manifests, generating projects, or building with xcodebuild in Tuist projects.

Tuist

Project Generation

Generate projects without opening Xcode:

tuist generate --no-open

Target Declaration

Use buildableFolders when declaring targets to avoid regenerating projects on file changes:

let target = Target(
    name: "MyApp",
    destinations: [.iPhone],
    product: .app,
    bundleId: "com.example.app",
    buildableFolders: ["Sources/", "Resources/"]
)

Building with xcodebuild

Pass these build settings to enable caching and improve build performance:

xcodebuild build \
  -scheme MyScheme \
  COMPILATION_CACHE_ENABLE_CACHING=YES \
  CLANG_ENABLE_COMPILE_CACHE=YES \
  SWIFT_ENABLE_EXPLICIT_MODULES=YES \
  SWIFT_USE_INTEGRATED_DRIVER=YES

Disable Signing for CI/Agent Builds

When building through an agent or CI, disable code signing:

xcodebuild build \
  -scheme MyScheme \
  CODE_SIGN_IDENTITY=""