Skip to content

Commit dce1531

Browse files
Revert "Skip BridgeJS macros for non-BridgeJS examples"
This reverts commit 222d1e2.
1 parent 222d1e2 commit dce1531

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

Package.swift

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@
33
import CompilerPluginSupport
44
import PackageDescription
55

6-
func envFlag(_ name: String) -> Bool {
7-
guard let value = Context.environment[name]?.lowercased() else {
8-
return false
9-
}
10-
return value == "1" || value == "true" || value == "yes" || value == "on"
11-
}
12-
136
// NOTE: needed for embedded customizations, ideally this will not be necessary at all in the future, or can be replaced with traits
147
let shouldBuildForEmbedded = Context.environment["JAVASCRIPTKIT_EXPERIMENTAL_EMBEDDED_WASM"].flatMap(Bool.init) ?? false
158
let useLegacyResourceBundling =
169
Context.environment["JAVASCRIPTKIT_USE_LEGACY_RESOURCE_BUNDLING"].flatMap(Bool.init) ?? false
1710
let enableTracingByEnv = Context.environment["JAVASCRIPTKIT_ENABLE_TRACING"].flatMap(Bool.init) ?? false
18-
let disableBridgeJSMacros = envFlag("JAVASCRIPTKIT_DISABLE_BRIDGEJS_MACROS")
1911

2012
let tracingTrait = Trait(
2113
name: "Tracing",
@@ -61,10 +53,8 @@ let package = Package(
6153
targets: [
6254
.target(
6355
name: "JavaScriptKit",
64-
dependencies: ["_CJavaScriptKit"]
65-
+ (disableBridgeJSMacros ? [] : ["BridgeJSMacros"]),
66-
exclude: (useLegacyResourceBundling ? [] : ["Runtime"])
67-
+ (disableBridgeJSMacros ? ["Macros.swift"] : []),
56+
dependencies: ["_CJavaScriptKit", "BridgeJSMacros"],
57+
exclude: useLegacyResourceBundling ? [] : ["Runtime"],
6858
resources: useLegacyResourceBundling ? [.copy("Runtime")] : [],
6959
cSettings: shouldBuildForEmbedded
7060
? [

Utilities/build-examples.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ for example in Examples/*; do
2222
if [ -d "$example" ] && [ -f "$example/build.sh" ]; then
2323
echo "Building $example"
2424
set -x
25-
if [ -f "$example/Package.swift" ] && grep -q 'plugin(name: "BridgeJS"' "$example/Package.swift"; then
26-
(cd "$example" && ./build.sh release)
27-
else
28-
(cd "$example" && JAVASCRIPTKIT_DISABLE_BRIDGEJS_MACROS=1 ./build.sh release)
29-
fi
25+
(cd "$example" && ./build.sh release)
3026
{ set +x; } 2>/dev/null
3127
fi
3228
done

0 commit comments

Comments
 (0)