@@ -14,7 +14,6 @@ CARGO_MAKE_TOOLCHAIN_DEFAULT = { source = "${CARGO_MAKE_CI}", default_value = "n
14
14
CARGO_MAKE_TOOLCHAIN = { value = " ${CARGO_MAKE_TOOLCHAIN_DEFAULT}" , condition = { env_not_set = [" CARGO_MAKE_TOOLCHAIN" ] } }
15
15
CARGO_BUILD_TYPE = { source = " ${CARGO_MAKE_PROFILE}" , default_value = " debug" , mapping = { "development" = " debug" , "release" = " release" } }
16
16
CARGO_PROFILE = { source = " ${CARGO_BUILD_TYPE}" , mapping = { "debug" = " dev" , "release" = " release" } }
17
- SWIFT_CONFIGURATION = { source = " ${CARGO_MAKE_PROFILE}" , default_value = " debug" , mapping = { "development" = " debug" , "release" = " release" } }
18
17
BACKTRACE_DEFAULT = { source = " ${CARGO_MAKE_CI}" , mapping = { "true" = " 1" , "false" = " 0" } }
19
18
RUST_BACKTRACE = { value = " ${BACKTRACE_DEFAULT}" , condition = { env_not_set = [" RUST_BACKTRACE" ] } }
20
19
@@ -110,36 +109,28 @@ description = "Runs cargo build"
110
109
command = " rustup"
111
110
args = [" run" , " ${CARGO_MAKE_TOOLCHAIN}" , " cargo" , " build" , " --profile" , " ${CARGO_PROFILE}" , " --" , " @@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)" , " ${@}" ]
112
111
113
- [tasks .swift ]
114
- workspace = false
115
- category = " Build"
116
- description = " Builds the Swift package"
117
- command = " swift"
118
- args = [" build" , " --configuration" , " ${SWIFT_CONFIGURATION}" , " --package-path" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/swift/LiveViewNative" , " --scratch-path" , " ${CARGO_TARGET_DIR}/swift/.build" , " ${@}" ]
119
- dependencies = [" build-xcframework" ]
120
-
121
- [tasks .build-xcframework ]
112
+ [tasks .xcframework ]
122
113
workspace = false
123
114
category = " Packaging"
124
115
description = " Generates the LiveViewNativeCore.xcframework package"
125
116
command = " xcodebuild"
126
117
args = [
127
118
" -create-xcframework" ,
128
119
" -library" , " ${CARGO_TARGET_DIR}/aarch64-apple-darwin/debug/libliveview_native_core.a" ,
129
- " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/swift/LiveViewNativeCore /include" ,
120
+ " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src /include" ,
130
121
" -library" , " ${CARGO_TARGET_DIR}/aarch64-apple-ios/debug/libliveview_native_core.a" ,
131
- " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/swift/LiveViewNativeCore /include" ,
122
+ " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src /include" ,
132
123
" -library" , " ${CARGO_TARGET_DIR}/aarch64-apple-ios-sim/debug/libliveview_native_core.a" ,
133
- " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/swift/LiveViewNativeCore /include" ,
134
- " -output" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY }/swift/LiveViewNative/LiveViewNativeCore .xcframework"
124
+ " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src /include" ,
125
+ " -output" , " ${CARGO_TARGET_DIR }/swift/liveview_native_core .xcframework"
135
126
]
136
127
dependencies = [" build-macos" , " build-ios" , " remove-existing-xcframework" ]
137
128
138
129
[tasks .remove-existing-xcframework ]
139
130
workspace = false
140
131
private = true
141
132
script_runner = " @duckscript"
142
- script = " rm -r ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY }/swift/LiveViewNative/LiveViewNativeCore .xcframework"
133
+ script = " rm -r ${CARGO_TARGET_DIR }/swift/liveview_native_core .xcframework"
143
134
144
135
[tasks .build-macos ]
145
136
workspace = false
@@ -155,12 +146,7 @@ category = "Build"
155
146
description = " Compiles for all targets needed to produce a universal library for iOS"
156
147
command = " rustup"
157
148
args = [" run" , " ${CARGO_MAKE_TOOLCHAIN}" , " cargo" , " build" , " @@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)" , " --target" , " aarch64-apple-ios" , " --target" , " aarch64-apple-ios-sim" , " --target" , " x86_64-apple-ios" , " -p" , " liveview-native-core" ]
158
- dependencies = [" prepare-targets" ]
159
-
160
- [tasks .prepare-targets ]
161
- workspace = false
162
- private = true
163
- run_task = { name = [" install-targets" , " create-universal-targets" ], parallel = true }
149
+ dependencies = [" install-targets" ]
164
150
165
151
[tasks .install-targets ]
166
152
workspace = false
@@ -169,45 +155,16 @@ description = "Installs all toolchain targets needed for packaging"
169
155
command = " rustup"
170
156
args = [" target" , " add" , " --toolchain" , " ${CARGO_MAKE_TOOLCHAIN}" , " aarch64-apple-darwin" , " x86_64-apple-darwin" , " aarch64-apple-ios" , " aarch64-apple-ios-sim" , " x86_64-apple-ios" ]
171
157
172
- [tasks .create-universal-targets ]
173
- workspace = false
174
- private = true
175
- script_runner = " @duckscript"
176
- script = '''
177
- macos_dir = set "${CARGO_TARGET_DIR}/universal-macos/${CARGO_BUILD_TYPE}"
178
- ios_dir = set "${CARGO_TARGET_DIR}/universal-ios/${CARGO_BUILD_TYPE}"
179
-
180
- echo Creating ${macos_dir}
181
- mkdir ${macos_dir}
182
-
183
- echo "Creating ${ios_dir}"
184
- mkdir "${ios_dir}"
185
- '''
186
-
187
158
[tasks .clean ]
188
159
category = " Build"
189
160
description = " Clean build artifacts"
190
- dependencies = [" clean-rust" , " clean-swift" , " clean-artifacts" ]
191
-
192
- [tasks .clean-artifacts ]
193
- category = " Build"
194
- script_runner = " @duckscript"
195
- script = '''
196
- rm -r ${CARGO_TARGET_DIR}/universal-macos/${CARGO_BUILD_TYPE}
197
- rm -r ${CARGO_TARGET_DIR}/universal-ios/${CARGO_BUILD_TYPE}
198
- '''
199
- dependencies = [" remove-existing-xcframework" ]
161
+ dependencies = [" clean-rust" , " clean-swift" , " remove-existing-xcframework" ]
200
162
201
163
[tasks .clean-rust ]
202
164
category = " Build"
203
165
command = " cargo"
204
166
args = [" clean" ]
205
167
206
- [tasks .clean-swift ]
207
- category = " Build"
208
- command = " swift"
209
- args = [" package" , " clean" , " --package-path" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/swift/LiveViewNative" , " --scratch-path" , " ${CARGO_TARGET_DIR}/swift/.build" , " ${@}" ]
210
-
211
168
[tasks .test ]
212
169
category = " Test"
213
170
description = " Runs all tests"
@@ -219,13 +176,6 @@ description = "Runs tests written in Rust"
219
176
command = " rustup"
220
177
args = [" run" , " ${CARGO_MAKE_TOOLCHAIN}" , " cargo" , " test" , " @@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)" , " @@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )" , " ${@}" ]
221
178
222
- [tasks .test-swift ]
223
- workspace = false
224
- category = " Test"
225
- description = " Runs the Swift package tests"
226
- command = " swift"
227
- args = [" test" , " --package-path" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/swift/LiveViewNative" , " --scratch-path" , " ${CARGO_TARGET_DIR}/swift/.build" , " ${@}" ]
228
-
229
179
[tasks .bloat ]
230
180
category = " Development"
231
181
description = " Run cargo-bloat"
0 commit comments