-
Notifications
You must be signed in to change notification settings - Fork 48
Minor cleanups to the JavaKit module and samples #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b0402df
Rename JavaClass.init(in:) to JavaClass.init(environment:).
DougGregor 805cd57
Remove the unnecessary ArrayList bits from the JavaKit sample app
DougGregor ac64dd7
Import the various java.lang.* class wrappers over primitive types
DougGregor 39787f8
JavaKit: Autogenerate JavaClass rather than hand-rolling it
DougGregor f0e869f
Clean up and fix samples
DougGregor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
Samples/JavaKitSampleApp/Sources/JavaKitExample/Java2Swift.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
{ | ||
"classes" : { | ||
"java.lang.Boolean" : "JavaBoolean", | ||
"java.lang.Byte" : "JavaByte", | ||
"java.lang.Character" : "JavaCharacter", | ||
"java.lang.Class" : "JavaClass", | ||
"java.lang.Double" : "JavaDouble", | ||
"java.lang.Error" : "JavaError", | ||
"java.lang.Exception" : "Exception", | ||
"java.lang.Float" : "JavaFloat", | ||
"java.lang.Integer" : "JavaInteger", | ||
"java.lang.Long" : "JavaLong", | ||
"java.lang.Number" : "JavaNumber", | ||
"java.lang.Object" : "JavaObject", | ||
"java.lang.RuntimeException" : "RuntimeException", | ||
"java.lang.Throwable" : "Throwable" | ||
"java.lang.Short" : "JavaShort", | ||
"java.lang.Throwable" : "Throwable", | ||
"java.lang.Void" : "JavaVoid" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Auto-generated by Java-to-Swift wrapper generator. | ||
import JavaRuntime | ||
|
||
@JavaClass("java.lang.Boolean") | ||
public struct JavaBoolean { | ||
@JavaMethod | ||
public init(_ arg0: Bool, environment: JNIEnvironment? = nil) | ||
|
||
@JavaMethod | ||
public init(_ arg0: String, environment: JNIEnvironment? = nil) | ||
|
||
@JavaMethod | ||
public func equals(_ arg0: JavaObject?) -> Bool | ||
|
||
@JavaMethod | ||
public func toString() -> String | ||
|
||
@JavaMethod | ||
public func hashCode() -> Int32 | ||
|
||
@JavaMethod | ||
public func compareTo(_ arg0: JavaBoolean?) -> Int32 | ||
|
||
@JavaMethod | ||
public func compareTo(_ arg0: JavaObject?) -> Int32 | ||
|
||
@JavaMethod | ||
public func booleanValue() -> Bool | ||
|
||
@JavaMethod | ||
public func getClass() -> JavaClass<JavaObject>? | ||
|
||
@JavaMethod | ||
public func notify() | ||
|
||
@JavaMethod | ||
public func notifyAll() | ||
|
||
@JavaMethod | ||
public func wait(_ arg0: Int64) throws | ||
|
||
@JavaMethod | ||
public func wait(_ arg0: Int64, _ arg1: Int32) throws | ||
|
||
@JavaMethod | ||
public func wait() throws | ||
} | ||
extension JavaClass<JavaBoolean> { | ||
@JavaStaticField | ||
public var TRUE: JavaBoolean? | ||
|
||
@JavaStaticField | ||
public var FALSE: JavaBoolean? | ||
|
||
@JavaStaticField | ||
public var TYPE: JavaClass<JavaBoolean>? | ||
|
||
@JavaStaticMethod | ||
public func toString(_ arg0: Bool) -> String | ||
|
||
@JavaStaticMethod | ||
public func hashCode(_ arg0: Bool) -> Int32 | ||
|
||
@JavaStaticMethod | ||
public func getBoolean(_ arg0: String) -> Bool | ||
|
||
@JavaStaticMethod | ||
public func compare(_ arg0: Bool, _ arg1: Bool) -> Int32 | ||
|
||
@JavaStaticMethod | ||
public func valueOf(_ arg0: String) -> JavaBoolean? | ||
|
||
@JavaStaticMethod | ||
public func valueOf(_ arg0: Bool) -> JavaBoolean? | ||
|
||
@JavaStaticMethod | ||
public func parseBoolean(_ arg0: String) -> Bool | ||
|
||
@JavaStaticMethod | ||
public func logicalAnd(_ arg0: Bool, _ arg1: Bool) -> Bool | ||
|
||
@JavaStaticMethod | ||
public func logicalOr(_ arg0: Bool, _ arg1: Bool) -> Bool | ||
|
||
@JavaStaticMethod | ||
public func logicalXor(_ arg0: Bool, _ arg1: Bool) -> Bool | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// Auto-generated by Java-to-Swift wrapper generator. | ||
import JavaRuntime | ||
|
||
@JavaClass("java.lang.Byte", extends: JavaNumber.self) | ||
public struct JavaByte { | ||
@JavaMethod | ||
public init(_ arg0: Int8, environment: JNIEnvironment? = nil) | ||
|
||
@JavaMethod | ||
public init(_ arg0: String, environment: JNIEnvironment? = nil) throws | ||
|
||
@JavaMethod | ||
public func equals(_ arg0: JavaObject?) -> Bool | ||
|
||
@JavaMethod | ||
public func toString() -> String | ||
|
||
@JavaMethod | ||
public func hashCode() -> Int32 | ||
|
||
@JavaMethod | ||
public func compareTo(_ arg0: JavaByte?) -> Int32 | ||
|
||
@JavaMethod | ||
public func compareTo(_ arg0: JavaObject?) -> Int32 | ||
|
||
@JavaMethod | ||
public func byteValue() -> Int8 | ||
|
||
@JavaMethod | ||
public func shortValue() -> Int16 | ||
|
||
@JavaMethod | ||
public func intValue() -> Int32 | ||
|
||
@JavaMethod | ||
public func longValue() -> Int64 | ||
|
||
@JavaMethod | ||
public func floatValue() -> Float | ||
|
||
@JavaMethod | ||
public func doubleValue() -> Double | ||
|
||
@JavaMethod | ||
public func getClass() -> JavaClass<JavaObject>? | ||
|
||
@JavaMethod | ||
public func notify() | ||
|
||
@JavaMethod | ||
public func notifyAll() | ||
|
||
@JavaMethod | ||
public func wait(_ arg0: Int64) throws | ||
|
||
@JavaMethod | ||
public func wait(_ arg0: Int64, _ arg1: Int32) throws | ||
|
||
@JavaMethod | ||
public func wait() throws | ||
} | ||
extension JavaClass<JavaByte> { | ||
@JavaStaticField | ||
public var MIN_VALUE: Int8 | ||
|
||
@JavaStaticField | ||
public var MAX_VALUE: Int8 | ||
|
||
@JavaStaticField | ||
public var TYPE: JavaClass<JavaByte>? | ||
|
||
@JavaStaticField | ||
public var SIZE: Int32 | ||
|
||
@JavaStaticField | ||
public var BYTES: Int32 | ||
|
||
@JavaStaticMethod | ||
public func toString(_ arg0: Int8) -> String | ||
|
||
@JavaStaticMethod | ||
public func hashCode(_ arg0: Int8) -> Int32 | ||
|
||
@JavaStaticMethod | ||
public func compareUnsigned(_ arg0: Int8, _ arg1: Int8) -> Int32 | ||
|
||
@JavaStaticMethod | ||
public func compare(_ arg0: Int8, _ arg1: Int8) -> Int32 | ||
|
||
@JavaStaticMethod | ||
public func valueOf(_ arg0: String) throws -> JavaByte? | ||
|
||
@JavaStaticMethod | ||
public func valueOf(_ arg0: String, _ arg1: Int32) throws -> JavaByte? | ||
|
||
@JavaStaticMethod | ||
public func valueOf(_ arg0: Int8) -> JavaByte? | ||
|
||
@JavaStaticMethod | ||
public func decode(_ arg0: String) throws -> JavaByte? | ||
|
||
@JavaStaticMethod | ||
public func toUnsignedLong(_ arg0: Int8) -> Int64 | ||
|
||
@JavaStaticMethod | ||
public func toUnsignedInt(_ arg0: Int8) -> Int32 | ||
|
||
@JavaStaticMethod | ||
public func parseByte(_ arg0: String) throws -> Int8 | ||
|
||
@JavaStaticMethod | ||
public func parseByte(_ arg0: String, _ arg1: Int32) throws -> Int8 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, abusing the
in:
as label is always a tad too much in Swift libs 😆