Skip to content

Commit f7485cc

Browse files
authored
Fix passed JExtractGenerationMode not being used by JExtractCommand. (#404)
Co-authored-by: pelekon <[email protected]>
1 parent d006f9a commit f7485cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SwiftJavaTool/Commands/JExtractCommand.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension SwiftJava {
4040
@OptionGroup var commonOptions: SwiftJava.CommonOptions
4141

4242
@Option(help: "The mode of generation to use for the output files. Used with jextract mode.")
43-
var mode: JExtractGenerationMode = .ffm
43+
var mode: JExtractGenerationMode?
4444

4545
@Option(help: "The name of the Swift module into which the resulting Swift types will be generated.")
4646
var swiftModule: String
@@ -86,6 +86,11 @@ extension SwiftJava.JExtractCommand {
8686
if let javaPackage {
8787
config.javaPackage = javaPackage
8888
}
89+
if let mode {
90+
config.mode = mode
91+
} else if config.mode == nil {
92+
config.mode = .ffm
93+
}
8994
config.swiftModule = self.effectiveSwiftModule
9095
config.outputJavaDirectory = outputJava
9196
config.outputSwiftDirectory = outputSwift

0 commit comments

Comments
 (0)