File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Plugins/BridgeJS/Sources/BridgeJSTool Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ import BridgeJSUtilities
113113 let bridgeJsGlobalDtsPath = targetDirectory. appending ( path: " bridge-js.global.d.ts " )
114114 let hasDts = FileManager . default. fileExists ( atPath: bridgeJsDtsPath. path)
115115 let hasGlobalDts = FileManager . default. fileExists ( atPath: bridgeJsGlobalDtsPath. path)
116+ var generatedMacrosPath : String ? = nil
116117 if hasDts || hasGlobalDts {
117118 guard let tsconfigPath = doubleDashOptions [ " project " ] else {
118119 throw BridgeJSToolError ( " --project option is required when processing .d.ts files " )
@@ -128,9 +129,16 @@ import BridgeJSUtilities
128129 progress: progress,
129130 outputPath: bridgeJSMacrosPath. path
130131 )
132+ generatedMacrosPath = bridgeJSMacrosPath. path
131133 }
132134
133- let inputFiles = inputSwiftFiles ( targetDirectory: targetDirectory, positionalArguments: positionalArguments)
135+ var inputFiles = inputSwiftFiles ( targetDirectory: targetDirectory, positionalArguments: positionalArguments)
136+ // BridgeJS.Macros.swift contains imported declarations (@JSFunction, @JSClass, etc.) that need
137+ // to be processed by SwiftToSkeleton to populate the imported skeleton. The command plugin
138+ // filters out Generated/ files, so we explicitly add it here after generation.
139+ if let macrosPath = generatedMacrosPath, FileManager . default. fileExists ( atPath: macrosPath) {
140+ inputFiles. append ( macrosPath)
141+ }
134142 let swiftToSkeleton = SwiftToSkeleton (
135143 progress: progress,
136144 moduleName: moduleName,
You can’t perform that action at this time.
0 commit comments