Skip to content

Commit 2bb9750

Browse files
committed
fix naming of option values
1 parent 5579846 commit 2bb9750

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

Plugins/JExtractSwiftPlugin/JExtractSwiftPlugin.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ struct JExtractSwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
9090
}
9191

9292
if let unsignedNumbersMode = configuration.unsignedNumbersMode {
93-
arguments += ["--unsigned-numbers", \(unsignedNumbersMode.rawValue.kebabCased)]
93+
arguments += ["--unsigned-numbers", unsignedNumbersMode.rawValue]
9494
}
9595

9696
if let minimumInputAccessLevelMode = configuration.minimumInputAccessLevelMode {
97-
arguments += ["--minimum-input-access-level", \(minimumInputAccessLevelMode.rawValue.kebabCased)]
97+
arguments += ["--minimum-input-access-level", minimumInputAccessLevelMode.rawValue]
9898
}
9999

100100
if let memoryManagementMode = configuration.memoryManagementMode {
101-
arguments += ["--memory-management-mode", \(memoryManagementMode.rawValue.kebabCased)]
101+
arguments += ["--memory-management-mode", memoryManagementMode.rawValue]
102102
}
103103

104104
let swiftFiles = sourceModule.sourceFiles.map { $0.url }.filter {

Plugins/PluginsShared/PluginUtils.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,3 @@ extension PluginContext {
7777
.appending(path: "\(swiftModule)", directoryHint: .notDirectory)
7878
}
7979
}
80-
81-
extension String {
82-
var kebabCased: String {
83-
var result = ""
84-
85-
for (index, char) in input.enumerated() {
86-
if char.isUppercase {
87-
if index != 0 {
88-
result.append("-")
89-
}
90-
result.append(char.lowercased())
91-
} else {
92-
result.append(char)
93-
}
94-
}
95-
96-
return result
97-
}
98-
}

Sources/SwiftJavaDocumentation/Documentation.docc/SupportedFeatures.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ on the Java side.
136136
| `Float` | `float` |
137137
| `Double` | `double` |
138138

139-
#### Unsigned numbers mode: wrap-guava
139+
#### Unsigned numbers mode: wrapGuava
140140

141141
You can configure `jextract` (in FFM mode) to instead import unsigned values as their unsigned type-safe representations
142-
as offered by the Guava library: `UnsignedLong` or `UnsignedInt`. To enable this mode pass the `--unsigned-numbers wrap-guava`
142+
as offered by the Guava library: `UnsignedLong` or `UnsignedInt`. To enable this mode pass the `--unsigned-numbers wrapGuava`
143143
command line option, or set the corresponding configuration value in `swift-java.config` (TODO).
144144

145145
This approach is type-safe, however it incurs a performance penalty for allocating a wrapper class for every
@@ -163,7 +163,7 @@ you are expected to add a Guava dependency to your Java project.
163163
| `Float` | `float` |
164164
| `Double` | `double` |
165165

166-
> Note: The `wrap-guava` mode is currently only available in FFM mode of jextract.
166+
> Note: The `wrapGuava` mode is currently only available in FFM mode of jextract.
167167
168168
### Enums
169169

Sources/SwiftJavaTool/Commands/JExtractCommand.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ extension SwiftJava {
6161
@Flag(help: "Some build systems require an output to be present when it was 'expected', even if empty. This is used by the JExtractSwiftPlugin build plugin, but otherwise should not be necessary.")
6262
var writeEmptyFiles: Bool = false
6363

64-
@Option(help: "The mode of generation to use for the output files. Used with jextract mode. By default, unsigned Swift types are imported as their bit-width compatible signed Java counterparts, and annotated using the '@Unsigned' annotation. You may choose the 'wrap-guava' mode in order to import types as class wrapper types (`UnsignedInteger` et al) defined by the Google Guava library's `com.google.common.primitives' package. that ensure complete type-safety with regards to unsigned values, however they incur an allocation and performance overhead.")
64+
@Option(help: "The mode of generation to use for the output files. Used with jextract mode. By default, unsigned Swift types are imported as their bit-width compatible signed Java counterparts, and annotated using the '@Unsigned' annotation. You may choose the 'wrapGuava' mode in order to import types as class wrapper types (`UnsignedInteger` et al) defined by the Google Guava library's `com.google.common.primitives' package. that ensure complete type-safety with regards to unsigned values, however they incur an allocation and performance overhead.")
6565
var unsignedNumbers: JExtractUnsignedIntegerMode = .default
6666

6767
@Option(help: "The lowest access level of Swift declarations that should be extracted, defaults to 'public'.")
6868
var minimumInputAccessLevel: JExtractMinimumAccessLevelMode = .default
6969

70-
@Option(help: "The memory management mode to use for the generated code. By default, the user must explicitly provide `SwiftArena` to all calls that require it. By choosing `allow-global-automatic`, user can omit this parameter and a global GC-based arena will be used.")
70+
@Option(help: "The memory management mode to use for the generated code. By default, the user must explicitly provide `SwiftArena` to all calls that require it. By choosing `allowGlobalAutomatic`, user can omit this parameter and a global GC-based arena will be used.")
7171
var memoryManagementMode: JExtractMemoryManagementMode = .default
7272

7373
@Option(

0 commit comments

Comments
 (0)