콘텐츠로 이동

새 프로젝트 만들기

Tuist로 새 프로젝트를 시작하는 가장 간단한 방법은 tuist init 명령어를 사용하는 것입니다. 이 명령어는 프로젝트 설정을 안내하는 인터랙티브 CLI를 실행합니다. 프롬프트가 표시되면 "generated project" 생성 옵션을 선택하세요.

그런 다음 tuist edit을 실행하여 프로젝트를 편집할 수 있으며, Xcode가 열려 프로젝트를 편집할 수 있습니다. 생성되는 파일 중 하나인 Project.swift에는 프로젝트 정의가 포함됩니다. Swift Package Manager에 익숙하다면, 이를 Xcode 프로젝트 용어를 사용한 Package.swift라고 생각하면 됩니다.

swift
import ProjectDescription
let project = Project(
name: "MyApp",
targets: [
.target(
name: "MyApp",
destinations: .iOS,
product: .app,
bundleId: "dev.tuist.MyApp",
infoPlist: .extendingDefault(
with: [
"UILaunchScreen": [
"UIColorName": "",
"UIImageName": "",
],
]
),
sources: ["MyApp/Sources/**"],
resources: ["MyApp/Resources/**"],
dependencies: []
),
.target(
name: "MyAppTests",
destinations: .iOS,
product: .unitTests,
bundleId: "dev.tuist.MyAppTests",
infoPlist: .default,
sources: ["MyApp/Tests/**"],
resources: [],
dependencies: [.target(name: "MyApp")]
),
]
)
Note

유지 관리 오버헤드를 최소화하기 위해 사용 가능한 템플릿 목록을 의도적으로 짧게 유지합니다. 애플리케이션이 아닌 프레임워크와 같은 프로젝트를 만들려면 tuist init을 시작점으로 사용한 후 생성된 프로젝트를 필요에 맞게 수정하면 됩니다.

프로젝트 수동 만들기#

또는 프로젝트를 수동으로 만들 수 있습니다. 이는 Tuist와 그 개념에 이미 익숙한 경우에만 권장합니다. 먼저 해야 할 일은 프로젝트 구조를 위한 추가 디렉터리를 만드는 것입니다.

bash
mkdir MyFramework
cd MyFramework

그런 다음 Tuist를 구성하고 Tuist가 프로젝트의 루트 디렉터리를 결정하는 데 사용하는 Tuist.swift 파일과 프로젝트가 선언되는 Project.swift 파일을 만듭니다.

swift
import ProjectDescription
let project = Project(
name: "MyFramework",
targets: [
.target(
name: "MyFramework",
destinations: .macOS,
product: .framework,
bundleId: "dev.tuist.MyFramework",
sources: ["MyFramework/Sources/**"],
dependencies: []
)
]
)
swift
import ProjectDescription
let tuist = Tuist()
Warning

Tuist는 Tuist/ 디렉터리를 사용하여 프로젝트의 루트를 결정하며, 해당 위치에서 디렉터리를 글로빙하여 다른 매니페스트 파일을 찾습니다. 선호하는 편집기로 이러한 파일을 만든 후, tuist edit를 사용하여 Xcode에서 프로젝트를 편집할 수 있습니다.