@@ -24,6 +24,7 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
2424 var verbose : Bool = getEnvironmentBool ( " SWIFT_JAVA_VERBOSE " )
2525
2626 func createBuildCommands( context: PluginContext , target: Target ) throws -> [ Command ] {
27+ log ( " Create build commands for: \( target. name) " )
2728 guard let sourceModule = target. sourceModule else { return [ ] }
2829
2930 // Note: Target doesn't have a directoryURL counterpart to directory,
@@ -41,6 +42,7 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
4142 /// this target depends on.
4243 var dependentConfigFiles : [ ( String , URL ) ] = [ ]
4344 func searchForConfigFiles( in target: any Target ) {
45+ log ( " Search for config files in target: \( target. name) " )
4446 let dependencyURL = URL ( filePath: target. directory. string)
4547
4648 // Look for a config file within this target.
@@ -58,10 +60,13 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
5860 for dependency in target. dependencies {
5961 switch dependency {
6062 case . target( let target) :
63+ log ( " Dependency target: \( target. name) " )
6164 searchForConfigFiles ( in: target)
6265
6366 case . product( let product) :
67+ log ( " Dependency product: \( product. name) " )
6468 for target in product. targets {
69+ log ( " Dependency product: \( product. name) , target: \( target. name) " )
6570 searchForConfigFiles ( in: target)
6671 }
6772
@@ -72,6 +77,7 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
7277
7378 // Process indirect target dependencies.
7479 for dependency in target. recursiveTargetDependencies {
80+ log ( " Recursive dependency target: \( dependency. name) " )
7581 searchForConfigFiles ( in: dependency)
7682 }
7783
@@ -115,7 +121,7 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
115121 while classpath. lastPathComponent != " Java " {
116122 classpath. deleteLastPathComponent ( )
117123 }
118- arguments += [ " --classpath " , classpath. path ( ) ]
124+ arguments += [ " --classpath " , classpath. path ( ) ]
119125
120126 // For each of the class files, note that it can have Swift-native
121127 // implementations. We figure this out based on the path.
@@ -131,7 +137,7 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
131137 let className = classNameComponents
132138 . reversed ( )
133139 . joined ( separator: " . " )
134- arguments += [ " --swift-native-implementation " , className]
140+ arguments += [ " --swift-native-implementation " , className]
135141 }
136142 }
137143
@@ -141,7 +147,6 @@ struct Java2SwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
141147 }
142148
143149 let executable = try context. tool ( named: " Java2Swift " ) . url
144- log ( " Prepared build command: \( executable) \( arguments) " )
145150
146151 return [
147152 . buildCommand(
0 commit comments