|
1
|
import ProjectDescription |
|
2
|
|
|
3
|
let project = Project( |
|
4
|
name: "tauri-app", |
|
5
|
settings: .settings( |
|
6
|
base: [ |
|
7
|
"DEVELOPMENT_TEAM": "NADBSNEZWH", |
|
8
|
"PRODUCT_NAME": "tauri-app", |
|
9
|
"PRODUCT_BUNDLE_IDENTIFIER": "com.tauri.dev", |
|
10
|
] |
|
11
|
), |
|
12
|
targets: [ |
|
13
|
// MARK: - iOS target (mirrors Tauri-generated project.yml) |
|
14
|
.target( |
|
15
|
name: "tauri-app_iOS", |
|
16
|
destinations: .iOS, |
|
17
|
product: .app, |
|
18
|
bundleId: "com.tauri.dev", |
|
19
|
deploymentTargets: .iOS("14.0"), |
|
20
|
infoPlist: .file(path: "tauri-app_iOS/Info.plist"), |
|
21
|
sources: [ |
|
22
|
"Sources/**", |
|
23
|
"tauri-app_iOS/**", |
|
24
|
], |
|
25
|
resources: [ |
|
26
|
"Assets.xcassets", |
|
27
|
"LaunchScreen.storyboard", |
|
28
|
.folderReference(path: "assets"), |
|
29
|
], |
|
30
|
entitlements: .file(path: "tauri-app_iOS/tauri-app_iOS.entitlements"), |
|
31
|
scripts: [ |
|
32
|
.pre( |
|
33
|
script: """ |
|
34
|
cargo tauri ios xcode-script -v \ |
|
35
|
--platform ${PLATFORM_DISPLAY_NAME:?} \ |
|
36
|
--sdk-root ${SDKROOT:?} \ |
|
37
|
--framework-search-paths "${FRAMEWORK_SEARCH_PATHS:?}" \ |
|
38
|
--header-search-paths "${HEADER_SEARCH_PATHS:?}" \ |
|
39
|
--gcc-preprocessor-definitions "${GCC_PREPROCESSOR_DEFINITIONS:-}" \ |
|
40
|
--configuration ${CONFIGURATION:?} \ |
|
41
|
${FORCE_COLOR} ${ARCHS:?} |
|
42
|
""", |
|
43
|
name: "Build Rust Code", |
|
44
|
outputPaths: [ |
|
45
|
"$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a", |
|
46
|
"$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a", |
|
47
|
], |
|
48
|
basedOnDependencyAnalysis: false |
|
49
|
) |
|
50
|
], |
|
51
|
dependencies: [ |
|
52
|
.target(name: "tauri-app_watchOS"), |
|
53
|
.sdk(name: "CoreGraphics", type: .framework), |
|
54
|
.sdk(name: "Metal", type: .framework), |
|
55
|
.sdk(name: "MetalKit", type: .framework), |
|
56
|
.sdk(name: "QuartzCore", type: .framework), |
|
57
|
.sdk(name: "Security", type: .framework), |
|
58
|
.sdk(name: "UIKit", type: .framework), |
|
59
|
.sdk(name: "WebKit", type: .framework), |
|
60
|
], |
|
61
|
settings: .settings( |
|
62
|
base: [ |
|
63
|
"ENABLE_BITCODE": "NO", |
|
64
|
"ARCHS": "arm64", |
|
65
|
"VALID_ARCHS": "arm64", |
|
66
|
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", |
|
67
|
"LIBRARY_SEARCH_PATHS[arch=arm64]": [ |
|
68
|
"$(inherited)", |
|
69
|
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", |
|
70
|
"$(SDKROOT)/usr/lib/swift", |
|
71
|
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", |
|
72
|
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", |
|
73
|
], |
|
74
|
"LIBRARY_SEARCH_PATHS[arch=x86_64]": [ |
|
75
|
"$(inherited)", |
|
76
|
"$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)", |
|
77
|
"$(SDKROOT)/usr/lib/swift", |
|
78
|
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", |
|
79
|
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", |
|
80
|
], |
|
81
|
"EXCLUDED_ARCHS[sdk=iphoneos*]": "x86_64", |
|
82
|
"OTHER_LDFLAGS": [ |
|
83
|
"$(inherited)", |
|
84
|
"-lapp", |
|
85
|
], |
|
86
|
] |
|
87
|
) |
|
88
|
), |
|
89
|
|
|
90
|
// MARK: - tvOS placeholder target (no WebView on tvOS — native UI only) |
|
91
|
.target( |
|
92
|
name: "tauri-app_tvOS", |
|
93
|
destinations: [.appleTv], |
|
94
|
product: .app, |
|
95
|
bundleId: "com.tauri.dev.tvos", |
|
96
|
deploymentTargets: .tvOS("14.0"), |
|
97
|
infoPlist: .file(path: "tauri-app_tvOS/Info.plist"), |
|
98
|
sources: [ |
|
99
|
"tauri-app_tvOS/**" |
|
100
|
], |
|
101
|
resources: [ |
|
102
|
"Assets.xcassets" |
|
103
|
], |
|
104
|
dependencies: [ |
|
105
|
.sdk(name: "UIKit", type: .framework) |
|
106
|
], |
|
107
|
settings: .settings( |
|
108
|
base: [ |
|
109
|
"ENABLE_BITCODE": "NO", |
|
110
|
"ARCHS": "arm64", |
|
111
|
] |
|
112
|
) |
|
113
|
), |
|
114
|
|
|
115
|
// MARK: - watchOS app (embedded in iOS host, standalone SwiftUI — no WebView) |
|
116
|
.target( |
|
117
|
name: "tauri-app_watchOS", |
|
118
|
destinations: [.appleWatch], |
|
119
|
product: .app, |
|
120
|
bundleId: "com.tauri.dev.watchos", |
|
121
|
deploymentTargets: .watchOS("7.0"), |
|
122
|
infoPlist: .file(path: "tauri-app_watchOS/Info.plist"), |
|
123
|
sources: [ |
|
124
|
"tauri-app_watchOS/**" |
|
125
|
], |
|
126
|
resources: [ |
|
127
|
"tauri-app_watchOS/Assets.xcassets" |
|
128
|
], |
|
129
|
dependencies: [], |
|
130
|
settings: .settings( |
|
131
|
base: [ |
|
132
|
"ENABLE_BITCODE": "NO", |
|
133
|
"SKIP_INSTALL": "NO", |
|
134
|
"SUPPORTS_MACCATALYST": "NO", |
|
135
|
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", |
|
136
|
"SUPPORTED_PLATFORMS": "watchos watchsimulator", |
|
137
|
"WATCHOS_DEPLOYMENT_TARGET": "7.0", |
|
138
|
] |
|
139
|
) |
|
140
|
), |
|
141
|
|
|
142
|
// MARK: - visionOS app (standalone, SwiftUI only — no WebView on visionOS) |
|
143
|
.target( |
|
144
|
name: "tauri-app_visionOS", |
|
145
|
destinations: [.appleVision], |
|
146
|
product: .app, |
|
147
|
bundleId: "com.tauri.dev.visionos", |
|
148
|
deploymentTargets: .visionOS("1.0"), |
|
149
|
infoPlist: .file(path: "tauri-app_visionOS/Info.plist"), |
|
150
|
sources: [ |
|
151
|
"tauri-app_visionOS/**" |
|
152
|
], |
|
153
|
resources: [ |
|
154
|
"Assets.xcassets" |
|
155
|
], |
|
156
|
dependencies: [], |
|
157
|
settings: .settings( |
|
158
|
base: [ |
|
159
|
"ENABLE_BITCODE": "NO", |
|
160
|
"ARCHS": "arm64", |
|
161
|
] |
|
162
|
) |
|
163
|
), |
|
164
|
], |
|
165
|
schemes: [ |
|
166
|
.scheme( |
|
167
|
name: "tauri-app_iOS", |
|
168
|
buildAction: .buildAction(targets: ["tauri-app_iOS"]), |
|
169
|
runAction: .runAction(configuration: .debug), |
|
170
|
archiveAction: .archiveAction(configuration: .release), |
|
171
|
profileAction: .profileAction(configuration: .release), |
|
172
|
analyzeAction: .analyzeAction(configuration: .debug) |
|
173
|
), |
|
174
|
.scheme( |
|
175
|
name: "tauri-app_tvOS", |
|
176
|
buildAction: .buildAction(targets: ["tauri-app_tvOS"]), |
|
177
|
runAction: .runAction(configuration: .debug), |
|
178
|
archiveAction: .archiveAction(configuration: .release), |
|
179
|
profileAction: .profileAction(configuration: .release), |
|
180
|
analyzeAction: .analyzeAction(configuration: .debug) |
|
181
|
), |
|
182
|
.scheme( |
|
183
|
name: "tauri-app_visionOS", |
|
184
|
buildAction: .buildAction(targets: ["tauri-app_visionOS"]), |
|
185
|
runAction: .runAction(configuration: .debug), |
|
186
|
archiveAction: .archiveAction(configuration: .release), |
|
187
|
profileAction: .profileAction(configuration: .release), |
|
188
|
analyzeAction: .analyzeAction(configuration: .debug) |
|
189
|
), |
|
190
|
] |
|
191
|
) |