@tokamakdev/platform-macos-arm64 0.1.1-beta.138 → 0.1.1-beta.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -238,6 +238,9 @@ swift_type='^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$'
|
|
|
238
238
|
# <directory>/<name> compiles as <plugin>-<directory>-<name>.
|
|
239
239
|
plugin_sources=$temporary/plugin-sources
|
|
240
240
|
mkdir "$plugin_sources"
|
|
241
|
+
# A plugin's compilation conditions start with its id in capitals, such as
|
|
242
|
+
# LOCATION_ for location, as every plugin compiles into one module.
|
|
243
|
+
compilation_conditions=()
|
|
241
244
|
registry=$temporary/TokamakPluginRegistry.swift
|
|
242
245
|
printf '%s\n\n%s\n%s\n' 'import Foundation' 'func tokamakPlugins(app: TokamakApp) -> [any TokamakPlugin] {' ' [' > "$registry"
|
|
243
246
|
for plugin in "$input/plugins"/*/; do
|
|
@@ -248,6 +251,15 @@ for plugin in "$input/plugins"/*/; do
|
|
|
248
251
|
exit 1
|
|
249
252
|
fi
|
|
250
253
|
printf ' %s(host: TokamakHost(app: app, plugin: "%s")),\n' "$class" "$plugin_id" >> "$registry"
|
|
254
|
+
condition_prefix=$(printf '%s' "$plugin_id" | tr 'a-z-' 'A-Z_')_
|
|
255
|
+
for condition_file in "$plugin/compilation-conditions"/*; do
|
|
256
|
+
condition=$(<"$condition_file")
|
|
257
|
+
if [[ ! "$condition" =~ ^${condition_prefix}[A-Za-z0-9_]+$ ]]; then
|
|
258
|
+
echo "plugin '$plugin_id' has compilation condition '$condition', which must be $condition_prefix followed by letters, digits or underscores" >&2
|
|
259
|
+
exit 1
|
|
260
|
+
fi
|
|
261
|
+
compilation_conditions+=(-D "$condition")
|
|
262
|
+
done
|
|
251
263
|
[[ -d "$plugin/native" ]] || continue
|
|
252
264
|
while IFS= read -r -d '' source; do
|
|
253
265
|
relative=${source#"$plugin/native/"}
|
|
@@ -282,6 +294,10 @@ swift_args=(
|
|
|
282
294
|
-Xlinker -dead_strip
|
|
283
295
|
-Xlinker -exported_symbols_list -Xlinker "$exported_symbols"
|
|
284
296
|
)
|
|
297
|
+
# Bash 3.2 cannot expand an empty array under set -u.
|
|
298
|
+
if [[ ${#compilation_conditions[@]} -gt 0 ]]; then
|
|
299
|
+
swift_args+=("${compilation_conditions[@]}")
|
|
300
|
+
fi
|
|
285
301
|
|
|
286
302
|
# Simulator builds embed their entitlements in __TEXT,__entitlements, where
|
|
287
303
|
# the simulator reads them.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/macos-arm64/tools/tokamak-swift-describe
|
|
3
3
|
size: 34569672 bytes
|
|
4
|
-
sha256:
|
|
4
|
+
sha256: 2e3e96f8b369027167a0331f071328dbae97aebb88c911cd93a591e1f39ccf01
|