@@ -18,6 +18,7 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
18
18
{
19
19
let outputSwiftPath = context. pluginWorkDirectoryURL. appending ( path: " ExportSwift.swift " )
20
20
let outputSkeletonPath = context. pluginWorkDirectoryURL. appending ( path: " ExportSwift.json " )
21
+ let inputFiles = target. sourceFiles. filter { !$0. url. path. hasPrefix ( context. pluginWorkDirectoryURL. path + " / " ) } . map ( \. url)
21
22
return . buildCommand(
22
23
displayName: " Export Swift API " ,
23
24
executable: try context. tool ( named: " BridgeJSTool " ) . url,
@@ -28,7 +29,8 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
28
29
" --output-swift " ,
29
30
outputSwiftPath. path,
30
31
" --always-write " , " true " ,
31
- ] + target. sourceFiles. filter { !$0. url. path. hasPrefix ( context. pluginWorkDirectoryURL. path + " / " ) } . map ( \. url. path) ,
32
+ ] + inputFiles. map ( \. path) ,
33
+ inputFiles: inputFiles,
32
34
outputFiles: [
33
35
outputSwiftPath
34
36
]
@@ -38,6 +40,9 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
38
40
private func createImportTSCommand( context: PluginContext , target: SwiftSourceModuleTarget ) throws -> Command {
39
41
let outputSwiftPath = context. pluginWorkDirectoryURL. appending ( path: " ImportTS.swift " )
40
42
let outputSkeletonPath = context. pluginWorkDirectoryURL. appending ( path: " ImportTS.json " )
43
+ let inputFiles = [
44
+ target. directoryURL. appending ( path: " bridge.d.ts " )
45
+ ]
41
46
return . buildCommand(
42
47
displayName: " Import TypeScript API " ,
43
48
executable: try context. tool ( named: " BridgeJSTool " ) . url,
@@ -52,8 +57,8 @@ struct BridgeJSBuildPlugin: BuildToolPlugin {
52
57
" --always-write " , " true " ,
53
58
" --project " ,
54
59
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 ,
57
62
outputFiles: [
58
63
outputSwiftPath
59
64
]
0 commit comments