You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+10-10
Original file line number
Diff line number
Diff line change
@@ -56,29 +56,29 @@ SAMPLES_DIR := "Samples"
56
56
all:
57
57
@echo "Welcome to swift-java! There are several makefile targets to choose from:"
58
58
@echo " javakit-run: Run the JavaKit example program that uses Java libraries from Swift."
59
-
@echo " javakit-generate: Regenerate the Swift wrapper code for the various JavaKit libraries from Java. This only has to be done when changing the Java2Swift tool."
59
+
@echo " javakit-generate: Regenerate the Swift wrapper code for the various JavaKit libraries from Java. This only has to be done when changing the SwiftJava tool."
Copy file name to clipboardExpand all lines: Samples/JavaSieve/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
This package contains an example program that demonstrates importing a Java library distributed as a Jar file into Swift and using some APIs from that library. It demonstrates how to:
4
4
5
-
* Use the Java2Swift tool to discover the classes in a Jar file and make them available in Swift
6
-
* Layer Swift wrappers for Java classes as separate Swift modules using Java2Swift
5
+
* Use the SwiftJava tool to discover the classes in a Jar file and make them available in Swift
6
+
* Layer Swift wrappers for Java classes as separate Swift modules using SwiftJava
7
7
* Access static methods of Java classes from Swift
8
8
9
9
This example wraps an [open-source Java library](https://github.com/gazman-sdk/quadratic-sieve-Java) implementing the [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) algorithm for finding prime numbers, among other algorithms. To get started, clone that repository and build a Jar file containing the library:
Copy file name to clipboardExpand all lines: Sources/SwiftJavaTool/JavaToSwift.swift
+5-6
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,23 @@ import SwiftSyntaxBuilder
24
24
import JavaKitConfigurationShared
25
25
import JavaKitShared
26
26
27
-
/// Command-line utility to drive the export of Java classes into Swift types.
28
27
@main
29
28
structJavaToSwift:AsyncParsableCommand{
30
-
staticvar_commandName:String{"Java2Swift"}
29
+
staticvar_commandName:String{"swift-java"}
31
30
32
31
@Option(help:"The name of the Swift module into which the resulting Swift types will be generated.")
33
32
varmoduleName:String?
34
33
35
34
@Option(
36
35
help:
37
-
"A Java2Swift configuration file for a given Swift module name on which this module depends, e.g., JavaKitJar=Sources/JavaKitJar/Java2Swift.config. There should be one of these options for each Swift module that this module depends on (transitively) that contains wrapped Java sources."
36
+
"A swift-java configuration file for a given Swift module name on which this module depends, e.g., JavaKitJar=Sources/JavaKitJar/swift-java.config. There should be one of these options for each Swift module that this module depends on (transitively) that contains wrapped Java sources."
38
37
)
39
38
vardependsOn:[String]=[]
40
39
41
40
// TODO: This should be a "make wrappers" option that just detects when we give it a jar
42
41
@Flag(
43
42
help:
44
-
"Specifies that the input is a Jar file whose public classes will be loaded. The output of Java2Swift will be a configuration file (Java2Swift.config) that can be used as input to a subsequent Java2Swift invocation to generate wrappers for those public classes."
43
+
"Specifies that the input is a Jar file whose public classes will be loaded. The output of swift-java will be a configuration file (swift-java.config) that can be used as input to a subsequent swift-java invocation to generate wrappers for those public classes."
0 commit comments