(mandatory) Install OpenJDK 17 or higher
(recommended) Install IntelliJ IDEA 2023.x
To import the project into IntelliJ, go to File→Open and select the project’s root directory.
If the project is opened but not imported, look for a popup in the lower right corner
and click its "Import Gradle Project" link.
(recommended) Install gng
gng enables to run Gradle commands with gw
(instead of ./gradlew
) from any subdirectory.
(recommended) Install jenv and plugins
jenv use specific JDK versions in certain subdirectories. Pkl comes with a .java-version
file specifying JDK 17.
Enable jenv plugins for better handling by gradle
:
jenv enable-plugin gradle
jenv enable-plugin export
gw clean
gw test # run all tests except native executable tests
gw testNative # run native executable tests
gw spotlessApply # fix code formatting
gw build # build everything except native executables
gw buildNative # build macOS executable on macOS,
# Linux and Alpine executables on Linux
# (Alpine executable is only built if ~/staticdeps/bin/musl-gcc exists)
pkl-cli/build/executable/jpkl # run Java executable
pkl-cli/build/executable/pkl-macos-amd64 # run Mac executable
pkl-cli/build/executable/pkl-linux-amd64 # run Linux executable
pkl-cli/build/executable/pkl-alpine-linux-amd64 # run Alpine Linux executable
pkl-cli/build/executable/pkl-windows-amd64.exe # run Windows executable
Go to https://gradle.org/release-checksums/ and copy the checksum for the new Gradle version
Run the following command twice (until it prints UP-TO-DATE):
gw wrapper --gradle-version [version] --gradle-distribution-sha256-sum [sha]
Commit the updated wrapper files
(optional) Update gradle/libs.version.toml based on version information from https://search.maven.org, https://plugins.gradle.org, and GitHub repos
Run gw updateDependencyLocks
Validate changes with gw build buildNative
Review and commit the updated dependency lock files
Truffle code generation is performed by Truffle’s annotation processor, which runs as part of task :pkl-core:compileJava
Output dir is generated/truffle/
ANTLR code generation is performed by task :pkl-core:generateGrammarSource
Output dir is generated/antlr/
To enable remote JVM debugging when running Gradle tasks (e.g. test), add the flag -Djvmdebug=true
.
This will listen on port 5005.
Example: ./gradlew test -Djvmdebug=true
For automated build setup examples see our CircleCI jobs like our BuildNativeJob.pkl, where we build Pkl automatically.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。