File tree Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ struct Configuration: Codable {
20
20
21
21
/// The Java classes that should be translated to Swift. The keys are
22
22
/// canonical Java class names (e.g., java.util.Vector) and the values are
23
- /// the corresponding Swift names (e.g., JavaVector). If the value is `nil`,
24
- /// then the Java class name will be used for the Swift name, too.
25
- var classes : [ String : String ? ] = [ : ]
23
+ /// the corresponding Swift names (e.g., JavaVector).
24
+ var classes : [ String : String ] = [ : ]
26
25
}
Original file line number Diff line number Diff line change @@ -75,9 +75,7 @@ struct Java2SwiftBuildToolPlugin: BuildToolPlugin {
75
75
/// Determine the list of Java classes that will be translated into Swift,
76
76
/// along with the names of the corresponding Swift types. This will be
77
77
/// passed along to the Java2Swift tool.
78
- let classes = config. classes. map { ( javaClassName, swiftName) in
79
- ( javaClassName, swiftName ?? javaClassName. defaultSwiftNameForJavaClass)
80
- } . sorted { ( lhs, rhs) in
78
+ let classes = config. classes. sorted { ( lhs, rhs) in
81
79
lhs. 0 < rhs. 0
82
80
}
83
81
@@ -139,16 +137,3 @@ func findJavaHome() -> String {
139
137
140
138
fatalError ( " Please set the JAVA_HOME environment variable to point to where Java is installed. " )
141
139
}
142
-
143
- extension String {
144
- /// For a String that's of the form java.util.Vector, return the "Vector"
145
- /// part.
146
- fileprivate var defaultSwiftNameForJavaClass : String {
147
- if let dotLoc = lastIndex ( of: " . " ) {
148
- let afterDot = index ( after: dotLoc)
149
- return String ( self [ afterDot... ] )
150
- }
151
-
152
- return self
153
- }
154
- }
You can’t perform that action at this time.
0 commit comments