|
3 | 3 | import CompilerPluginSupport |
4 | 4 | import PackageDescription |
5 | 5 |
|
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 | | - |
13 | 6 | // NOTE: needed for embedded customizations, ideally this will not be necessary at all in the future, or can be replaced with traits |
14 | 7 | let shouldBuildForEmbedded = Context.environment["JAVASCRIPTKIT_EXPERIMENTAL_EMBEDDED_WASM"].flatMap(Bool.init) ?? false |
15 | 8 | let useLegacyResourceBundling = |
16 | 9 | Context.environment["JAVASCRIPTKIT_USE_LEGACY_RESOURCE_BUNDLING"].flatMap(Bool.init) ?? false |
17 | 10 | let enableTracingByEnv = Context.environment["JAVASCRIPTKIT_ENABLE_TRACING"].flatMap(Bool.init) ?? false |
18 | | -let disableBridgeJSMacros = envFlag("JAVASCRIPTKIT_DISABLE_BRIDGEJS_MACROS") |
19 | 11 |
|
20 | 12 | let tracingTrait = Trait( |
21 | 13 | name: "Tracing", |
@@ -61,10 +53,8 @@ let package = Package( |
61 | 53 | targets: [ |
62 | 54 | .target( |
63 | 55 | name: "JavaScriptKit", |
64 | | - dependencies: ["_CJavaScriptKit"] |
65 | | - + (disableBridgeJSMacros ? [] : ["BridgeJSMacros"]), |
66 | | - exclude: (useLegacyResourceBundling ? [] : ["Runtime"]) |
67 | | - + (disableBridgeJSMacros ? ["Macros.swift"] : []), |
| 56 | + dependencies: ["_CJavaScriptKit", "BridgeJSMacros"], |
| 57 | + exclude: useLegacyResourceBundling ? [] : ["Runtime"], |
68 | 58 | resources: useLegacyResourceBundling ? [.copy("Runtime")] : [], |
69 | 59 | cSettings: shouldBuildForEmbedded |
70 | 60 | ? [ |
|
0 commit comments