Skip to content

Commit 780727d

Browse files
committed
Added information about codegen deps and cli usage
1 parent fefe4d6 commit 780727d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

codegen-java/README.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ $ java -cp <classpath-for-pkl-codegen-java> \
1818
src/main/resources/Birds.pkl
1919
----
2020

21+
The CLI jar tool (pkl-codegen-java) has several dependencies to run: pkl-cli-java, kotlin-stdlib and javapoet if you do not already have these dependencies (or pkl-codegen-java.jar) you can download the respective jars at the following urls:
22+
23+
* https://search.maven.org/remote_content?g=com.squareup&a=javapoet&v=RELEASE
24+
* https://search.maven.org/remote_content?g=org.jetbrains.kotlin&a=kotlin-stdlib&v=RELEASE
25+
* https://search.maven.org/remote_content?g=org.pkl-lang&a=pkl-cli-java&v=LATEST
26+
* https://search.maven.org/remote_content?g=org.pkl-lang&a=pkl-codegen-java&v=LATEST
27+
28+
Then you can call the tool with the downloaded jars (either remove the versions from the filenames on download or change the below to include the versions)
29+
30+
[source,shell script]
31+
----
32+
$ java -cp "javapoet.jar;kotlin-stdlib.jar;pkl-cli-java.jar;pkl-codegen-java.jar" org.pkl.codegen.java.Main \
33+
-o generated \
34+
src/main/resources/Birds.pkl
35+
----
36+
37+
You will likely need the --allowed-modules whitelisting depending on the pkl location, also added to the command. Make sure to see the https://github.com/apple/pkl/WINDOWS.adoc[WINDOWS.adoc] if you are on Windows for additional tips.
38+
39+
2140
NOTE: xref:build.gradle.kts[] demonstrates how to generate code with the Gradle plugin.
2241

2342
The following Java code is generated:

0 commit comments

Comments
 (0)