File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Sources/SwiftJavaTool/Commands Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ extension SwiftJava {
52
52
@Option ( help: " Cache directory for intermediate results and other outputs between runs " )
53
53
var cacheDirectory : String ?
54
54
55
+ @Option ( help: " Match java package directory structure with generated Swift files " )
56
+ var swiftMatchPackageDirectoryStructure : Bool = false
57
+
55
58
@Argument ( help: " Path to .jar file whose Java classes should be wrapped using Swift bindings " )
56
59
var input : String
57
60
}
@@ -229,11 +232,16 @@ extension SwiftJava.WrapJavaCommand {
229
232
230
233
"""
231
234
235
+ var generatedFileOutputDir = self . actualOutputDirectory
236
+ if self . swiftMatchPackageDirectoryStructure {
237
+ generatedFileOutputDir? . append ( path: javaClass. getPackageName ( ) . replacing ( " . " , with: " / " ) )
238
+ }
239
+
232
240
let swiftFileName = try ! translator. getSwiftTypeName ( javaClass, preferValueTypes: false )
233
241
. swiftName. replacing ( " . " , with: " + " ) + " .swift "
234
242
try writeContents (
235
243
swiftFileText,
236
- outputDirectory: self . actualOutputDirectory ,
244
+ outputDirectory: generatedFileOutputDir ,
237
245
to: swiftFileName,
238
246
description: " Java class ' \( javaClass. getName ( ) ) ' translation "
239
247
)
You can’t perform that action at this time.
0 commit comments