@@ -18,6 +18,7 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
1818 {
1919 let outputSwiftPath = context. pluginWorkDirectoryURL. appending ( path: " ExportSwift.swift " )
2020 let outputSkeletonPath = context. pluginWorkDirectoryURL. appending ( path: " ExportSwift.json " )
21+ let inputFiles = target. sourceFiles. filter { !$0. url. path. hasPrefix ( context. pluginWorkDirectoryURL. path + " / " ) } . map ( \. url)
2122 return . buildCommand(
2223 displayName: " Export Swift API " ,
2324 executable: try context. tool ( named: " BridgeJSTool " ) . url,
@@ -28,7 +29,8 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
2829 " --output-swift " ,
2930 outputSwiftPath. path,
3031 " --always-write " , " true " ,
31- ] + target. sourceFiles. filter { !$0. url. path. hasPrefix ( context. pluginWorkDirectoryURL. path + " / " ) } . map ( \. url. path) ,
32+ ] + inputFiles. map ( \. path) ,
33+ inputFiles: inputFiles,
3234 outputFiles: [
3335 outputSwiftPath
3436 ]
@@ -38,6 +40,9 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
3840 private func createImportTSCommand( context: PluginContext , target: SwiftSourceModuleTarget ) throws -> Command {
3941 let outputSwiftPath = context. pluginWorkDirectoryURL. appending ( path: " ImportTS.swift " )
4042 let outputSkeletonPath = context. pluginWorkDirectoryURL. appending ( path: " ImportTS.json " )
43+ let inputFiles = [
44+ target. directoryURL. appending ( path: " bridge.d.ts " )
45+ ]
4146 return . buildCommand(
4247 displayName: " Import TypeScript API " ,
4348 executable: try context. tool ( named: " BridgeJSTool " ) . url,
@@ -52,8 +57,8 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
5257 " --always-write " , " true " ,
5358 " --project " ,
5459 context. package . directoryURL. appending ( path: " tsconfig.json " ) . path,
55- target . directoryURL . appending ( path : " bridge.d.ts " ) . path,
56- ] ,
60+ ] + inputFiles . map ( \ . path) ,
61+ inputFiles : inputFiles ,
5762 outputFiles: [
5863 outputSwiftPath
5964 ]
0 commit comments