mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Compare commits
240 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19c292f9a2 | |||
| d720f21149 | |||
| b28cdcd631 | |||
| 825135a0f8 | |||
| 63b92ec72b | |||
| 3125fc4678 | |||
| 4bb6890621 | |||
| 8e15556201 | |||
| 2fb17fd283 | |||
| f4983c51be | |||
| 2cd2712589 | |||
| f9a3fc88fd | |||
| d097341abd | |||
| 0eab5fb552 | |||
| 7c3787396e | |||
| 57df7995fd | |||
| 6c97b09c29 | |||
| da19c3971e | |||
| efad356b7b | |||
| 261a2260a1 | |||
| 204c6b16c3 | |||
| f91f91fd30 | |||
| 309fb49fa1 | |||
| 570c2085b3 | |||
| d55866a04b | |||
| 600939457a | |||
| e996a342cc | |||
| 00c2e00bb9 | |||
| bcee291fdc | |||
| 4a7f90157a | |||
| f15ad6ec06 | |||
| 380095c8a7 | |||
| 9c287a2e48 | |||
| 3bd9214858 | |||
| 919de4838c | |||
| d7a1778199 | |||
| b03530ed1f | |||
| a520ae7d04 | |||
| 21749f5c82 | |||
| a4c0a271b4 | |||
| 9cc9816440 | |||
| d5ba8fa736 | |||
| c0a7080287 | |||
| 207d0c78f0 | |||
| d81a12352c | |||
| a48748cb9c | |||
| 5b7123131f | |||
| 8ec06e631f | |||
| 5e4ccfd4e8 | |||
| 47f161a211 | |||
| c1949a99b0 | |||
| d0def765a2 | |||
| 5f4d475d84 | |||
| a5c13e325a | |||
| 110dc89e86 | |||
| 2d31bc5ef5 | |||
| 7da643fc8f | |||
| 21aa44cfc4 | |||
| aeb17588b3 | |||
| d28313bca8 | |||
| 27d8a030b1 | |||
| b5208a2b5b | |||
| c959888f0b | |||
| ea3e8f115b | |||
| e49a36e318 | |||
| ae69e4776f | |||
| 5feaa2aaf7 | |||
| ed1b317801 | |||
| 0d3400fb59 | |||
| fd1c294146 | |||
| c3a99f8ae6 | |||
| b433500e04 | |||
| f857223511 | |||
| c331dede3c | |||
| b9e94b94ae | |||
| e28d747418 | |||
| a7c7e51180 | |||
| 3ab9e4184e | |||
| 583dfc6927 | |||
| 3a31188cc1 | |||
| 5de90d5868 | |||
| 76f1b92039 | |||
| 81bfdb7cbd | |||
| 31917d1556 | |||
| ccf95d2af1 | |||
| 5510bf12d2 | |||
| 52ce6815d1 | |||
| 5fa598f636 | |||
| e688b4d4e1 | |||
| 2f0436ff2f | |||
| 6e2ea07986 | |||
| 90b461aa58 | |||
| f71323024c | |||
| 889e64586a | |||
| af66532377 | |||
| 033db30b04 | |||
| bba5387f17 | |||
| 309e3ff4f6 | |||
| 375b88f53e | |||
| 3c6df1fe34 | |||
| 2392a3c22f | |||
| 0f9ef53126 | |||
| 35490dc559 | |||
| d916345d2c | |||
| 57f45c80c6 | |||
| 58ed8242af | |||
| 3bd91b92ee | |||
| 28448b5512 | |||
| 759d4806c0 | |||
| c28e478d5a | |||
| 4bdfe40816 | |||
| e347b26cf6 | |||
| c9ed183891 | |||
| 11a2343a65 | |||
| deaf6983c4 | |||
| 60bcd56672 | |||
| 1a16619522 | |||
| 7584fb8d25 | |||
| dfe85b786e | |||
| 2aa60eaf1f | |||
| 7e948d317c | |||
| 46d65506d5 | |||
| 5d0d2ce7a1 | |||
| 2bf1fa215a | |||
| 4ce7a82db5 | |||
| 76f3890cff | |||
| e4ccf517fa | |||
| 1f68cf0251 | |||
| 4be03b0eaf | |||
| 6264f4b631 | |||
| 496e064caf | |||
| faa7ac69bb | |||
| 9c1ae0d683 | |||
| 014b3a8816 | |||
| 1e608b2aae | |||
| 8dc258ef7d | |||
| 9defe868c0 | |||
| 3fb1f03780 | |||
| 3f3dfdeb1e | |||
| 106743354c | |||
| 11f07d1ce8 | |||
| 4f3858aaaf | |||
| d7196e1207 | |||
| 9c3a761cfa | |||
| 0ae9e0c5c0 | |||
| 6746040362 | |||
| ddfab2a280 | |||
| b0161a4777 | |||
| 2499e2c493 | |||
| 813572f0d2 | |||
| 90dedb7837 | |||
| b7b0e65cc6 | |||
| 96c0e5fb03 | |||
| 32bc75bf50 | |||
| 7f404fff49 | |||
| 48a000aa1a | |||
| 2c54643037 | |||
| a85ffd3cab | |||
| 115e775d1b | |||
| d756dff0e7 | |||
| 9cc1796429 | |||
| eb170017f6 | |||
| 8f130d8d49 | |||
| c652bbe5cd | |||
| ca31185302 | |||
| 21e0e149ac | |||
| 1e50200969 | |||
| cb33a7cdb0 | |||
| fc0f6f1ef0 | |||
| 611ab3b55c | |||
| 1cfcc5ec38 | |||
| dd49236e00 | |||
| 6175d16d6a | |||
| 91367ed065 | |||
| ffc629f28f | |||
| 277f1e0cdb | |||
| 50a006b1b5 | |||
| bbb4d828a0 | |||
| 3b2feb45cf | |||
| 0405db8d80 | |||
| 3d1db25864 | |||
| 1c29287344 | |||
| 699cdc623e | |||
| 810a755702 | |||
| c3473cc626 | |||
| a49526649d | |||
| 1b208f852c | |||
| 1a1d2f9908 | |||
| 0b680be32b | |||
| f2470f3e85 | |||
| 7d9603afd7 | |||
| 8c254a9976 | |||
| 14dec716cf | |||
| aa98123c93 | |||
| da597d838d | |||
| b3fb5dced6 | |||
| 4bf6d3069d | |||
| 28d98b461b | |||
| 99717c61af | |||
| a28ef85698 | |||
| 6f915e5b90 | |||
| db55c527c6 | |||
| 0a3a618091 | |||
| 5ce205c2c0 | |||
| 4f1189c163 | |||
| 97f4193c15 | |||
| dddae1190f | |||
| 9dc7eb2938 | |||
| 8e6ddfb9b7 | |||
| 71fd8591ae | |||
| 20adac9919 | |||
| 77d0f5b8ca | |||
| a6e59c07ff | |||
| 52bc9612ea | |||
| 5a311d3b86 | |||
| e9df244485 | |||
| 604bb83acb | |||
| 5a8d8680c4 | |||
| 9bc7ada4ae | |||
| 0538044fee | |||
| bb3e3929ac | |||
| 9f4fd58577 | |||
| 5c541aa168 | |||
| 3f8fae4873 | |||
| f0ae1be76a | |||
| 90c60c700d | |||
| 6eb3d20b47 | |||
| b3ccdda222 | |||
| eeb9f0b86e | |||
| 58e7cc188a | |||
| ba52ac73da | |||
| d5bd21fc69 | |||
| 27ecb8c389 | |||
| 80aff3afad | |||
| 38f2e9a1cf | |||
| 6e75c4a656 | |||
| ce65290aae | |||
| 1543909566 | |||
| c31119e41f | |||
| c0959fb3e2 |
+20
-66
@@ -14,26 +14,24 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// File gets rendered to .circleci/config.yml via git hook.
|
// File gets rendered to .circleci/config.yml via git hook.
|
||||||
amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.1.0#/PklCI.pkl"
|
amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.1.1#/PklCI.pkl"
|
||||||
|
|
||||||
import "jobs/BuildNativeJob.pkl"
|
import "jobs/BuildNativeJob.pkl"
|
||||||
import "jobs/GradleCheckJob.pkl"
|
import "jobs/GradleCheckJob.pkl"
|
||||||
import "jobs/DeployJob.pkl"
|
import "jobs/DeployJob.pkl"
|
||||||
import "jobs/SimpleGradleJob.pkl"
|
import "jobs/SimpleGradleJob.pkl"
|
||||||
|
|
||||||
local prbJobs: Listing<String> = (gradleCheckJobs.keys.toListing()) {
|
local prbJobs: Listing<String> = gradleCheckJobs.keys.toListing()
|
||||||
"check-patch-file"
|
|
||||||
}
|
|
||||||
|
|
||||||
local buildAndTestJobs = (prbJobs) {
|
local buildAndTestJobs = (prbJobs) {
|
||||||
"bench"
|
"bench"
|
||||||
// "gradle-compatibility"
|
"gradle-compatibility"
|
||||||
...buildNativeJobs.keys.filter((it) -> it.endsWith("snapshot"))
|
...buildNativeJobs.keys.filter((it) -> it.endsWith("snapshot"))
|
||||||
}
|
}
|
||||||
|
|
||||||
local releaseJobs = (prbJobs) {
|
local releaseJobs = (prbJobs) {
|
||||||
"bench"
|
"bench"
|
||||||
// "gradle-compatibility"
|
"gradle-compatibility"
|
||||||
...buildNativeJobs.keys.filter((it) -> it.endsWith("release"))
|
...buildNativeJobs.keys.filter((it) -> it.endsWith("release"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,44 +51,6 @@ main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove me once policy allows these jobs without approval
|
|
||||||
circleCi {
|
|
||||||
workflows {
|
|
||||||
["release-branch"] {
|
|
||||||
jobs = new Listing<*Mapping<String, WorkflowJob>|String> {
|
|
||||||
new {
|
|
||||||
["hold"] {
|
|
||||||
type = "approval"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new {
|
|
||||||
["pr-approval/authenticate"] {
|
|
||||||
context = "pkl-pr-approval"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (job in super.jobs) {
|
|
||||||
job |> requireApproval
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: remove me once policy allows these jobs without approval
|
|
||||||
local requireApproval = (it: String|Mapping<String, WorkflowJob>) ->
|
|
||||||
if (it is String)
|
|
||||||
new Mapping<String, WorkflowJob> {
|
|
||||||
[it] {
|
|
||||||
requires { "hold" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
(it) {
|
|
||||||
[it.keys.first] {
|
|
||||||
requires { "hold" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
release {
|
release {
|
||||||
jobs {
|
jobs {
|
||||||
...releaseJobs
|
...releaseJobs
|
||||||
@@ -136,18 +96,28 @@ local buildNativeJobs: Mapping<String, BuildNativeJob> = new {
|
|||||||
musl = true
|
musl = true
|
||||||
isRelease = _dist == "release"
|
isRelease = _dist == "release"
|
||||||
}
|
}
|
||||||
|
["pkl-cli-windows-amd64-\(_dist)"] {
|
||||||
|
arch = "amd64"
|
||||||
|
os = "windows"
|
||||||
|
isRelease = _dist == "release"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local gradleCheckJobs: Mapping<String, GradleCheckJob> = new {
|
local gradleCheckJobs: Mapping<String, GradleCheckJob> = new {
|
||||||
["gradle-check-jdk11"] {
|
|
||||||
javaVersion = "11.0"
|
|
||||||
isRelease = false
|
|
||||||
}
|
|
||||||
["gradle-check-jdk17"] {
|
["gradle-check-jdk17"] {
|
||||||
javaVersion = "17.0"
|
javaVersion = "17.0"
|
||||||
isRelease = false
|
isRelease = false
|
||||||
}
|
}
|
||||||
|
["gradle-check-jdk21"] {
|
||||||
|
javaVersion = "21.0"
|
||||||
|
isRelease = false
|
||||||
|
}
|
||||||
|
["gradle-check-jdk17-windows"] {
|
||||||
|
javaVersion = "17.0"
|
||||||
|
isRelease = false
|
||||||
|
os = "windows"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jobs {
|
jobs {
|
||||||
@@ -162,8 +132,7 @@ jobs {
|
|||||||
name = "gradle compatibility"
|
name = "gradle compatibility"
|
||||||
command = #"""
|
command = #"""
|
||||||
:pkl-gradle:build \
|
:pkl-gradle:build \
|
||||||
:pkl-gradle:compatibilityTestReleases \
|
:pkl-gradle:compatibilityTestReleases
|
||||||
:pkl-gradle:compatibilityTestCandidate
|
|
||||||
"""#
|
"""#
|
||||||
}.job
|
}.job
|
||||||
["deploy-snapshot"] = new DeployJob { command = "publishToSonatype" }.job
|
["deploy-snapshot"] = new DeployJob { command = "publishToSonatype" }.job
|
||||||
@@ -181,7 +150,7 @@ jobs {
|
|||||||
name = "Publish release on GitHub"
|
name = "Publish release on GitHub"
|
||||||
command = #"""
|
command = #"""
|
||||||
# exclude build_artifacts.txt from publish
|
# exclude build_artifacts.txt from publish
|
||||||
rm pkl-cli/build/executable/*.build_artifacts.txt
|
rm -f pkl-cli/build/executable/*.build_artifacts.txt
|
||||||
gh release create "${CIRCLE_TAG}" \
|
gh release create "${CIRCLE_TAG}" \
|
||||||
--title "${CIRCLE_TAG}" \
|
--title "${CIRCLE_TAG}" \
|
||||||
--target "${CIRCLE_SHA1}" \
|
--target "${CIRCLE_SHA1}" \
|
||||||
@@ -193,19 +162,4 @@ jobs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
["check-patch-file"] {
|
|
||||||
docker {
|
|
||||||
new { image = "cimg/base:current" }
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
"checkout"
|
|
||||||
new RunStep {
|
|
||||||
// language=bash
|
|
||||||
command = #"""
|
|
||||||
git apply --reject patches/graalVm23.patch
|
|
||||||
"""#
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resource_class = "small"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+136
-194
@@ -12,25 +12,19 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:macExecutableAmd64 pkl-core:testMacExecutableAmd64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true pkl-cli:macExecutableAmd64 pkl-core:testMacExecutableAmd64 pkl-server:testMacExecutableAmd64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
resource_class: macos.m1.large.gen1
|
resource_class: macos.m1.large.gen1
|
||||||
macos:
|
macos:
|
||||||
xcode: 15.2.0
|
xcode: 15.3.0
|
||||||
pkl-cli-linux-amd64-release:
|
pkl-cli-linux-amd64-release:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -46,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
# install jdk
|
# install jdk
|
||||||
curl -L \
|
curl -L \
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz -o /tmp/jdk.tar.gz
|
||||||
|
|
||||||
mkdir /jdk \
|
mkdir /jdk \
|
||||||
&& cd /jdk \
|
&& cd /jdk \
|
||||||
@@ -94,18 +88,12 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:linuxExecutableAmd64 pkl-core:testLinuxExecutableAmd64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true pkl-cli:linuxExecutableAmd64 pkl-core:testLinuxExecutableAmd64 pkl-server:testLinuxExecutableAmd64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
@@ -117,30 +105,22 @@ jobs:
|
|||||||
pkl-cli-macOS-aarch64-release:
|
pkl-cli-macOS-aarch64-release:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
|
||||||
command: git apply patches/graalVm23.patch
|
|
||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:macExecutableAarch64 pkl-core:testMacExecutableAarch64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true pkl-cli:macExecutableAarch64 pkl-core:testMacExecutableAarch64 pkl-server:testMacExecutableAarch64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
resource_class: macos.m1.large.gen1
|
resource_class: macos.m1.large.gen1
|
||||||
macos:
|
macos:
|
||||||
xcode: 15.2.0
|
xcode: 15.3.0
|
||||||
pkl-cli-linux-aarch64-release:
|
pkl-cli-linux-aarch64-release:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -156,7 +136,7 @@ jobs:
|
|||||||
|
|
||||||
# install jdk
|
# install jdk
|
||||||
curl -L \
|
curl -L \
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.9_9.tar.gz -o /tmp/jdk.tar.gz
|
||||||
|
|
||||||
mkdir /jdk \
|
mkdir /jdk \
|
||||||
&& cd /jdk \
|
&& cd /jdk \
|
||||||
@@ -188,18 +168,12 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:linuxExecutableAarch64 pkl-core:testLinuxExecutableAarch64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true pkl-cli:linuxExecutableAarch64 pkl-core:testLinuxExecutableAarch64 pkl-server:testLinuxExecutableAarch64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
@@ -223,7 +197,7 @@ jobs:
|
|||||||
|
|
||||||
# install jdk
|
# install jdk
|
||||||
curl -L \
|
curl -L \
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz -o /tmp/jdk.tar.gz
|
||||||
|
|
||||||
mkdir /jdk \
|
mkdir /jdk \
|
||||||
&& cd /jdk \
|
&& cd /jdk \
|
||||||
@@ -271,18 +245,12 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace -DreleaseBuild=true pkl-cli:alpineExecutableAmd64 pkl-core:testAlpineExecutableAmd64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true pkl-cli:alpineExecutableAmd64 pkl-core:testAlpineExecutableAmd64 pkl-server:testAlpineExecutableAmd64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
@@ -291,6 +259,26 @@ jobs:
|
|||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
docker:
|
docker:
|
||||||
- image: oraclelinux:8-slim
|
- image: oraclelinux:8-slim
|
||||||
|
pkl-cli-windows-amd64-release:
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
command: |-
|
||||||
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true pkl-cli:windowsExecutableAmd64 pkl-core:testWindowsExecutableAmd64 pkl-server:testWindowsExecutableAmd64
|
||||||
|
name: gradle buildNative
|
||||||
|
shell: bash.exe
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: '.'
|
||||||
|
paths:
|
||||||
|
- pkl-cli/build/executable/
|
||||||
|
- store_test_results:
|
||||||
|
path: ~/test-results
|
||||||
|
environment:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
resource_class: windows.large
|
||||||
|
machine:
|
||||||
|
image: windows-server-2022-gui:current
|
||||||
pkl-cli-macOS-amd64-snapshot:
|
pkl-cli-macOS-amd64-snapshot:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -300,25 +288,19 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace pkl-cli:macExecutableAmd64 pkl-core:testMacExecutableAmd64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:macExecutableAmd64 pkl-core:testMacExecutableAmd64 pkl-server:testMacExecutableAmd64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
resource_class: macos.m1.large.gen1
|
resource_class: macos.m1.large.gen1
|
||||||
macos:
|
macos:
|
||||||
xcode: 15.2.0
|
xcode: 15.3.0
|
||||||
pkl-cli-linux-amd64-snapshot:
|
pkl-cli-linux-amd64-snapshot:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -334,7 +316,7 @@ jobs:
|
|||||||
|
|
||||||
# install jdk
|
# install jdk
|
||||||
curl -L \
|
curl -L \
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz -o /tmp/jdk.tar.gz
|
||||||
|
|
||||||
mkdir /jdk \
|
mkdir /jdk \
|
||||||
&& cd /jdk \
|
&& cd /jdk \
|
||||||
@@ -382,18 +364,12 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace pkl-cli:linuxExecutableAmd64 pkl-core:testLinuxExecutableAmd64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:linuxExecutableAmd64 pkl-core:testLinuxExecutableAmd64 pkl-server:testLinuxExecutableAmd64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
@@ -405,30 +381,22 @@ jobs:
|
|||||||
pkl-cli-macOS-aarch64-snapshot:
|
pkl-cli-macOS-aarch64-snapshot:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
|
||||||
command: git apply patches/graalVm23.patch
|
|
||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace pkl-cli:macExecutableAarch64 pkl-core:testMacExecutableAarch64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:macExecutableAarch64 pkl-core:testMacExecutableAarch64 pkl-server:testMacExecutableAarch64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
resource_class: macos.m1.large.gen1
|
resource_class: macos.m1.large.gen1
|
||||||
macos:
|
macos:
|
||||||
xcode: 15.2.0
|
xcode: 15.3.0
|
||||||
pkl-cli-linux-aarch64-snapshot:
|
pkl-cli-linux-aarch64-snapshot:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -444,7 +412,7 @@ jobs:
|
|||||||
|
|
||||||
# install jdk
|
# install jdk
|
||||||
curl -L \
|
curl -L \
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.9_9.tar.gz -o /tmp/jdk.tar.gz
|
||||||
|
|
||||||
mkdir /jdk \
|
mkdir /jdk \
|
||||||
&& cd /jdk \
|
&& cd /jdk \
|
||||||
@@ -476,18 +444,12 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace pkl-cli:linuxExecutableAarch64 pkl-core:testLinuxExecutableAarch64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:linuxExecutableAarch64 pkl-core:testLinuxExecutableAarch64 pkl-server:testLinuxExecutableAarch64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
@@ -511,7 +473,7 @@ jobs:
|
|||||||
|
|
||||||
# install jdk
|
# install jdk
|
||||||
curl -L \
|
curl -L \
|
||||||
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.20.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.20.1_1.tar.gz -o /tmp/jdk.tar.gz
|
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz -o /tmp/jdk.tar.gz
|
||||||
|
|
||||||
mkdir /jdk \
|
mkdir /jdk \
|
||||||
&& cd /jdk \
|
&& cd /jdk \
|
||||||
@@ -559,18 +521,12 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew --info --stacktrace pkl-cli:alpineExecutableAmd64 pkl-core:testAlpineExecutableAmd64
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:alpineExecutableAmd64 pkl-core:testAlpineExecutableAmd64 pkl-server:testAlpineExecutableAmd64
|
||||||
name: gradle buildNative
|
name: gradle buildNative
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
@@ -579,127 +535,123 @@ jobs:
|
|||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
docker:
|
docker:
|
||||||
- image: oraclelinux:8-slim
|
- image: oraclelinux:8-slim
|
||||||
gradle-check-jdk11:
|
pkl-cli-windows-amd64-snapshot:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
|
||||||
command: ./gradlew --info --stacktrace check
|
|
||||||
name: gradle check
|
|
||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
mkdir ~/test-results/
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:windowsExecutableAmd64 pkl-core:testWindowsExecutableAmd64 pkl-server:testWindowsExecutableAmd64
|
||||||
name: Gather test results
|
name: gradle buildNative
|
||||||
when: always
|
shell: bash.exe
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: '.'
|
||||||
|
paths:
|
||||||
|
- pkl-cli/build/executable/
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
docker:
|
resource_class: windows.large
|
||||||
- image: cimg/openjdk:11.0
|
machine:
|
||||||
|
image: windows-server-2022-gui:current
|
||||||
gradle-check-jdk17:
|
gradle-check-jdk17:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
command: ./gradlew --info --stacktrace check
|
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results check
|
||||||
name: gradle check
|
name: gradle check
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:17.0
|
- image: cimg/openjdk:17.0
|
||||||
bench:
|
gradle-check-jdk21:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
command: ./gradlew --info --stacktrace bench:jmh
|
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results check
|
||||||
name: bench:jmh
|
name: gradle check
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:11.0
|
- image: cimg/openjdk:21.0
|
||||||
|
gradle-check-jdk17-windows:
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results check
|
||||||
|
name: gradle check
|
||||||
|
- store_test_results:
|
||||||
|
path: ~/test-results
|
||||||
|
environment:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
resource_class: windows.large
|
||||||
|
machine:
|
||||||
|
image: windows-server-2022-gui:current
|
||||||
|
bench:
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results bench:jmh
|
||||||
|
name: bench:jmh
|
||||||
|
- store_test_results:
|
||||||
|
path: ~/test-results
|
||||||
|
environment:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
docker:
|
||||||
|
- image: cimg/openjdk:17.0
|
||||||
gradle-compatibility:
|
gradle-compatibility:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
./gradlew --info --stacktrace :pkl-gradle:build \
|
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results :pkl-gradle:build \
|
||||||
:pkl-gradle:compatibilityTestReleases \
|
:pkl-gradle:compatibilityTestReleases
|
||||||
:pkl-gradle:compatibilityTestCandidate
|
|
||||||
name: gradle compatibility
|
name: gradle compatibility
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:11.0
|
- image: cimg/openjdk:17.0
|
||||||
deploy-snapshot:
|
deploy-snapshot:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '.'
|
at: '.'
|
||||||
- run:
|
- run:
|
||||||
command: ./gradlew --info --stacktrace publishToSonatype
|
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results publishToSonatype
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:11.0
|
- image: cimg/openjdk:17.0
|
||||||
deploy-release:
|
deploy-release:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '.'
|
at: '.'
|
||||||
- run:
|
- run:
|
||||||
command: ./gradlew --info --stacktrace -DreleaseBuild=true publishToSonatype closeAndReleaseSonatypeStagingRepository
|
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: '.'
|
root: '.'
|
||||||
paths:
|
paths:
|
||||||
- pkl-cli/build/executable/
|
- pkl-cli/build/executable/
|
||||||
- run:
|
|
||||||
command: |-
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \;
|
|
||||||
name: Gather test results
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/test-results
|
path: ~/test-results
|
||||||
environment:
|
environment:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:11.0
|
- image: cimg/openjdk:17.0
|
||||||
github-release:
|
github-release:
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -707,7 +659,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
command: |-
|
command: |-
|
||||||
# exclude build_artifacts.txt from publish
|
# exclude build_artifacts.txt from publish
|
||||||
rm pkl-cli/build/executable/*.build_artifacts.txt
|
rm -f pkl-cli/build/executable/*.build_artifacts.txt
|
||||||
gh release create "${CIRCLE_TAG}" \
|
gh release create "${CIRCLE_TAG}" \
|
||||||
--title "${CIRCLE_TAG}" \
|
--title "${CIRCLE_TAG}" \
|
||||||
--target "${CIRCLE_SHA1}" \
|
--target "${CIRCLE_SHA1}" \
|
||||||
@@ -718,14 +670,6 @@ jobs:
|
|||||||
name: Publish release on GitHub
|
name: Publish release on GitHub
|
||||||
docker:
|
docker:
|
||||||
- image: maniator/gh:v2.40.1
|
- image: maniator/gh:v2.40.1
|
||||||
check-patch-file:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: git apply --reject patches/graalVm23.patch
|
|
||||||
resource_class: small
|
|
||||||
docker:
|
|
||||||
- image: cimg/base:current
|
|
||||||
trigger-docsite-build:
|
trigger-docsite-build:
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
@@ -759,13 +703,13 @@ workflows:
|
|||||||
type: approval
|
type: approval
|
||||||
- pr-approval/authenticate:
|
- pr-approval/authenticate:
|
||||||
context: pkl-pr-approval
|
context: pkl-pr-approval
|
||||||
- gradle-check-jdk11:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- gradle-check-jdk17:
|
- gradle-check-jdk17:
|
||||||
requires:
|
requires:
|
||||||
- hold
|
- hold
|
||||||
- check-patch-file:
|
- gradle-check-jdk21:
|
||||||
|
requires:
|
||||||
|
- hold
|
||||||
|
- gradle-check-jdk17-windows:
|
||||||
requires:
|
requires:
|
||||||
- hold
|
- hold
|
||||||
when:
|
when:
|
||||||
@@ -774,26 +718,30 @@ workflows:
|
|||||||
pattern: ^pull/\d+(/head)?$
|
pattern: ^pull/\d+(/head)?$
|
||||||
main:
|
main:
|
||||||
jobs:
|
jobs:
|
||||||
- gradle-check-jdk11
|
|
||||||
- gradle-check-jdk17
|
- gradle-check-jdk17
|
||||||
- check-patch-file
|
- gradle-check-jdk21
|
||||||
|
- gradle-check-jdk17-windows
|
||||||
- bench
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
- pkl-cli-macOS-amd64-snapshot
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
- pkl-cli-linux-amd64-snapshot
|
- pkl-cli-linux-amd64-snapshot
|
||||||
- pkl-cli-macOS-aarch64-snapshot
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
- pkl-cli-linux-aarch64-snapshot
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
- pkl-cli-linux-alpine-amd64-snapshot
|
- pkl-cli-linux-alpine-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
- deploy-snapshot:
|
- deploy-snapshot:
|
||||||
requires:
|
requires:
|
||||||
- gradle-check-jdk11
|
|
||||||
- gradle-check-jdk17
|
- gradle-check-jdk17
|
||||||
- check-patch-file
|
- gradle-check-jdk21
|
||||||
|
- gradle-check-jdk17-windows
|
||||||
- bench
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
- pkl-cli-macOS-amd64-snapshot
|
- pkl-cli-macOS-amd64-snapshot
|
||||||
- pkl-cli-linux-amd64-snapshot
|
- pkl-cli-linux-amd64-snapshot
|
||||||
- pkl-cli-macOS-aarch64-snapshot
|
- pkl-cli-macOS-aarch64-snapshot
|
||||||
- pkl-cli-linux-aarch64-snapshot
|
- pkl-cli-linux-aarch64-snapshot
|
||||||
- pkl-cli-linux-alpine-amd64-snapshot
|
- pkl-cli-linux-alpine-amd64-snapshot
|
||||||
|
- pkl-cli-windows-amd64-snapshot
|
||||||
context: pkl-maven-release
|
context: pkl-maven-release
|
||||||
- trigger-docsite-build:
|
- trigger-docsite-build:
|
||||||
requires:
|
requires:
|
||||||
@@ -806,19 +754,19 @@ workflows:
|
|||||||
- << pipeline.git.branch >>
|
- << pipeline.git.branch >>
|
||||||
release:
|
release:
|
||||||
jobs:
|
jobs:
|
||||||
- gradle-check-jdk11:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
tags:
|
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
|
||||||
- gradle-check-jdk17:
|
- gradle-check-jdk17:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
tags:
|
tags:
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
- check-patch-file:
|
- gradle-check-jdk21:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
|
tags:
|
||||||
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
|
- gradle-check-jdk17-windows:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
@@ -830,6 +778,12 @@ workflows:
|
|||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
tags:
|
tags:
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
|
- gradle-compatibility:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
|
tags:
|
||||||
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
- pkl-cli-macOS-amd64-release:
|
- pkl-cli-macOS-amd64-release:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -860,17 +814,25 @@ workflows:
|
|||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
tags:
|
tags:
|
||||||
only: /^v?\d+\.\d+\.\d+$/
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
|
- pkl-cli-windows-amd64-release:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
|
tags:
|
||||||
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
- github-release:
|
- github-release:
|
||||||
requires:
|
requires:
|
||||||
- gradle-check-jdk11
|
|
||||||
- gradle-check-jdk17
|
- gradle-check-jdk17
|
||||||
- check-patch-file
|
- gradle-check-jdk21
|
||||||
|
- gradle-check-jdk17-windows
|
||||||
- bench
|
- bench
|
||||||
|
- gradle-compatibility
|
||||||
- pkl-cli-macOS-amd64-release
|
- pkl-cli-macOS-amd64-release
|
||||||
- pkl-cli-linux-amd64-release
|
- pkl-cli-linux-amd64-release
|
||||||
- pkl-cli-macOS-aarch64-release
|
- pkl-cli-macOS-aarch64-release
|
||||||
- pkl-cli-linux-aarch64-release
|
- pkl-cli-linux-aarch64-release
|
||||||
- pkl-cli-linux-alpine-amd64-release
|
- pkl-cli-linux-alpine-amd64-release
|
||||||
|
- pkl-cli-windows-amd64-release
|
||||||
context: pkl-github-release
|
context: pkl-github-release
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -898,37 +860,17 @@ workflows:
|
|||||||
only: /^v?\d+\.\d+\.\d+$/
|
only: /^v?\d+\.\d+\.\d+$/
|
||||||
release-branch:
|
release-branch:
|
||||||
jobs:
|
jobs:
|
||||||
- hold:
|
- gradle-check-jdk17
|
||||||
type: approval
|
- gradle-check-jdk21
|
||||||
- pr-approval/authenticate:
|
- gradle-check-jdk17-windows
|
||||||
context: pkl-pr-approval
|
- bench
|
||||||
- gradle-check-jdk11:
|
- gradle-compatibility
|
||||||
requires:
|
- pkl-cli-macOS-amd64-release
|
||||||
- hold
|
- pkl-cli-linux-amd64-release
|
||||||
- gradle-check-jdk17:
|
- pkl-cli-macOS-aarch64-release
|
||||||
requires:
|
- pkl-cli-linux-aarch64-release
|
||||||
- hold
|
- pkl-cli-linux-alpine-amd64-release
|
||||||
- check-patch-file:
|
- pkl-cli-windows-amd64-release
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- bench:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-macOS-amd64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-linux-amd64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-macOS-aarch64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-linux-aarch64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
- pkl-cli-linux-alpine-amd64-release:
|
|
||||||
requires:
|
|
||||||
- hold
|
|
||||||
when:
|
when:
|
||||||
matches:
|
matches:
|
||||||
value: << pipeline.git.branch >>
|
value: << pipeline.git.branch >>
|
||||||
|
|||||||
@@ -16,12 +16,9 @@
|
|||||||
/// Builds the native `pkl` CLI
|
/// Builds the native `pkl` CLI
|
||||||
extends "GradleJob.pkl"
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.2#/Config.pkl"
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.uri@1.0.0#/URI.pkl"
|
import "package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.uri@1.0.0#/URI.pkl"
|
||||||
|
|
||||||
/// The OS to run on
|
|
||||||
os: "macOS"|"linux"
|
|
||||||
|
|
||||||
/// The architecture to use
|
/// The architecture to use
|
||||||
arch: "amd64"|"aarch64"
|
arch: "amd64"|"aarch64"
|
||||||
|
|
||||||
@@ -29,7 +26,7 @@ arch: "amd64"|"aarch64"
|
|||||||
musl: Boolean = false
|
musl: Boolean = false
|
||||||
|
|
||||||
local setupLinuxEnvironment: Config.RunStep =
|
local setupLinuxEnvironment: Config.RunStep =
|
||||||
let (jdkVersion = "11.0.20.1+1")
|
let (jdkVersion = "17.0.9+9")
|
||||||
let (muslVersion = "1.2.2")
|
let (muslVersion = "1.2.2")
|
||||||
let (zlibVersion = "1.2.13")
|
let (zlibVersion = "1.2.13")
|
||||||
let (jdkVersionEncoded = URI.encodeComponent(jdkVersion))
|
let (jdkVersionEncoded = URI.encodeComponent(jdkVersion))
|
||||||
@@ -116,24 +113,20 @@ steps {
|
|||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If building macOS/aarch64, we need to use GraalVM 23.
|
|
||||||
// We can't use GraalVM 23 for any other build because we need to support Java 11, which was
|
|
||||||
// dropped in GraalVM 23.
|
|
||||||
when (os == "macOS" && arch == "aarch64") {
|
|
||||||
new Config.RunStep {
|
|
||||||
command = "git apply patches/graalVm23.patch"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new Config.RunStep {
|
new Config.RunStep {
|
||||||
name = "gradle buildNative"
|
name = "gradle buildNative"
|
||||||
local _os =
|
local _os =
|
||||||
if (os == "macOS") "mac"
|
if (module.os == "macOS") "mac"
|
||||||
else if (musl) "alpine"
|
else if (musl) "alpine"
|
||||||
|
else if (module.os == "windows") "windows"
|
||||||
else "linux"
|
else "linux"
|
||||||
local jobName = "\(_os)Executable\(arch.capitalize())"
|
local jobName = "\(_os)Executable\(arch.capitalize())"
|
||||||
|
when (module.os == "windows") {
|
||||||
|
shell = "bash.exe"
|
||||||
|
}
|
||||||
command = #"""
|
command = #"""
|
||||||
export PATH=~/staticdeps/bin:$PATH
|
export PATH=~/staticdeps/bin:$PATH
|
||||||
./gradlew \#(module.gradleArgs) pkl-cli:\#(jobName) pkl-core:test\#(jobName.capitalize())
|
./gradlew \#(module.gradleArgs) pkl-cli:\#(jobName) pkl-core:test\#(jobName.capitalize()) pkl-server:test\#(jobName.capitalize())
|
||||||
"""#
|
"""#
|
||||||
}
|
}
|
||||||
new Config.PersistToWorkspaceStep {
|
new Config.PersistToWorkspaceStep {
|
||||||
@@ -147,12 +140,11 @@ steps {
|
|||||||
job {
|
job {
|
||||||
when (os == "macOS") {
|
when (os == "macOS") {
|
||||||
macos {
|
macos {
|
||||||
xcode = "15.2.0"
|
xcode = "15.3.0"
|
||||||
}
|
}
|
||||||
// Use M1 for all architectures. We build amd64/aarch64 based on the GraalVM version,
|
|
||||||
// which gets patched in via `git apply patches/graalVm23.patch`.
|
|
||||||
resource_class = "macos.m1.large.gen1"
|
resource_class = "macos.m1.large.gen1"
|
||||||
} else {
|
}
|
||||||
|
when (os == "linux") {
|
||||||
docker {
|
docker {
|
||||||
new {
|
new {
|
||||||
image = if (arch == "aarch64") "arm64v8/oraclelinux:8-slim" else "oraclelinux:8-slim"
|
image = if (arch == "aarch64") "arm64v8/oraclelinux:8-slim" else "oraclelinux:8-slim"
|
||||||
@@ -163,4 +155,10 @@ job {
|
|||||||
}
|
}
|
||||||
resource_class = if (arch == "aarch64") "arm.xlarge" else "xlarge"
|
resource_class = if (arch == "aarch64") "arm.xlarge" else "xlarge"
|
||||||
}
|
}
|
||||||
|
when (os == "windows") {
|
||||||
|
machine {
|
||||||
|
image = "windows-server-2022-gui:current"
|
||||||
|
}
|
||||||
|
resource_class = "windows.large"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
extends "GradleJob.pkl"
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.2#/Config.pkl"
|
||||||
|
|
||||||
local self = this
|
local self = this
|
||||||
|
|
||||||
@@ -23,10 +23,12 @@ command: String
|
|||||||
|
|
||||||
job {
|
job {
|
||||||
docker {
|
docker {
|
||||||
new { image = "cimg/openjdk:11.0" }
|
new { image = "cimg/openjdk:17.0" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os = "linux"
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
new Config.AttachWorkspaceStep { at = "." }
|
new Config.AttachWorkspaceStep { at = "." }
|
||||||
new Config.RunStep {
|
new Config.RunStep {
|
||||||
|
|||||||
@@ -15,9 +15,11 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
extends "GradleJob.pkl"
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.2#/Config.pkl"
|
||||||
|
|
||||||
javaVersion: "11.0"|"17.0"
|
javaVersion: "17.0"|"21.0"
|
||||||
|
|
||||||
|
os = "linux"
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
new Config.RunStep {
|
new Config.RunStep {
|
||||||
@@ -27,9 +29,17 @@ steps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
job {
|
job {
|
||||||
docker {
|
when (os == "linux") {
|
||||||
new {
|
docker {
|
||||||
image = "cimg/openjdk:\(javaVersion)"
|
new {
|
||||||
|
image = "cimg/openjdk:\(javaVersion)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
when (os == "windows") {
|
||||||
|
machine {
|
||||||
|
image = "windows-server-2022-gui:current"
|
||||||
|
}
|
||||||
|
resource_class = "windows.large"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,14 +15,18 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
abstract module GradleJob
|
abstract module GradleJob
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.2#/Config.pkl"
|
||||||
|
|
||||||
/// Whether this is a release build or not.
|
/// Whether this is a release build or not.
|
||||||
isRelease: Boolean = false
|
isRelease: Boolean = false
|
||||||
|
|
||||||
|
/// The OS to run on
|
||||||
|
os: "macOS"|"linux"|"windows"
|
||||||
|
|
||||||
fixed gradleArgs = new Listing {
|
fixed gradleArgs = new Listing {
|
||||||
"--info"
|
"--info"
|
||||||
"--stacktrace"
|
"--stacktrace"
|
||||||
|
"-DtestReportsDir=${HOME}/test-results"
|
||||||
when (isRelease) {
|
when (isRelease) {
|
||||||
"-DreleaseBuild=true"
|
"-DreleaseBuild=true"
|
||||||
}
|
}
|
||||||
@@ -37,15 +41,6 @@ job: Config.Job = new {
|
|||||||
steps {
|
steps {
|
||||||
"checkout"
|
"checkout"
|
||||||
...module.steps
|
...module.steps
|
||||||
new Config.RunStep {
|
|
||||||
// find all test results and write them to the home dir
|
|
||||||
name = "Gather test results"
|
|
||||||
command = """
|
|
||||||
mkdir ~/test-results/
|
|
||||||
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/ \\;
|
|
||||||
"""
|
|
||||||
`when` = "always"
|
|
||||||
}
|
|
||||||
new Config.StoreTestResults {
|
new Config.StoreTestResults {
|
||||||
path = "~/test-results"
|
path = "~/test-results"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,14 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
extends "GradleJob.pkl"
|
extends "GradleJob.pkl"
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.0#/Config.pkl"
|
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.2#/Config.pkl"
|
||||||
|
|
||||||
name: String = command
|
name: String = command
|
||||||
|
|
||||||
command: String
|
command: String
|
||||||
|
|
||||||
|
os = "linux"
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
new Config.RunStep {
|
new Config.RunStep {
|
||||||
name = module.name
|
name = module.name
|
||||||
@@ -32,6 +34,6 @@ steps {
|
|||||||
|
|
||||||
job {
|
job {
|
||||||
docker {
|
docker {
|
||||||
new { image = "cimg/openjdk:11.0" }
|
new { image = "cimg/openjdk:17.0" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-1
@@ -3,4 +3,14 @@
|
|||||||
|
|
||||||
/docs/** linguist-documentation
|
/docs/** linguist-documentation
|
||||||
|
|
||||||
*.pkl linguist-language=Groovy
|
*.pcf linguist-language=Pkl
|
||||||
|
PklProject linguist-language=Pkl
|
||||||
|
|
||||||
|
* text eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
|
||||||
|
*.gif binary
|
||||||
|
*.jar binary
|
||||||
|
*.woff2 binary
|
||||||
|
*.pem binary
|
||||||
|
*.png binary
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ generated/
|
|||||||
|
|
||||||
# IntelliJ
|
# IntelliJ
|
||||||
.idea/
|
.idea/
|
||||||
|
!.idea/icon.svg
|
||||||
!.idea/codestyles/
|
!.idea/codestyles/
|
||||||
!.idea/inspectionProfiles/
|
!.idea/inspectionProfiles/
|
||||||
!.idea/runConfigurations/
|
!.idea/runConfigurations/
|
||||||
|
|||||||
Generated
+23
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100.58 98.63">
|
||||||
|
<path d="m75.57,19.78l2.43-13.25c-3.69-2.46-7.7-4.42-11.91-5.83l-8.97,10.05c-4.37-.8-8.85-.83-13.23-.08L35.03.5c-4.23,1.35-8.26,3.26-11.99,5.68l2.26,13.28c-3.35,2.92-6.17,6.4-8.32,10.3l-13.46.58c-1.58,4.15-2.6,8.49-3.03,12.91l11.8,6.51c.19,4.44,1.16,8.81,2.86,12.92l-7.94,10.89c2.26,3.82,5.02,7.33,8.2,10.42l12.45-5.16c3.59,2.62,7.62,4.59,11.89,5.82l3.56,13c4.4.62,8.86.64,13.26.08l3.72-12.95c4.29-1.17,8.34-3.09,11.96-5.67l12.38,5.32c3.22-3.05,6.03-6.52,8.33-10.32l-7.8-10.99c1.75-4.08,2.78-8.45,3.03-12.88l11.88-6.36c-.38-4.42-1.34-8.78-2.87-12.95l-13.45-.75c-2.1-3.92-4.87-7.44-8.19-10.4Z"
|
||||||
|
style="fill:#6b9543; stroke-width:0px;"/>
|
||||||
|
<circle cx="51.05" cy="47.72" r="31.49" style="fill:#e9f4ca; stroke-width:0px;"/>
|
||||||
|
<g id="_Radial_Repeat_">
|
||||||
|
<path d="m28.79,62.54c8.22,14.22,24.82,18.97,20.85-10.47h0c-.31-2.29-1.56-4.35-3.45-5.68-24.66-17.36-26.37.64-17.4,16.15Zm15.42-8.25h0c.7-.17,1.24.13,1.49.83,3.27,9.16-2.6,12.49-6.71,10.44-3.77-1.88-3.77-9.01,5.22-11.27Zm-2.14-5.45c.48.57.47,1.19-.03,1.7h0c-6.44,6.67-12.62,3.1-12.37-1.09.27-4.58,6.09-8.01,12.4-.61Z"
|
||||||
|
style="fill:#c8d987; stroke-width:0px;"/>
|
||||||
|
<ellipse cx="38.62" cy="55.01" rx="7.64" ry="14.03" transform="translate(-22.33 26.68) rotate(-30)"
|
||||||
|
style="fill:#c8d987; stroke-width:0px;"/>
|
||||||
|
</g>
|
||||||
|
<g id="_Radial_Repeat_-2">
|
||||||
|
<path d="m49.34,21.03c-16.42.01-28.84,12.01-1.36,23.29h0c2.14.88,4.54.82,6.64-.15,27.37-12.67,12.63-23.16-5.29-23.15Zm-.56,17.48h0c-.2.69-.73,1.01-1.46.88-9.57-1.75-9.52-8.5-5.69-11.03,3.51-2.32,9.69,1.24,7.15,10.16Zm5.79.87c-.73.13-1.27-.18-1.46-.88h0c-2.56-8.91,3.62-12.48,7.13-10.17,3.83,2.53,3.9,9.28-5.67,11.04Z"
|
||||||
|
style="fill:#c8d987; stroke-width:0px;"/>
|
||||||
|
<ellipse cx="50.94" cy="33.31" rx="14.03" ry="7.64" style="fill:#c8d987; stroke-width:0px;"/>
|
||||||
|
</g>
|
||||||
|
<g id="_Radial_Repeat_-3">
|
||||||
|
<path d="m75.02,59.59c8.2-14.23,4.02-30.98-19.5-12.82h0c-1.83,1.41-2.99,3.52-3.19,5.83-2.71,30.04,13.74,22.52,22.69,7Zm-14.86-9.23h0c-.5-.52-.51-1.14-.03-1.7,6.3-7.41,12.12-3.99,12.4.59.26,4.2-5.92,7.77-12.37,1.11Zm-3.65,4.58c.25-.7.79-1,1.49-.83h0c8.99,2.24,9,9.38,5.24,11.26-4.1,2.05-9.98-1.26-6.73-10.43Z"
|
||||||
|
style="fill:#c8d987; stroke-width:0px;"/>
|
||||||
|
<ellipse cx="63.58" cy="54.83" rx="14.03" ry="7.64" transform="translate(-15.7 82.48) rotate(-60)"
|
||||||
|
style="fill:#c8d987; stroke-width:0px;"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
+31
@@ -15,6 +15,37 @@
|
|||||||
<inspection_tool class="FieldMayBeFinal" enabled="true" level="INFORMATION" enabled_by_default="true">
|
<inspection_tool class="FieldMayBeFinal" enabled="true" level="INFORMATION" enabled_by_default="true">
|
||||||
<scope name="AllExceptTruffleAst" level="WARNING" enabled="true" />
|
<scope name="AllExceptTruffleAst" level="WARNING" enabled="true" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
|
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredUrls">
|
||||||
|
<list>
|
||||||
|
<option value="http://" />
|
||||||
|
<option value="http://0.0.0.0" />
|
||||||
|
<option value="http://127.0.0.1" />
|
||||||
|
<option value="http://activemq.apache.org/schema/" />
|
||||||
|
<option value="http://cxf.apache.org/schemas/" />
|
||||||
|
<option value="http://java.sun.com/" />
|
||||||
|
<option value="http://javafx.com/fxml" />
|
||||||
|
<option value="http://javafx.com/javafx/" />
|
||||||
|
<option value="http://json-schema.org/draft" />
|
||||||
|
<option value="http://localhost" />
|
||||||
|
<option value="http://maven.apache.org/POM/" />
|
||||||
|
<option value="http://maven.apache.org/xsd/" />
|
||||||
|
<option value="http://primefaces.org/ui" />
|
||||||
|
<option value="http://schema.cloudfoundry.org/spring/" />
|
||||||
|
<option value="http://schemas.xmlsoap.org/" />
|
||||||
|
<option value="http://tiles.apache.org/" />
|
||||||
|
<option value="http://www.ibm.com/webservices/xsd" />
|
||||||
|
<option value="http://www.jboss.com/xml/ns/" />
|
||||||
|
<option value="http://www.jboss.org/j2ee/schema/" />
|
||||||
|
<option value="http://www.springframework.org/schema/" />
|
||||||
|
<option value="http://www.springframework.org/security/tags" />
|
||||||
|
<option value="http://www.springframework.org/tags" />
|
||||||
|
<option value="http://www.thymeleaf.org" />
|
||||||
|
<option value="http://www.w3.org/" />
|
||||||
|
<option value="http://xmlns.jcp.org/" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
<inspection_tool class="JavadocBlankLines" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="JavadocBlankLines" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="NullableProblems" enabled="true" level="WARNING" enabled_by_default="false">
|
<inspection_tool class="NullableProblems" enabled="true" level="WARNING" enabled_by_default="false">
|
||||||
<scope name="AllExceptGenerated" level="WARNING" enabled="true">
|
<scope name="AllExceptGenerated" level="WARNING" enabled="true">
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
<component name="DependencyValidationManager">
|
<component name="DependencyValidationManager">
|
||||||
<scope name="AllExceptTruffleAst" pattern="(src:*..*||test:*..*||lib:*..*)&&!src[pkl.pkl-core.main]:com.apple.pkl.core.ast..*&&!src[pkl.pkl-core.main]:com.apple.pkl.core.stdlib..*Nodes" />
|
<scope name="AllExceptTruffleAst" pattern="(src:*..*||test:*..*||lib:*..*)&&!src[pkl.pkl-core.main]:org.pkl.core.ast..*&&!src[pkl.pkl-core.main]:org.pkl.core.stdlib..*Nodes" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
== Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
=== Our Pledge
|
### Our Pledge
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
contributors and maintainers pledge to making participation in our
|
contributors and maintainers pledge to making participation in our
|
||||||
@@ -10,7 +10,7 @@ characteristics, gender identity and expression, level of experience,
|
|||||||
education, socio-economic status, nationality, personal appearance,
|
education, socio-economic status, nationality, personal appearance,
|
||||||
race, religion, or sexual identity and orientation.
|
race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
=== Our Standards
|
### Our Standards
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment
|
||||||
include:
|
include:
|
||||||
@@ -33,7 +33,7 @@ electronic address, without explicit permission
|
|||||||
* Other conduct which could reasonably be considered inappropriate in a
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
=== Our Responsibilities
|
### Our Responsibilities
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of
|
Project maintainers are responsible for clarifying the standards of
|
||||||
acceptable behavior and are expected to take appropriate and fair
|
acceptable behavior and are expected to take appropriate and fair
|
||||||
@@ -45,7 +45,7 @@ contributions that are not aligned to this Code of Conduct, or to ban
|
|||||||
temporarily or permanently any contributor for other behaviors that they
|
temporarily or permanently any contributor for other behaviors that they
|
||||||
deem inappropriate, threatening, offensive, or harmful.
|
deem inappropriate, threatening, offensive, or harmful.
|
||||||
|
|
||||||
=== Scope
|
### Scope
|
||||||
|
|
||||||
This Code of Conduct applies within all project spaces, and it also
|
This Code of Conduct applies within all project spaces, and it also
|
||||||
applies when an individual is representing the project or its community
|
applies when an individual is representing the project or its community
|
||||||
@@ -55,7 +55,7 @@ official social media account, or acting as an appointed representative
|
|||||||
at an online or offline event. Representation of a project may be
|
at an online or offline event. Representation of a project may be
|
||||||
further defined and clarified by project maintainers.
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
=== Enforcement
|
### Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may
|
Instances of abusive, harassing, or otherwise unacceptable behavior may
|
||||||
be reported by contacting the open source team at
|
be reported by contacting the open source team at
|
||||||
@@ -70,9 +70,8 @@ Project maintainers who do not follow or enforce the Code of Conduct in
|
|||||||
good faith may face temporary or permanent repercussions as determined
|
good faith may face temporary or permanent repercussions as determined
|
||||||
by other members of the project’s leadership.
|
by other members of the project’s leadership.
|
||||||
|
|
||||||
=== Attribution
|
### Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the
|
This Code of Conduct is adapted from the
|
||||||
https://www.contributor-covenant.org[Contributor Covenant], version 1.4,
|
[Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
|
||||||
available at
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
||||||
+20
-8
@@ -2,12 +2,11 @@
|
|||||||
:uri-gng: https://gng.dsun.org
|
:uri-gng: https://gng.dsun.org
|
||||||
:uri-jenv: https://www.jenv.be
|
:uri-jenv: https://www.jenv.be
|
||||||
:uri-intellij: https://www.jetbrains.com/idea/download/
|
:uri-intellij: https://www.jetbrains.com/idea/download/
|
||||||
:uri-jdk: https://adoptopenjdk.net/releases.html
|
:uri-jdk: https://adoptopenjdk.net/releases.html?variant=openjdk17
|
||||||
|
|
||||||
== Setup
|
== Setup
|
||||||
|
|
||||||
. (mandatory) Install {uri-jdk}[OpenJDK 11 HotSpot] (as long as we support JDK11)
|
. (mandatory) Install {uri-jdk}[OpenJDK 17] or higher
|
||||||
. (mandatory) Setup Gradle on your system
|
|
||||||
. (recommended) Install {uri-intellij}[IntelliJ IDEA 2023.x] +
|
. (recommended) Install {uri-intellij}[IntelliJ IDEA 2023.x] +
|
||||||
To import the project into IntelliJ, go to File->Open and select the project's root directory.
|
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
|
If the project is opened but not imported, look for a popup in the lower right corner
|
||||||
@@ -29,14 +28,19 @@ jenv enable-plugin export
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
----
|
----
|
||||||
gw clean
|
gw clean
|
||||||
gw test
|
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 build # build everything except native executables
|
||||||
gw buildNative # build macOS executable on macOS,
|
gw buildNative # build macOS executable on macOS,
|
||||||
# Linux and Alpine executables on Linux
|
# Linux and Alpine executables on Linux
|
||||||
gw pkldoc # generate standard library docs
|
# (Alpine executable is only built if ~/staticdeps/bin/musl-gcc exists)
|
||||||
|
|
||||||
pkl-cli/build/executable/jpkl # run Java executable
|
pkl-cli/build/executable/jpkl # run Java executable
|
||||||
pkl-cli/build/executable/pkl-macos-amd64 # run Mac 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
|
||||||
----
|
----
|
||||||
|
|
||||||
== Update Gradle
|
== Update Gradle
|
||||||
@@ -65,11 +69,19 @@ based on version information from https://search.maven.org, https://plugins.grad
|
|||||||
* ANTLR code generation is performed by task `:pkl-core:generateGrammarSource`
|
* ANTLR code generation is performed by task `:pkl-core:generateGrammarSource`
|
||||||
** Output dir is `generated/antlr/`
|
** Output dir is `generated/antlr/`
|
||||||
|
|
||||||
|
== Remote JVM Debugging
|
||||||
|
|
||||||
|
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`
|
||||||
|
|
||||||
== Resources
|
== Resources
|
||||||
|
For automated build setup examples see our https://github.com/apple/pkl/blob/main/.circleci/[CircleCI] jobs like our https://github.com/apple/pkl/blob/main/.circleci/jobs/BuildNativeJob.pkl[BuildNativeJob.pkl], where we build Pkl automatically.
|
||||||
|
|
||||||
=== ANTLR
|
=== ANTLR
|
||||||
|
|
||||||
* https://github.com/antlr/antlr4/blob/main/doc/index.md[Documentation]
|
* https://github.com/antlr/antlr4/blob/master/doc/index.md[Documentation]
|
||||||
* https://groups.google.com/forum/#!forum/antlr-discussion[Forums]
|
* https://groups.google.com/forum/#!forum/antlr-discussion[Forums]
|
||||||
* https://github.com/mobileink/lab.clj.antlr/tree/main/doc[Some third-party docs]
|
* https://github.com/mobileink/lab.clj.antlr/tree/main/doc[Some third-party docs]
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -1,4 +1,4 @@
|
|||||||
= Pkl
|
= image:.idea/icon.svg[Pkl,30] Pkl
|
||||||
|
|
||||||
:uri-homepage: https://pkl-lang.org
|
:uri-homepage: https://pkl-lang.org
|
||||||
:uri-docs: {uri-homepage}/main/current
|
:uri-docs: {uri-homepage}/main/current
|
||||||
@@ -11,6 +11,8 @@
|
|||||||
:uri-pkl-examples: https://pkl-lang.org/main/current/examples.html
|
:uri-pkl-examples: https://pkl-lang.org/main/current/examples.html
|
||||||
:uri-installation: https://pkl-lang.org/main/current/pkl-cli/index.html#installation
|
:uri-installation: https://pkl-lang.org/main/current/pkl-cli/index.html#installation
|
||||||
:uri-lang-reference: https://pkl-lang.org/main/current/language-reference/index.html
|
:uri-lang-reference: https://pkl-lang.org/main/current/language-reference/index.html
|
||||||
|
:uri-ci-artifacts: https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/
|
||||||
|
:uri-ci-pipeline: https://app.circleci.com/pipelines/github/apple/pkl
|
||||||
|
|
||||||
A configuration as code language with rich validation and tooling.
|
A configuration as code language with rich validation and tooling.
|
||||||
|
|
||||||
@@ -34,3 +36,8 @@ We'd love to hear from you!
|
|||||||
|
|
||||||
* Create an {uri-github-issue}[issue]
|
* Create an {uri-github-issue}[issue]
|
||||||
* Ask a question on {uri-github-discussions}[GitHub Discussions]
|
* Ask a question on {uri-github-discussions}[GitHub Discussions]
|
||||||
|
|
||||||
|
== Development image:https://circleci.com/gh/apple/pkl.svg?style=svg["Apple", link="https://app.circleci.com/pipelines/github/apple/pkl"]
|
||||||
|
* link:CONTRIBUTING.adoc[] for tips on pull requests and filing issues
|
||||||
|
* link:DEVELOPMENT.adoc[] for build instructions
|
||||||
|
* {uri-ci-artifacts}[Sonatype Repository] for the artifacts/binaries built by our {uri-ci-pipeline}[CI pipelines] (and those of our other tools and packages repositories).
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
= Security
|
# Security
|
||||||
|
|
||||||
For the protection of our community, the Pkl team does not disclose, discuss, or confirm security issues until our investigation is complete and any necessary updates are generally available.
|
For the protection of our community, the Pkl team does not disclose, discuss, or confirm security issues until our investigation is complete and any necessary updates are generally available.
|
||||||
|
|
||||||
== Reporting a security vulnerability
|
## Reporting a security vulnerability
|
||||||
|
|
||||||
If you have discovered a security vulnerability within the Pkl project, please report it to us.
|
If you have discovered a security vulnerability within the Pkl project, please report it to us.
|
||||||
We welcome reports from everyone, including security researchers, developers, and users.
|
We welcome reports from everyone, including security researchers, developers, and users.
|
||||||
|
|
||||||
Security vulnerabilities may be reported on the link:https://security.apple.com/submit[Report a vulnerability] form.
|
Security vulnerabilities may be reported on the [Report a vulnerability](https://security.apple.com/submit) form.
|
||||||
When submitting a vulnerability, select "Apple Devices and Software" as the affected platform, and "Open Source" as the affected area.
|
When submitting a vulnerability, select "Apple Devices and Software" as the affected platform, and "Open Source" as the affected area.
|
||||||
|
|
||||||
For more information, see https://pkl-lang.org/security.html.
|
For more information, see https://pkl-lang.org/security.html.
|
||||||
@@ -10,7 +10,7 @@ val graal: Configuration by configurations.creating
|
|||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
@Suppress("UnstableApiUsage")
|
||||||
dependencies {
|
dependencies {
|
||||||
jmh(project(":pkl-core"))
|
jmh(projects.pklCore)
|
||||||
// necessary because antlr4-runtime is declared as implementation dependency in pkl-core.gradle
|
// necessary because antlr4-runtime is declared as implementation dependency in pkl-core.gradle
|
||||||
jmh(libs.antlrRuntime)
|
jmh(libs.antlrRuntime)
|
||||||
truffle(libs.truffleApi)
|
truffle(libs.truffleApi)
|
||||||
@@ -24,7 +24,7 @@ jmh {
|
|||||||
// jvmArgsAppend = "-Dgraal.TruffleCompilationExceptionsAreFatal=true " +
|
// jvmArgsAppend = "-Dgraal.TruffleCompilationExceptionsAreFatal=true " +
|
||||||
// "-Dgraal.Dump=Truffle,TruffleTree -Dgraal.TraceTruffleCompilation=true " +
|
// "-Dgraal.Dump=Truffle,TruffleTree -Dgraal.TraceTruffleCompilation=true " +
|
||||||
// "-Dgraal.TruffleFunctionInlining=false"
|
// "-Dgraal.TruffleFunctionInlining=false"
|
||||||
jvm.set("${buildInfo.graalVm.baseDir}/bin/java")
|
jvm.set("${buildInfo.graalVmAmd64.baseDir}/bin/java")
|
||||||
// see: https://docs.oracle.com/en/graalvm/enterprise/20/docs/graalvm-as-a-platform/implement-language/#disable-class-path-separation
|
// see: https://docs.oracle.com/en/graalvm/enterprise/20/docs/graalvm-as-a-platform/implement-language/#disable-class-path-separation
|
||||||
jvmArgs.set(
|
jvmArgs.set(
|
||||||
listOf(
|
listOf(
|
||||||
@@ -38,7 +38,7 @@ jmh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("jmh") {
|
tasks.named("jmh") {
|
||||||
dependsOn(":installGraalVm")
|
dependsOn(":installGraalVmAmd64")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent this error which occurs when building in IntelliJ:
|
// Prevent this error which occurs when building in IntelliJ:
|
||||||
|
|||||||
+17
-17
@@ -2,15 +2,15 @@
|
|||||||
# Manual edits can break the build and are not advised.
|
# Manual edits can break the build and are not advised.
|
||||||
# This file is expected to be part of source control.
|
# This file is expected to be part of source control.
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
com.tunnelvisionlabs:antlr4-runtime:4.9.0=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
net.bytebuddy:byte-buddy:1.14.16=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.apache.commons:commons-math3:3.2=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
org.apache.commons:commons-math3:3.6.1=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.assertj:assertj-core:3.26.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.compiler:compiler:22.3.1=graal
|
org.graalvm.compiler:compiler:23.0.2=graal
|
||||||
org.graalvm.sdk:graal-sdk:22.3.1=graal,jmh,jmhRuntimeClasspath,truffle
|
org.graalvm.sdk:graal-sdk:23.0.2=graal,jmh,jmhRuntimeClasspath,truffle
|
||||||
org.graalvm.truffle:truffle-api:22.3.1=graal,jmh,jmhRuntimeClasspath,truffle
|
org.graalvm.truffle:truffle-api:23.0.2=graal,jmh,jmhRuntimeClasspath,truffle
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
@@ -26,17 +26,17 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=testCompileClasspath,testImplemen
|
|||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathJmh,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-api:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-engine:5.10.2=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-params:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.junit.jupiter:junit-jupiter-params:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.platform:junit-platform-commons:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-commons:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.platform:junit-platform-engine:1.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-engine:1.10.2=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit:junit-bom:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.openjdk.jmh:jmh-core:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.openjdk.jmh:jmh-generator-asm:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.openjdk.jmh:jmh-generator-bytecode:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
org.openjdk.jmh:jmh-generator-bytecode:1.37=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.openjdk.jmh:jmh-generator-reflection:1.36=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.organicdesign:Paguro:3.10.3=jmh,jmhRuntimeClasspath
|
org.organicdesign:Paguro:3.10.3=jmh,jmhRuntimeClasspath
|
||||||
org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=jmh,jmhRuntimeClasspath
|
org.snakeyaml:snakeyaml-engine:2.5=jmh,jmhRuntimeClasspath
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.openjdk.jmh.annotations.*;
|
import org.openjdk.jmh.annotations.*;
|
||||||
import org.openjdk.jmh.util.TempFile;
|
import org.openjdk.jmh.util.TempFile;
|
||||||
import org.openjdk.jmh.util.TempFileManager;
|
import org.openjdk.jmh.util.TempFileManager;
|
||||||
|
import org.pkl.core.http.HttpClient;
|
||||||
import org.pkl.core.module.ModuleKeyFactories;
|
import org.pkl.core.module.ModuleKeyFactories;
|
||||||
import org.pkl.core.repl.ReplRequest;
|
import org.pkl.core.repl.ReplRequest;
|
||||||
import org.pkl.core.repl.ReplResponse;
|
import org.pkl.core.repl.ReplResponse;
|
||||||
@@ -39,6 +40,7 @@ public class ListSort {
|
|||||||
private static final ReplServer repl =
|
private static final ReplServer repl =
|
||||||
new ReplServer(
|
new ReplServer(
|
||||||
SecurityManagers.defaultManager,
|
SecurityManagers.defaultManager,
|
||||||
|
HttpClient.dummyClient(),
|
||||||
Loggers.stdErr(),
|
Loggers.stdErr(),
|
||||||
List.of(ModuleKeyFactories.standardLibrary),
|
List.of(ModuleKeyFactories.standardLibrary),
|
||||||
List.of(ResourceReaders.file()),
|
List.of(ResourceReaders.file()),
|
||||||
@@ -109,10 +111,10 @@ public class ListSort {
|
|||||||
// append `.length` to avoid rendering the list
|
// append `.length` to avoid rendering the list
|
||||||
new ReplRequest.Eval("sort", "nums.sortWith(cmp).length", false, false))
|
new ReplRequest.Eval("sort", "nums.sortWith(cmp).length", false, false))
|
||||||
.get(0);
|
.get(0);
|
||||||
if (!(response instanceof ReplResponse.EvalSuccess)) {
|
if (!(response instanceof ReplResponse.EvalSuccess success)) {
|
||||||
throw new AssertionError(response);
|
throw new AssertionError(response);
|
||||||
}
|
}
|
||||||
return ((ReplResponse.EvalSuccess) response).getResult();
|
return success.getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// note that this is an uneven comparison
|
// note that this is an uneven comparison
|
||||||
|
|||||||
@@ -30,30 +30,31 @@ public class ParserBenchmark {
|
|||||||
public void run() {
|
public void run() {
|
||||||
new Parser()
|
new Parser()
|
||||||
.parseModule(
|
.parseModule(
|
||||||
"a1 {\n"
|
"""
|
||||||
+ " a2 {\n"
|
a1 {
|
||||||
+ " a3 {\n"
|
a2 {
|
||||||
+ " a4 {\n"
|
a3 {
|
||||||
+ " a5 {\n"
|
a4 {
|
||||||
+ " a6 {\n"
|
a5 {
|
||||||
+ " a7 {\n"
|
a6 {
|
||||||
+ " a8 {\n"
|
a7 {
|
||||||
+ " a9 {\n"
|
a8 {
|
||||||
+ " a10 {\n"
|
a9 {
|
||||||
+ " a11 {\n"
|
a10 {
|
||||||
+ " a12 {\n"
|
a11 {
|
||||||
+ " a13 = map(map(map((x) -> 1)))\n"
|
a12 {
|
||||||
+ " }\n"
|
a13 = map(map(map((x) -> 1)))
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ " }\n"
|
}
|
||||||
+ "}");
|
}
|
||||||
|
}""");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ idea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val clean by tasks.registering(Delete::class) {
|
val clean by tasks.registering(Delete::class) {
|
||||||
delete(buildDir)
|
delete(layout.buildDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
val printVersion by tasks.registering {
|
val printVersion by tasks.registering {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import org.jetbrains.kotlin.config.JvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`kotlin-dsl`
|
`kotlin-dsl`
|
||||||
}
|
}
|
||||||
@@ -9,9 +11,23 @@ dependencies {
|
|||||||
exclude(module = "kotlin-android-extensions")
|
exclude(module = "kotlin-android-extensions")
|
||||||
}
|
}
|
||||||
implementation(libs.shadowPlugin)
|
implementation(libs.shadowPlugin)
|
||||||
|
|
||||||
|
// fix from the Gradle team: makes version catalog symbols available in build scripts
|
||||||
|
// see here for more: https://github.com/gradle/gradle/issues/15383
|
||||||
|
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
target {
|
||||||
|
compilations.configureEach {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
@file:Suppress("UnstableApiUsage")
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
|
rootProject.name = "buildSrc"
|
||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -4,15 +4,12 @@ import java.io.File
|
|||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.artifacts.VersionCatalog
|
import org.gradle.api.artifacts.VersionCatalog
|
||||||
import org.gradle.api.artifacts.VersionCatalogsExtension
|
import org.gradle.api.artifacts.VersionCatalogsExtension
|
||||||
import org.gradle.api.artifacts.VersionConstraint
|
|
||||||
import org.gradle.kotlin.dsl.getByType
|
import org.gradle.kotlin.dsl.getByType
|
||||||
|
|
||||||
// `buildInfo` in main build scripts
|
// `buildInfo` in main build scripts
|
||||||
// `project.extensions.getByType<BuildInfo>()` in precompiled script plugins
|
// `project.extensions.getByType<BuildInfo>()` in precompiled script plugins
|
||||||
open class BuildInfo(project: Project) {
|
open class BuildInfo(project: Project) {
|
||||||
val self = this
|
inner class GraalVm(val arch: String) {
|
||||||
|
|
||||||
inner class GraalVm {
|
|
||||||
val homeDir: String by lazy {
|
val homeDir: String by lazy {
|
||||||
System.getenv("GRAALVM_HOME") ?: "${System.getProperty("user.home")}/.graalvm"
|
System.getenv("GRAALVM_HOME") ?: "${System.getProperty("user.home")}/.graalvm"
|
||||||
}
|
}
|
||||||
@@ -21,47 +18,27 @@ open class BuildInfo(project: Project) {
|
|||||||
libs.findVersion("graalVm").get().toString()
|
libs.findVersion("graalVm").get().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
val isGraal22: Boolean by lazy {
|
val graalVmJdkVersion: String by lazy {
|
||||||
version.startsWith("22")
|
libs.findVersion("graalVmJdkVersion").get().toString()
|
||||||
}
|
|
||||||
|
|
||||||
val arch by lazy {
|
|
||||||
if (os.isMacOsX && isGraal22) {
|
|
||||||
"amd64"
|
|
||||||
} else {
|
|
||||||
self.arch
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val osName: String by lazy {
|
val osName: String by lazy {
|
||||||
when {
|
when {
|
||||||
os.isMacOsX && isGraal22 -> "darwin"
|
|
||||||
os.isMacOsX -> "macos"
|
os.isMacOsX -> "macos"
|
||||||
os.isLinux -> "linux"
|
os.isLinux -> "linux"
|
||||||
|
os.isWindows -> "windows"
|
||||||
else -> throw RuntimeException("${os.familyName} is not supported.")
|
else -> throw RuntimeException("${os.familyName} is not supported.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val baseName: String by lazy {
|
val baseName: String by lazy {
|
||||||
if (graalVm.isGraal22) {
|
"graalvm-jdk-${graalVmJdkVersion}_${osName}-${arch}_bin"
|
||||||
"graalvm-ce-java11-${osName}-${arch}-${version}"
|
|
||||||
} else {
|
|
||||||
"graalvm-jdk-${graalVM23JdkVersion}_${osName}-${arch}_bin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val graalVM23JdkVersion: String by lazy {
|
|
||||||
libs.findVersion("graalVM23JdkVersion").get().requiredVersion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val downloadUrl: String by lazy {
|
val downloadUrl: String by lazy {
|
||||||
if (isGraal22) {
|
val jdkMajor = graalVmJdkVersion.takeWhile { it != '.' }
|
||||||
"https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-" +
|
val extension = if (os.isWindows) "zip" else "tar.gz"
|
||||||
"${version}/$baseName.tar.gz"
|
"https://download.oracle.com/graalvm/$jdkMajor/archive/$baseName.$extension"
|
||||||
} else {
|
|
||||||
val jdkMajor = graalVM23JdkVersion.takeWhile { it != '.' }
|
|
||||||
"https://download.oracle.com/graalvm/$jdkMajor/archive/$baseName.tar.gz"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val installDir: File by lazy {
|
val installDir: File by lazy {
|
||||||
@@ -85,7 +62,9 @@ open class BuildInfo(project: Project) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val graalVm: GraalVm = GraalVm()
|
val graalVmAarch64: GraalVm = GraalVm("aarch64")
|
||||||
|
|
||||||
|
val graalVmAmd64: GraalVm = GraalVm("x64")
|
||||||
|
|
||||||
val isCiBuild: Boolean by lazy {
|
val isCiBuild: Boolean by lazy {
|
||||||
System.getenv("CI") != null
|
System.getenv("CI") != null
|
||||||
@@ -108,9 +87,14 @@ open class BuildInfo(project: Project) {
|
|||||||
val commitId: String by lazy {
|
val commitId: String by lazy {
|
||||||
// only run command once per build invocation
|
// only run command once per build invocation
|
||||||
if (project === project.rootProject) {
|
if (project === project.rootProject) {
|
||||||
Runtime.getRuntime()
|
val process = ProcessBuilder()
|
||||||
.exec("git rev-parse --short HEAD", arrayOf(), project.rootDir)
|
.command("git", "rev-parse", "--short", "HEAD")
|
||||||
.inputStream.reader().readText().trim()
|
.directory(project.rootDir)
|
||||||
|
.start()
|
||||||
|
process.waitFor().also { exitCode ->
|
||||||
|
if (exitCode == -1) throw RuntimeException(process.errorStream.reader().readText())
|
||||||
|
}
|
||||||
|
process.inputStream.reader().readText().trim()
|
||||||
} else {
|
} else {
|
||||||
project.rootProject.extensions.getByType(BuildInfo::class.java).commitId
|
project.rootProject.extensions.getByType(BuildInfo::class.java).commitId
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
import org.gradle.api.file.RegularFileProperty
|
import org.gradle.api.file.RegularFileProperty
|
||||||
import org.gradle.api.provider.ListProperty
|
import org.gradle.api.provider.ListProperty
|
||||||
|
import org.gradle.api.provider.Property
|
||||||
import org.gradle.api.tasks.Input
|
import org.gradle.api.tasks.Input
|
||||||
import org.gradle.api.tasks.InputFile
|
import org.gradle.api.tasks.InputFile
|
||||||
import org.gradle.api.tasks.OutputFile
|
import org.gradle.api.tasks.OutputFile
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
import org.gradle.kotlin.dsl.listProperty
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a self-contained Pkl CLI Jar that is directly executable on *nix
|
* Builds a self-contained Pkl CLI Jar that is directly executable on *nix
|
||||||
@@ -15,27 +15,25 @@ import org.gradle.kotlin.dsl.listProperty
|
|||||||
*
|
*
|
||||||
* https://skife.org/java/unix/2011/06/20/really_executable_jars.html
|
* https://skife.org/java/unix/2011/06/20/really_executable_jars.html
|
||||||
*/
|
*/
|
||||||
open class ExecutableJar : DefaultTask() {
|
abstract class ExecutableJar : DefaultTask() {
|
||||||
@get:InputFile
|
@get:InputFile
|
||||||
val inJar: RegularFileProperty = project.objects.fileProperty()
|
abstract val inJar: RegularFileProperty
|
||||||
|
|
||||||
@get:OutputFile
|
@get:OutputFile
|
||||||
val outJar: RegularFileProperty = project.objects.fileProperty()
|
abstract val outJar: RegularFileProperty
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
val jvmArgs: ListProperty<String> = project.objects.listProperty()
|
abstract val jvmArgs: ListProperty<String>
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun buildJar() {
|
fun buildJar() {
|
||||||
val inFile = inJar.get().asFile
|
val inFile = inJar.get().asFile
|
||||||
val outFile = outJar.get().asFile
|
val outFile = outJar.get().asFile
|
||||||
val escapedJvmArgs = jvmArgs.get().joinToString(separator = " ") { "\"$it\"" }
|
val escapedJvmArgs = jvmArgs.get().joinToString(separator = " ") { "\"$it\"" }
|
||||||
|
|
||||||
val startScript = """
|
val startScript = """
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec java $escapedJvmArgs -jar $0 "$@"
|
exec java $escapedJvmArgs -jar $0 "$@"
|
||||||
""".trim().trimMargin() + "\n\n\n"
|
""".trimIndent() + "\n\n\n"
|
||||||
|
|
||||||
outFile.outputStream().use { outStream ->
|
outFile.outputStream().use { outStream ->
|
||||||
startScript.byteInputStream().use { it.copyTo(outStream) }
|
startScript.byteInputStream().use { it.copyTo(outStream) }
|
||||||
inFile.inputStream().use { it.copyTo(outStream) }
|
inFile.inputStream().use { it.copyTo(outStream) }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import java.net.URL
|
|
||||||
import org.gradle.util.GradleVersion
|
import org.gradle.util.GradleVersion
|
||||||
import groovy.json.JsonSlurper
|
import groovy.json.JsonSlurper
|
||||||
|
import java.net.URI
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
class GradleVersionInfo(json: Map<String, Any>) {
|
class GradleVersionInfo(json: Map<String, Any>) {
|
||||||
@@ -50,18 +50,18 @@ class GradleVersionInfo(json: Map<String, Any>) {
|
|||||||
|
|
||||||
private fun fetchSingle(url: String): GradleVersionInfo {
|
private fun fetchSingle(url: String): GradleVersionInfo {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return GradleVersionInfo(JsonSlurper().parse(URL(url)) as Map<String, Any>)
|
return GradleVersionInfo(JsonSlurper().parse(URI(url).toURL()) as Map<String, Any>)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fetchSingleOrNull(url: String): GradleVersionInfo? {
|
private fun fetchSingleOrNull(url: String): GradleVersionInfo? {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val json = JsonSlurper().parse(URL(url)) as Map<String, Any>
|
val json = JsonSlurper().parse(URI(url).toURL()) as Map<String, Any>
|
||||||
return if (json.isEmpty()) null else GradleVersionInfo(json)
|
return if (json.isEmpty()) null else GradleVersionInfo(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fetchMultiple(url: String): List<GradleVersionInfo> {
|
private fun fetchMultiple(url: String): List<GradleVersionInfo> {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return (JsonSlurper().parse(URL(url)) as List<Map<String, Any>>)
|
return (JsonSlurper().parse(URI(url).toURL()) as List<Map<String, Any>>)
|
||||||
.map { GradleVersionInfo(it) }
|
.map { GradleVersionInfo(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ configurations {
|
|||||||
|
|
||||||
plugins.withType(JavaPlugin::class).configureEach {
|
plugins.withType(JavaPlugin::class).configureEach {
|
||||||
val java = project.extensions.getByType<JavaPluginExtension>()
|
val java = project.extensions.getByType<JavaPluginExtension>()
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_11
|
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||||
java.targetCompatibility = JavaVersion.VERSION_11
|
java.targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
tasks.withType<KotlinCompile>().configureEach {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "11"
|
jvmTarget = "17"
|
||||||
freeCompilerArgs = freeCompilerArgs + listOf("-Xjsr305=strict", "-Xjvm-default=all")
|
freeCompilerArgs = freeCompilerArgs + listOf("-Xjsr305=strict", "-Xjvm-default=all")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,3 +93,28 @@ val updateDependencyLocks by tasks.registering {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val allDependencies by tasks.registering(DependencyReportTask::class)
|
val allDependencies by tasks.registering(DependencyReportTask::class)
|
||||||
|
|
||||||
|
tasks.withType(Test::class).configureEach {
|
||||||
|
System.getProperty("testReportsDir")?.let { reportsDir ->
|
||||||
|
reports.junitXml.outputLocation.set(file(reportsDir).resolve(project.name).resolve(name))
|
||||||
|
}
|
||||||
|
debugOptions {
|
||||||
|
enabled = System.getProperty("jvmdebug")?.toBoolean() ?: false
|
||||||
|
@Suppress("UnstableApiUsage")
|
||||||
|
host = "*"
|
||||||
|
port = 5005
|
||||||
|
suspend = true
|
||||||
|
server = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaExec::class).configureEach {
|
||||||
|
debugOptions {
|
||||||
|
enabled = System.getProperty("jvmdebug")?.toBoolean() ?: false
|
||||||
|
@Suppress("UnstableApiUsage")
|
||||||
|
host = "*"
|
||||||
|
port = 5005
|
||||||
|
suspend = true
|
||||||
|
server = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ val firstPartySourcesJarsConfiguration: Configuration = configurations.create("f
|
|||||||
val relocations = mapOf(
|
val relocations = mapOf(
|
||||||
// pkl-core dependencies
|
// pkl-core dependencies
|
||||||
"org.antlr.v4." to "org.pkl.thirdparty.antlr.v4.",
|
"org.antlr.v4." to "org.pkl.thirdparty.antlr.v4.",
|
||||||
// https://github.com/oracle/graal/issues/1644 has been fixed,
|
"com.oracle.truffle" to "org.pkl.thirdparty.truffle",
|
||||||
// but native-image still fails when shading com.oracle.truffle
|
|
||||||
//"com.oracle.truffle" to "org.pkl.thirdparty.truffle",
|
|
||||||
"org.graalvm." to "org.pkl.thirdparty.graalvm.",
|
"org.graalvm." to "org.pkl.thirdparty.graalvm.",
|
||||||
"org.organicdesign.fp." to "org.pkl.thirdparty.paguro.",
|
"org.organicdesign.fp." to "org.pkl.thirdparty.paguro.",
|
||||||
"org.snakeyaml.engine." to "org.pkl.thirdparty.snakeyaml.engine.",
|
"org.snakeyaml.engine." to "org.pkl.thirdparty.snakeyaml.engine.",
|
||||||
@@ -107,7 +105,7 @@ tasks.check {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val validateFatJar by tasks.registering {
|
val validateFatJar by tasks.registering {
|
||||||
val outputFile = file("$buildDir/validateFatJar/result.txt")
|
val outputFile = layout.buildDirectory.file("validateFatJar/result.txt")
|
||||||
inputs.files(tasks.shadowJar)
|
inputs.files(tasks.shadowJar)
|
||||||
inputs.property("nonRelocations", nonRelocations)
|
inputs.property("nonRelocations", nonRelocations)
|
||||||
outputs.file(outputFile)
|
outputs.file(outputFile)
|
||||||
@@ -127,9 +125,9 @@ val validateFatJar by tasks.registering {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (unshadowedFiles.isEmpty()) {
|
if (unshadowedFiles.isEmpty()) {
|
||||||
outputFile.writeText("SUCCESS")
|
outputFile.get().asFile.writeText("SUCCESS")
|
||||||
} else {
|
} else {
|
||||||
outputFile.writeText("FAILURE")
|
outputFile.get().asFile.writeText("FAILURE")
|
||||||
throw GradleException("Found unshadowed files:\n" + unshadowedFiles.joinToString("\n"))
|
throw GradleException("Found unshadowed files:\n" + unshadowedFiles.joinToString("\n"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,7 +138,7 @@ tasks.check {
|
|||||||
|
|
||||||
val resolveSourcesJars by tasks.registering(ResolveSourcesJars::class) {
|
val resolveSourcesJars by tasks.registering(ResolveSourcesJars::class) {
|
||||||
configuration.set(configurations.runtimeClasspath)
|
configuration.set(configurations.runtimeClasspath)
|
||||||
outputDir.set(project.file("$buildDir/resolveSourcesJars"))
|
outputDir.set(layout.buildDirectory.dir("resolveSourcesJars"))
|
||||||
}
|
}
|
||||||
|
|
||||||
val fatSourcesJar by tasks.registering(MergeSourcesJars::class) {
|
val fatSourcesJar by tasks.registering(MergeSourcesJars::class) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import java.nio.file.*
|
|||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
import de.undercouch.gradle.tasks.download.Download
|
import de.undercouch.gradle.tasks.download.Download
|
||||||
import de.undercouch.gradle.tasks.download.Verify
|
import de.undercouch.gradle.tasks.download.Verify
|
||||||
|
import kotlin.io.path.createDirectories
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("de.undercouch.download")
|
id("de.undercouch.download")
|
||||||
@@ -9,70 +10,98 @@ plugins {
|
|||||||
|
|
||||||
val buildInfo = project.extensions.getByType<BuildInfo>()
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
val homeDir = buildInfo.graalVm.homeDir
|
val BuildInfo.GraalVm.downloadFile get(): File {
|
||||||
val baseName = buildInfo.graalVm.baseName
|
val extension = if (buildInfo.os.isWindows) "zip" else "tar.gz"
|
||||||
val installDir = buildInfo.graalVm.installDir
|
return file(homeDir).resolve("${baseName}.$extension")
|
||||||
val downloadUrl = buildInfo.graalVm.downloadUrl
|
}
|
||||||
val downloadFile = file(homeDir).resolve("$baseName.tar.gz")
|
|
||||||
|
|
||||||
// tries to minimize chance of corruption by download-to-temp-file-and-move
|
// tries to minimize chance of corruption by download-to-temp-file-and-move
|
||||||
val downloadGraalVm by tasks.registering(Download::class) {
|
val downloadGraalVmAarch64 by tasks.registering(Download::class) {
|
||||||
|
configureDownloadGraalVm(buildInfo.graalVmAarch64)
|
||||||
|
}
|
||||||
|
|
||||||
|
val downloadGraalVmAmd64 by tasks.registering(Download::class) {
|
||||||
|
configureDownloadGraalVm(buildInfo.graalVmAmd64)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Download.configureDownloadGraalVm(graalvm: BuildInfo.GraalVm) {
|
||||||
onlyIf {
|
onlyIf {
|
||||||
!installDir.exists()
|
!graalvm.installDir.exists()
|
||||||
|
}
|
||||||
|
doLast {
|
||||||
|
println("Downloaded GraalVm to ${graalvm.downloadFile}")
|
||||||
}
|
}
|
||||||
|
|
||||||
src(downloadUrl)
|
src(graalvm.downloadUrl)
|
||||||
dest(downloadFile)
|
dest(graalvm.downloadFile)
|
||||||
overwrite(false)
|
overwrite(false)
|
||||||
tempAndMove(true)
|
tempAndMove(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
val verifyGraalVm by tasks.registering(Verify::class) {
|
val verifyGraalVmAarch64 by tasks.registering(Verify::class) {
|
||||||
|
configureVerifyGraalVm(buildInfo.graalVmAarch64)
|
||||||
|
dependsOn(downloadGraalVmAarch64)
|
||||||
|
}
|
||||||
|
|
||||||
|
val verifyGraalVmAmd64 by tasks.registering(Verify::class) {
|
||||||
|
configureVerifyGraalVm(buildInfo.graalVmAmd64)
|
||||||
|
dependsOn(downloadGraalVmAmd64)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Verify.configureVerifyGraalVm(graalvm: BuildInfo.GraalVm) {
|
||||||
onlyIf {
|
onlyIf {
|
||||||
!installDir.exists()
|
!graalvm.installDir.exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependsOn(downloadGraalVm)
|
src(graalvm.downloadFile)
|
||||||
src(downloadFile)
|
checksum(buildInfo.libs.findVersion("graalVmSha256-${graalvm.osName}-${graalvm.arch}").get().toString())
|
||||||
checksum(buildInfo.libs.findVersion("graalVmSha256-${buildInfo.graalVm.osName}-${buildInfo.graalVm.arch}").get().toString())
|
|
||||||
algorithm("SHA-256")
|
algorithm("SHA-256")
|
||||||
}
|
}
|
||||||
|
|
||||||
// minimize chance of corruption by extract-to-random-dir-and-flip-symlink
|
// minimize chance of corruption by extract-to-random-dir-and-flip-symlink
|
||||||
val installGraalVm by tasks.registering {
|
val installGraalVmAarch64 by tasks.registering {
|
||||||
dependsOn(verifyGraalVm)
|
dependsOn(verifyGraalVmAarch64)
|
||||||
|
configureInstallGraalVm(buildInfo.graalVmAarch64)
|
||||||
|
}
|
||||||
|
|
||||||
|
// minimize chance of corruption by extract-to-random-dir-and-flip-symlink
|
||||||
|
val installGraalVmAmd64 by tasks.registering {
|
||||||
|
dependsOn(verifyGraalVmAmd64)
|
||||||
|
configureInstallGraalVm(buildInfo.graalVmAmd64)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Task.configureInstallGraalVm(graalVm: BuildInfo.GraalVm) {
|
||||||
onlyIf {
|
onlyIf {
|
||||||
!installDir.exists()
|
!graalVm.installDir.exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
val distroDir = "$homeDir/${UUID.randomUUID()}"
|
val distroDir = Paths.get(graalVm.homeDir, UUID.randomUUID().toString())
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mkdir(distroDir)
|
distroDir.createDirectories()
|
||||||
|
println("Extracting ${graalVm.downloadFile} into $distroDir")
|
||||||
println("Extracting $downloadFile into $distroDir")
|
|
||||||
// faster and more reliable than Gradle's `copy { from tarTree() }`
|
// faster and more reliable than Gradle's `copy { from tarTree() }`
|
||||||
exec {
|
exec {
|
||||||
workingDir = file(distroDir)
|
workingDir = file(distroDir)
|
||||||
executable = "tar"
|
executable = "tar"
|
||||||
args("--strip-components=1", "-xzf", downloadFile)
|
args("--strip-components=1", "-xzf", graalVm.downloadFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
val distroBinDir = if (buildInfo.os.isMacOsX) "$distroDir/Contents/Home/bin" else "$distroDir/bin"
|
val distroBinDir = if (buildInfo.os.isMacOsX) distroDir.resolve("Contents/Home/bin") else distroDir.resolve("bin")
|
||||||
|
|
||||||
println("Installing native-image into $distroDir")
|
println("Installing native-image into $distroDir")
|
||||||
exec {
|
exec {
|
||||||
executable = "$distroBinDir/gu"
|
val executableName = if (buildInfo.os.isWindows) "gu.cmd" else "gu"
|
||||||
|
executable = distroBinDir.resolve(executableName).toString()
|
||||||
args("install", "--no-progress", "native-image")
|
args("install", "--no-progress", "native-image")
|
||||||
}
|
}
|
||||||
|
|
||||||
println("Creating symlink $installDir for $distroDir")
|
println("Creating symlink ${graalVm.installDir} for $distroDir")
|
||||||
val tempLink = Paths.get("$homeDir/${UUID.randomUUID()}")
|
val tempLink = Paths.get(graalVm.homeDir, UUID.randomUUID().toString())
|
||||||
Files.createSymbolicLink(tempLink, Paths.get(distroDir))
|
Files.createSymbolicLink(tempLink, distroDir)
|
||||||
try {
|
try {
|
||||||
Files.move(tempLink, installDir.toPath(), StandardCopyOption.ATOMIC_MOVE)
|
Files.move(tempLink, graalVm.installDir.toPath(), StandardCopyOption.ATOMIC_MOVE)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
try { delete(tempLink.toFile()) } catch (ignored: Exception) {}
|
try { delete(tempLink.toFile()) } catch (ignored: Exception) {}
|
||||||
throw e
|
throw e
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val validateHtml by tasks.registering(JavaExec::class) {
|
val validateHtml by tasks.registering(JavaExec::class) {
|
||||||
val resultFile = file("$buildDir/validateHtml/result.txt")
|
val resultFile = layout.buildDirectory.file("validateHtml/result.txt")
|
||||||
inputs.files(htmlValidator.sources)
|
inputs.files(htmlValidator.sources)
|
||||||
outputs.file(resultFile)
|
outputs.file(resultFile)
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ val validateHtml by tasks.registering(JavaExec::class) {
|
|||||||
// write a basic result file s.t. gradle can consider task up-to-date
|
// write a basic result file s.t. gradle can consider task up-to-date
|
||||||
// writing a result file in case validation fails is not easily possible with JavaExec, but also not strictly necessary
|
// writing a result file in case validation fails is not easily possible with JavaExec, but also not strictly necessary
|
||||||
doFirst { project.delete(resultFile) }
|
doFirst { project.delete(resultFile) }
|
||||||
doLast { resultFile.writeText("Success.") }
|
doLast { resultFile.get().asFile.writeText("Success.") }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.check {
|
tasks.check {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
@file:Suppress("HttpUrlsUsage")
|
@file:Suppress("HttpUrlsUsage")
|
||||||
|
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
id("pklKotlinTest")
|
id("pklKotlinTest")
|
||||||
@@ -9,6 +11,9 @@ plugins {
|
|||||||
// make sources Jar available to other subprojects
|
// make sources Jar available to other subprojects
|
||||||
val sourcesJarConfiguration = configurations.register("sourcesJar")
|
val sourcesJarConfiguration = configurations.register("sourcesJar")
|
||||||
|
|
||||||
|
// Version Catalog library symbols.
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
java {
|
java {
|
||||||
withSourcesJar() // creates `sourcesJar` task
|
withSourcesJar() // creates `sourcesJar` task
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
@@ -21,7 +26,7 @@ artifacts {
|
|||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
java {
|
java {
|
||||||
googleJavaFormat("1.15.0")
|
googleJavaFormat(libs.versions.googleJavaFormat.get())
|
||||||
targetExclude("**/generated/**", "**/build/**")
|
targetExclude("**/generated/**", "**/build/**")
|
||||||
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
|
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
|
||||||
}
|
}
|
||||||
@@ -50,10 +55,13 @@ val workAroundKotlinGradlePluginBug by tasks.registering {
|
|||||||
// A problem was found with the configuration of task ':pkl-executor:compileJava' (type 'JavaCompile').
|
// A problem was found with the configuration of task ':pkl-executor:compileJava' (type 'JavaCompile').
|
||||||
// > Directory '[...]/pkl/pkl-executor/build/classes/kotlin/main'
|
// > Directory '[...]/pkl/pkl-executor/build/classes/kotlin/main'
|
||||||
// specified for property 'compileKotlinOutputClasses' does not exist.
|
// specified for property 'compileKotlinOutputClasses' does not exist.
|
||||||
file("$buildDir/classes/kotlin/main").mkdirs()
|
layout.buildDirectory.dir("classes/kotlin/main").get().asFile.mkdirs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.compileJava {
|
tasks.compileJava {
|
||||||
dependsOn(workAroundKotlinGradlePluginBug)
|
dependsOn(workAroundKotlinGradlePluginBug)
|
||||||
|
// TODO: determine correct limits for Truffle specializations
|
||||||
|
// (see https://graalvm.slack.com/archives/CNQSB2DHD/p1712380902746829)
|
||||||
|
options.compilerArgs.add("-Atruffle.dsl.SuppressWarnings=truffle-limit")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("pklJavaLibrary")
|
id("pklJavaLibrary")
|
||||||
|
|
||||||
@@ -6,6 +8,9 @@ plugins {
|
|||||||
|
|
||||||
val buildInfo = project.extensions.getByType<BuildInfo>()
|
val buildInfo = project.extensions.getByType<BuildInfo>()
|
||||||
|
|
||||||
|
// Version Catalog library symbols.
|
||||||
|
val libs = the<LibrariesForLibs>()
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// At least some of our kotlin APIs contain Kotlin stdlib types
|
// At least some of our kotlin APIs contain Kotlin stdlib types
|
||||||
// that aren't compiled away by kotlinc (e.g., `kotlin.Function`).
|
// that aren't compiled away by kotlinc (e.g., `kotlin.Function`).
|
||||||
@@ -21,7 +26,7 @@ tasks.compileKotlin {
|
|||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
kotlin {
|
kotlin {
|
||||||
ktfmt("0.44").googleStyle()
|
ktfmt(libs.versions.ktfmt.get()).googleStyle()
|
||||||
targetExclude("**/generated/**", "**/build/**")
|
targetExclude("**/generated/**", "**/build/**")
|
||||||
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
|
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
val assembleNative by tasks.registering {}
|
val assembleNative by tasks.registering {}
|
||||||
|
|
||||||
val checkNative by tasks.registering {}
|
val testNative by tasks.registering {}
|
||||||
|
|
||||||
|
val checkNative by tasks.registering {
|
||||||
|
dependsOn(testNative)
|
||||||
|
}
|
||||||
|
|
||||||
val buildNative by tasks.registering {
|
val buildNative by tasks.registering {
|
||||||
dependsOn(assembleNative, checkNative)
|
dependsOn(assembleNative, checkNative)
|
||||||
|
|||||||
@@ -50,15 +50,18 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val validatePom by tasks.registering {
|
val validatePom by tasks.registering {
|
||||||
|
if (tasks.findByName("generatePomFileForLibraryPublication") == null) {
|
||||||
|
return@registering
|
||||||
|
}
|
||||||
val generatePomFileForLibraryPublication by tasks.existing(GenerateMavenPom::class)
|
val generatePomFileForLibraryPublication by tasks.existing(GenerateMavenPom::class)
|
||||||
val outputFile = file("$buildDir/validatePom") // dummy output to satisfy up-to-date check
|
val outputFile = layout.buildDirectory.file("validatePom") // dummy output to satisfy up-to-date check
|
||||||
|
|
||||||
dependsOn(generatePomFileForLibraryPublication)
|
dependsOn(generatePomFileForLibraryPublication)
|
||||||
inputs.file(generatePomFileForLibraryPublication.get().destination)
|
inputs.file(generatePomFileForLibraryPublication.get().destination)
|
||||||
outputs.file(outputFile)
|
outputs.file(outputFile)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
outputFile.delete()
|
outputFile.get().asFile.delete()
|
||||||
|
|
||||||
val pomFile = generatePomFileForLibraryPublication.get().destination
|
val pomFile = generatePomFileForLibraryPublication.get().destination
|
||||||
assert(pomFile.exists())
|
assert(pomFile.exists())
|
||||||
@@ -92,7 +95,7 @@ val validatePom by tasks.registering {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outputFile.writeText("OK")
|
outputFile.get().asFile.writeText("OK")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,6 +103,14 @@ tasks.publish {
|
|||||||
dependsOn(validatePom)
|
dependsOn(validatePom)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround for maven publish plugin not setting up dependencies correctly.
|
||||||
|
// Taken from https://github.com/gradle/gradle/issues/26091#issuecomment-1798137734
|
||||||
|
val dependsOnTasks = mutableListOf<String>()
|
||||||
|
tasks.withType<AbstractPublishToMaven>().configureEach {
|
||||||
|
dependsOnTasks.add(name.replace("publish", "sign").replaceAfter("Publication", ""))
|
||||||
|
dependsOn(dependsOnTasks)
|
||||||
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
// provided as env vars `ORG_GRADLE_PROJECT_signingKey` and `ORG_GRADLE_PROJECT_signingPassword`
|
// provided as env vars `ORG_GRADLE_PROJECT_signingKey` and `ORG_GRADLE_PROJECT_signingPassword`
|
||||||
// in CI.
|
// in CI.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: main
|
name: main
|
||||||
title: Main Project
|
title: Main Project
|
||||||
version: 0.25.3
|
version: 0.26.3
|
||||||
prerelease: false
|
prerelease: false
|
||||||
nav:
|
nav:
|
||||||
- nav.adoc
|
- nav.adoc
|
||||||
|
|||||||
@@ -10,20 +10,21 @@ sourceSets {
|
|||||||
java {
|
java {
|
||||||
srcDir(file("modules/pkl-core/examples"))
|
srcDir(file("modules/pkl-core/examples"))
|
||||||
srcDir(file("modules/pkl-config-java/examples"))
|
srcDir(file("modules/pkl-config-java/examples"))
|
||||||
|
srcDir(file("modules/java-binding/examples"))
|
||||||
}
|
}
|
||||||
val kotlin = project.extensions
|
val kotlin = project.extensions
|
||||||
.getByType<KotlinJvmProjectExtension>()
|
.getByType<KotlinJvmProjectExtension>()
|
||||||
.sourceSets[name]
|
.sourceSets[name]
|
||||||
.kotlin
|
.kotlin
|
||||||
kotlin.srcDir(file("modules/pkl-config-kotlin/examples"))
|
kotlin.srcDir(file("modules/kotlin-binding/examples"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(project(":pkl-core"))
|
testImplementation(projects.pklCore)
|
||||||
testImplementation(project(":pkl-config-java"))
|
testImplementation(projects.pklConfigJava)
|
||||||
testImplementation(project(":pkl-config-kotlin"))
|
testImplementation(projects.pklConfigKotlin)
|
||||||
testImplementation(project(":pkl-commons-test"))
|
testImplementation(projects.pklCommonsTest)
|
||||||
testImplementation(libs.junitEngine)
|
testImplementation(libs.junitEngine)
|
||||||
testImplementation(libs.antlrRuntime)
|
testImplementation(libs.antlrRuntime)
|
||||||
}
|
}
|
||||||
@@ -31,5 +32,5 @@ dependencies {
|
|||||||
tasks.test {
|
tasks.test {
|
||||||
inputs.files(fileTree("modules").matching {
|
inputs.files(fileTree("modules").matching {
|
||||||
include("**/pages/*.adoc")
|
include("**/pages/*.adoc")
|
||||||
})
|
}).withPropertyName("asciiDocFiles").withPathSensitivity(PathSensitivity.RELATIVE)
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -2,13 +2,13 @@
|
|||||||
# Manual edits can break the build and are not advised.
|
# Manual edits can break the build and are not advised.
|
||||||
# This file is expected to be part of source control.
|
# This file is expected to be part of source control.
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
com.tunnelvisionlabs:antlr4-runtime:4.9.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
io.leangen.geantyref:geantyref:1.3.14=testRuntimeClasspath
|
io.leangen.geantyref:geantyref:1.3.15=testRuntimeClasspath
|
||||||
net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
net.bytebuddy:byte-buddy:1.14.16=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.assertj:assertj-core:3.26.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.sdk:graal-sdk:22.3.1=testRuntimeClasspath
|
org.graalvm.sdk:graal-sdk:23.0.2=testRuntimeClasspath
|
||||||
org.graalvm.truffle:truffle-api:22.3.1=testRuntimeClasspath
|
org.graalvm.truffle:truffle-api:23.0.2=testRuntimeClasspath
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
@@ -24,13 +24,13 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=testCompileClasspath,testImplemen
|
|||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-api:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-engine:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-params:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.junit.jupiter:junit-jupiter-params:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.platform:junit-platform-commons:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-commons:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.platform:junit-platform-engine:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-engine:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit:junit-bom:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.organicdesign:Paguro:3.10.3=testRuntimeClasspath
|
org.organicdesign:Paguro:3.10.3=testRuntimeClasspath
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=testRuntimeClasspath
|
org.snakeyaml:snakeyaml-engine:2.5=testRuntimeClasspath
|
||||||
empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,default,implementationDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeClasspath,runtimeOnlyDependenciesMetadata,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,default,implementationDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeClasspath,runtimeOnlyDependenciesMetadata,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
= User Manual
|
= User Manual
|
||||||
include::../partials/component-attributes.adoc[]
|
include::../partials/component-attributes.adoc[]
|
||||||
|
|
||||||
Quick Links: xref:pkl-cli:index.adoc#installation[Installation] | xref:language-reference:index.adoc[Language Reference]
|
Quick Links:
|
||||||
|
xref:pkl-cli:index.adoc#installation[Installation]
|
||||||
|
| xref:language-reference:index.adoc[Language Reference]
|
||||||
|
| https://pkl-lang.org/package-docs/pkl/current/index.html[Standard Library]
|
||||||
|
|
||||||
Pkl -- pronounced _Pickle_ -- is an embeddable configuration language which provides rich support for data templating and validation.
|
Pkl -- pronounced _Pickle_ -- is an embeddable configuration language which provides rich support for data templating and validation.
|
||||||
It can be used from the command line, integrated in a build pipeline, or embedded in a program.
|
It can be used from the command line, integrated in a build pipeline, or embedded in a program.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// the following attributes must be updated immediately before a release
|
// the following attributes must be updated immediately before a release
|
||||||
|
|
||||||
// pkl version corresponding to current git commit without -dev suffix or git hash
|
// pkl version corresponding to current git commit without -dev suffix or git hash
|
||||||
:pkl-version-no-suffix: 0.25.3
|
:pkl-version-no-suffix: 0.26.3
|
||||||
// tells whether pkl version corresponding to current git commit
|
// tells whether pkl version corresponding to current git commit
|
||||||
// is a release version (:is-release-version: '') or dev version (:!is-release-version:)
|
// is a release version (:is-release-version: '') or dev version (:!is-release-version:)
|
||||||
:is-release-version: ''
|
:is-release-version: ''
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Currently, Pkl must be embedded as a child process, by shelling out to the CLI u
|
|||||||
When embedded, communication between a host application and Pkl happens via message passing.
|
When embedded, communication between a host application and Pkl happens via message passing.
|
||||||
The message passing specification can be found in xref:message-passing-api.adoc[].
|
The message passing specification can be found in xref:message-passing-api.adoc[].
|
||||||
|
|
||||||
For examples of language bindings in practice, review the xref:{uri-pkl-go-github}[pkl-go], or the xref:{uri-pkl-swift-github}[pkl-swift] codebases.
|
For examples of language bindings in practice, review the link:{uri-pkl-go-github}[pkl-go], or the link:{uri-pkl-swift-github}[pkl-swift] codebases.
|
||||||
|
|
||||||
NOTE: Pkl's Java and Kotlin libraries binds to Pkl directly, and do not use message passing.
|
NOTE: Pkl's Java and Kotlin libraries binds to Pkl directly, and do not use message passing.
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,11 @@ outputFormat: String?
|
|||||||
/// The project dependency settings.
|
/// The project dependency settings.
|
||||||
project: Project?
|
project: Project?
|
||||||
|
|
||||||
|
/// Configuration of outgoing HTTP(s) requests.
|
||||||
|
///
|
||||||
|
/// Added in Pkl 0.26.0.
|
||||||
|
http: Http?
|
||||||
|
|
||||||
class ClientResourceReader {
|
class ClientResourceReader {
|
||||||
/// The URI scheme this reader is responsible for reading.
|
/// The URI scheme this reader is responsible for reading.
|
||||||
scheme: String
|
scheme: String
|
||||||
@@ -189,7 +194,62 @@ class Checksums {
|
|||||||
/// The sha-256 checksum of this dependency's metadata.
|
/// The sha-256 checksum of this dependency's metadata.
|
||||||
sha256: String
|
sha256: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Http {
|
||||||
|
/// PEM format certificates to trust when making HTTP requests.
|
||||||
|
///
|
||||||
|
/// If [null], Pkl will trust its own built-in certificates.
|
||||||
|
caCertificates: Binary?
|
||||||
|
|
||||||
|
/// Configuration of the HTTP proxy to use.
|
||||||
|
///
|
||||||
|
/// If [null], uses the operating system's proxy configuration.
|
||||||
|
proxy: Proxy?
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Settings that control how Pkl talks to HTTP proxies.
|
||||||
|
class Proxy {
|
||||||
|
/// The proxy to use for HTTP(S) connections.
|
||||||
|
///
|
||||||
|
/// At the moment, only HTTP proxies are supported.
|
||||||
|
///
|
||||||
|
/// Example:
|
||||||
|
/// ```
|
||||||
|
/// address = "http://my.proxy.example.com:5080"
|
||||||
|
/// ```
|
||||||
|
address: Uri(startsWith("http://"))?
|
||||||
|
|
||||||
|
/// Hosts to which all connections should bypass a proxy.
|
||||||
|
///
|
||||||
|
/// Values can be either hostnames, or IP addresses.
|
||||||
|
/// IP addresses can optionally be provided using [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation).
|
||||||
|
///
|
||||||
|
/// The only wildcard is `"*"`, which disables all proxying.
|
||||||
|
///
|
||||||
|
/// A hostname matches all subdomains.
|
||||||
|
/// For example, `example.com` matches `foo.example.com`, but not `fooexample.com`.
|
||||||
|
/// A hostname that is prefixed with a dot matches the hostname itself,
|
||||||
|
/// so `.example.com` matches `example.com`.
|
||||||
|
///
|
||||||
|
/// Optionally, a port can be specified.
|
||||||
|
/// If a port is omitted, all ports are matched.
|
||||||
|
///
|
||||||
|
/// Example:
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// noProxy {
|
||||||
|
/// "127.0.0.1"
|
||||||
|
/// "169.254.0.0/16"
|
||||||
|
/// "example.com"
|
||||||
|
/// "localhost:5050"
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
noProxy: Listing<String>(isDistinct)
|
||||||
|
}
|
||||||
|
|
||||||
|
typealias Binary = Any // <1>
|
||||||
----
|
----
|
||||||
|
<1> link:{uri-messagepack-bin}[bin format] (not expressable in Pkl)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
[source,json5]
|
[source,json5]
|
||||||
@@ -451,6 +511,8 @@ The response to <<list-resources-request>>.
|
|||||||
If successful, `pathElements` is set.
|
If successful, `pathElements` is set.
|
||||||
Otherwise, `error` is set.
|
Otherwise, `error` is set.
|
||||||
|
|
||||||
|
If neither are set, `pathElements` default to an empty list.
|
||||||
|
|
||||||
[source,pkl]
|
[source,pkl]
|
||||||
----
|
----
|
||||||
/// A number identifying this request.
|
/// A number identifying this request.
|
||||||
@@ -507,6 +569,8 @@ The response to <<list-modules-request>>.
|
|||||||
If successful, `pathElements` is set.
|
If successful, `pathElements` is set.
|
||||||
Otherwise, `error` is set.
|
Otherwise, `error` is set.
|
||||||
|
|
||||||
|
If neither are set, `pathElements` default to an empty list.
|
||||||
|
|
||||||
[source,pkl]
|
[source,pkl]
|
||||||
----
|
----
|
||||||
/// A number identifying this request.
|
/// A number identifying this request.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import org.pkl.config.java.Config;
|
import org.pkl.config.java.Config;
|
||||||
import org.pkl.config.java.ConfigEvaluator;
|
import org.pkl.config.java.ConfigEvaluator;
|
||||||
import org.pkl.config.java.JavaType;
|
import org.pkl.config.java.JavaType;
|
||||||
|
import org.pkl.core.ModuleSource;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@@ -11,8 +12,8 @@ public class JavaConfigExample {
|
|||||||
// tag::usage[]
|
// tag::usage[]
|
||||||
Config config;
|
Config config;
|
||||||
try (var evaluator = ConfigEvaluator.preconfigured()) { // <1>
|
try (var evaluator = ConfigEvaluator.preconfigured()) { // <1>
|
||||||
config = evaluator.evaluateText(
|
config = evaluator.evaluate(
|
||||||
"pigeon { age = 5; diet = \"Seeds\" }"); // <2>
|
ModuleSource.text("pigeon { age = 5; diet = new Listing { \"Seeds\" } }")); // <2>
|
||||||
}
|
}
|
||||||
var pigeon = config.get("pigeon"); // <3>
|
var pigeon = config.get("pigeon"); // <3>
|
||||||
var age = pigeon.get("age").as(int.class); // <4>
|
var age = pigeon.get("age").as(int.class); // <4>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ See xref:pkl-gradle:index.adoc#installation[Installation] in the Gradle plugin c
|
|||||||
=== Java Library
|
=== Java Library
|
||||||
|
|
||||||
The `pkl-codegen-java` library is available {uri-pkl-codgen-java-maven-module}[from Maven Central].
|
The `pkl-codegen-java` library is available {uri-pkl-codgen-java-maven-module}[from Maven Central].
|
||||||
It requires Java 11 or higher.
|
It requires Java 17 or higher.
|
||||||
|
|
||||||
ifndef::is-release-version[]
|
ifndef::is-release-version[]
|
||||||
NOTE: Snapshots are published to repository `{uri-sonatype}`.
|
NOTE: Snapshots are published to repository `{uri-sonatype}`.
|
||||||
@@ -36,13 +36,32 @@ To use the library in a Gradle project, declare the following dependency:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
dependencies {
|
||||||
|
implementation("org.pkl-lang:pkl-codegen-java:{pkl-artifact-version}")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
[source,groovy,subs="+attributes"]
|
[source,groovy,subs="+attributes"]
|
||||||
----
|
----
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.pkl-lang:pkl-codegen-java:{pkl-artifact-version}"
|
implementation "org.pkl-lang:pkl-codegen-java:{pkl-artifact-version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -54,25 +73,6 @@ ifndef::is-release-version[]
|
|||||||
endif::[]
|
endif::[]
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
dependencies {
|
|
||||||
compile("org.pkl-lang:pkl-codegen-java:{pkl-artifact-version}")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
==== Maven
|
==== Maven
|
||||||
@@ -164,13 +164,6 @@ This annotation is required to have `java.lang.annotation.ElementType.TYPE_USE`
|
|||||||
or it may generate code that does not compile.
|
or it may generate code that does not compile.
|
||||||
====
|
====
|
||||||
|
|
||||||
.--implement-serializable
|
|
||||||
[%collapsible]
|
|
||||||
====
|
|
||||||
Default: (flag not set) +
|
|
||||||
Whether to make generated classes implement `java.io.Serializable`.
|
|
||||||
====
|
|
||||||
|
|
||||||
Common code generator options:
|
Common code generator options:
|
||||||
|
|
||||||
include::{partialsdir}/cli-codegen-options.adoc[]
|
include::{partialsdir}/cli-codegen-options.adoc[]
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ It offers a higher-level API specifically designed for consuming application run
|
|||||||
== Installation
|
== Installation
|
||||||
|
|
||||||
The _pkl-config-java_ library is available {uri-pkl-config-java-maven-module}[from Maven Central].
|
The _pkl-config-java_ library is available {uri-pkl-config-java-maven-module}[from Maven Central].
|
||||||
It requires Java 11 or higher.
|
It requires Java 17 or higher.
|
||||||
|
|
||||||
=== Gradle
|
=== Gradle
|
||||||
|
|
||||||
@@ -31,13 +31,32 @@ To use the library in a Gradle project, declare the following dependency:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
dependencies {
|
||||||
|
implementation("org.pkl-lang:pkl-config-java:{pkl-artifact-version}")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
[source,groovy,subs="+attributes"]
|
[source,groovy,subs="+attributes"]
|
||||||
----
|
----
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.pkl-lang:pkl-config-java:{pkl-artifact-version}"
|
implementation "org.pkl-lang:pkl-config-java:{pkl-artifact-version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
ifdef::is-release-version[]
|
ifdef::is-release-version[]
|
||||||
@@ -51,25 +70,6 @@ repositories {
|
|||||||
}
|
}
|
||||||
endif::[]
|
endif::[]
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
dependencies {
|
|
||||||
compile("org.pkl-lang:pkl-config-java:{pkl-artifact-version}")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
Unlike `pkl-config-java`, `pkl-config-java__-all__` is a fat Jar with renamed third-party packages to avoid version conflicts.
|
Unlike `pkl-config-java`, `pkl-config-java__-all__` is a fat Jar with renamed third-party packages to avoid version conflicts.
|
||||||
|
|||||||
@@ -21,3 +21,57 @@ Relative paths are resolved against the working directory.
|
|||||||
Default: (not set) +
|
Default: (not set) +
|
||||||
Flag that indicates to generate config classes for use with Spring Boot.
|
Flag that indicates to generate config classes for use with Spring Boot.
|
||||||
====
|
====
|
||||||
|
|
||||||
|
.--implement-serializable
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: (not set) +
|
||||||
|
Whether to make generated classes implement `java.io.Serializable`.
|
||||||
|
====
|
||||||
|
|
||||||
|
.--rename
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: (none) +
|
||||||
|
Example: `foo.=com.example.foo.` +
|
||||||
|
Allows to change default class and package names (derived from Pkl module names) in the generated code.
|
||||||
|
|
||||||
|
When you need the generated class or package names to be different from the default names derived from the Pkl module names, you can define a rename mapping, where the key is the original Pkl module name prefix, and the value is its replacement.
|
||||||
|
When you do, the generated code's `package` declarations, class names, as well as file locations, will be modified according to this mapping.
|
||||||
|
|
||||||
|
The prefixes are replaced literally, which means that dots at the end are important.
|
||||||
|
If you want to rename packages only, in most cases, you must ensure that you have an ending dot on both sides of a mapping (except for an empty mapping, if you use it), otherwise you may get unexpected results:
|
||||||
|
|
||||||
|
----
|
||||||
|
// Assuming the following arguments:
|
||||||
|
--rename com.foo.=x // Dot on the left only
|
||||||
|
--rename org.bar=y. // Dot on the right only
|
||||||
|
--rename net.baz=z // No dots
|
||||||
|
|
||||||
|
// The following renames will be made:
|
||||||
|
"com.foo.bar" -> "xbar" // Target prefix merged into the suffix
|
||||||
|
"org.bar.baz" -> "y..baz" // Double dot, invalid name
|
||||||
|
"net.baz.qux" -> "z.qux" // Looks okay, but...
|
||||||
|
"net.bazqux" -> "zqux" // ...may cut the name in the middle.
|
||||||
|
----
|
||||||
|
|
||||||
|
When computing the appropriate target name, the longest matching prefix is used:
|
||||||
|
|
||||||
|
----
|
||||||
|
// Assuming the following arguments:
|
||||||
|
--rename com.foo.Main=w.Main
|
||||||
|
--rename com.foo.=x.
|
||||||
|
--rename com.=y.
|
||||||
|
--rename =z.
|
||||||
|
|
||||||
|
// The following renames will be made:
|
||||||
|
com.foo.Main -> w.Main
|
||||||
|
com.foo.bar -> x.bar
|
||||||
|
com.baz.qux -> y.baz.qux
|
||||||
|
org.foo.bar -> z.org.foo.bar
|
||||||
|
----
|
||||||
|
|
||||||
|
Repeat this option to define multiple mappings.
|
||||||
|
Keys can be arbitrary strings, including an empty string.
|
||||||
|
Values must be valid dot-separated fully qualified class name prefixes, possibly terminated by a dot.
|
||||||
|
====
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import org.pkl.config.java.ConfigEvaluator
|
import org.pkl.config.java.ConfigEvaluator
|
||||||
import org.pkl.config.kotlin.forKotlin
|
import org.pkl.config.kotlin.forKotlin
|
||||||
import org.pkl.config.kotlin.to
|
import org.pkl.config.kotlin.to
|
||||||
|
import org.pkl.core.ModuleSource
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
// the pkl/pkl-examples repo has a similar example
|
// the pkl/pkl-examples repo has a similar example
|
||||||
@@ -12,7 +13,7 @@ class KotlinConfigExample {
|
|||||||
// tag::usage[]
|
// tag::usage[]
|
||||||
val evaluator = ConfigEvaluator.preconfigured().forKotlin() // <1>
|
val evaluator = ConfigEvaluator.preconfigured().forKotlin() // <1>
|
||||||
val config = evaluator.use { // <2>
|
val config = evaluator.use { // <2>
|
||||||
it.evaluateText("""pigeon { age = 5; diet = "Seeds" }""")
|
it.evaluate(ModuleSource.text("""pigeon { age = 5; diet = new Listing { "Seeds" } }"""))
|
||||||
}
|
}
|
||||||
val pigeon = config["pigeon"] // <3>
|
val pigeon = config["pigeon"] // <3>
|
||||||
val age = pigeon["age"].to<Int>() // <4>
|
val age = pigeon["age"].to<Int>() // <4>
|
||||||
@@ -25,7 +26,7 @@ class KotlinConfigExample {
|
|||||||
// tag::nullable[]
|
// tag::nullable[]
|
||||||
val evaluator = ConfigEvaluator.preconfigured().forKotlin()
|
val evaluator = ConfigEvaluator.preconfigured().forKotlin()
|
||||||
val config = evaluator.use {
|
val config = evaluator.use {
|
||||||
it.evaluateText("name = null") // <1>
|
it.evaluate(ModuleSource.text("name = null")) // <1>
|
||||||
}
|
}
|
||||||
val name = config["name"].to<String?>() // <2>
|
val name = config["name"].to<String?>() // <2>
|
||||||
// end::nullable[]
|
// end::nullable[]
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ See xref:pkl-gradle:index.adoc#installation[Installation] in the Gradle plugin c
|
|||||||
=== Java Library
|
=== Java Library
|
||||||
|
|
||||||
The `pkl-codegen-kotlin` library is available {uri-pkl-codegen-kotlin-maven-module}[from Maven Central].
|
The `pkl-codegen-kotlin` library is available {uri-pkl-codegen-kotlin-maven-module}[from Maven Central].
|
||||||
It requires Java 11 or higher and Kotlin 1.3 or higher.
|
It requires Java 17 or higher and Kotlin 1.3 or higher.
|
||||||
|
|
||||||
==== Gradle
|
==== Gradle
|
||||||
|
|
||||||
@@ -27,13 +27,32 @@ To use the library in a Gradle project, declare the following dependency:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
dependencies {
|
||||||
|
implementation("org.pkl-lang:pkl-codegen-kotlin:{pkl-artifact-version}")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
[source,groovy,subs="+attributes"]
|
[source,groovy,subs="+attributes"]
|
||||||
----
|
----
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.pkl-lang:pkl-codegen-kotlin:{pkl-artifact-version}"
|
implementation "org.pkl-lang:pkl-codegen-kotlin:{pkl-artifact-version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -45,25 +64,6 @@ ifndef::is-release-version[]
|
|||||||
endif::[]
|
endif::[]
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
dependencies {
|
|
||||||
compile("org.pkl-lang:pkl-codegen-kotlin:{pkl-artifact-version}")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
==== Maven
|
==== Maven
|
||||||
@@ -109,7 +109,7 @@ To run the CLI, execute the library Jar or its `org.pkl.codegen.kotlin.Main` mai
|
|||||||
*Synopsis:* `java -cp <classpath> -jar pkl-codegen-kotlin.jar [<options>] <modules>`
|
*Synopsis:* `java -cp <classpath> -jar pkl-codegen-kotlin.jar [<options>] <modules>`
|
||||||
|
|
||||||
`<modules>`::
|
`<modules>`::
|
||||||
The absolute or relative URIs of the modules to generate classe for.
|
The absolute or relative URIs of the modules to generate classes for.
|
||||||
Relative URIs are resolved against the working directory.
|
Relative URIs are resolved against the working directory.
|
||||||
|
|
||||||
==== Options
|
==== Options
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ We recommend that Kotlin projects depend on this library instead of _pkl-config-
|
|||||||
== Installation
|
== Installation
|
||||||
|
|
||||||
The _pkl-config-kotlin_ library is available {uri-pkl-config-kotlin-maven-module}[from Maven Central].
|
The _pkl-config-kotlin_ library is available {uri-pkl-config-kotlin-maven-module}[from Maven Central].
|
||||||
It requires Java 11 or higher and Kotlin 1.5 or higher.
|
It requires Java 17 or higher and Kotlin 1.5 or higher.
|
||||||
|
|
||||||
=== Gradle
|
=== Gradle
|
||||||
|
|
||||||
@@ -20,13 +20,32 @@ To use the library in a Gradle project, declare the following dependency:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
dependencies {
|
||||||
|
implementation("org.pkl-lang:pkl-config-kotlin:{pkl-artifact-version}")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
[source,groovy,subs="+attributes"]
|
[source,groovy,subs="+attributes"]
|
||||||
----
|
----
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.pkl-lang:pkl-config-kotlin:{pkl-artifact-version}"
|
implementation "org.pkl-lang:pkl-config-kotlin:{pkl-artifact-version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -38,25 +57,6 @@ ifndef::is-release-version[]
|
|||||||
endif::[]
|
endif::[]
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
dependencies {
|
|
||||||
compile("org.pkl-lang:pkl-config-kotlin:{pkl-artifact-version}")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
=== Maven
|
=== Maven
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ A code comment that starts with a double-slash (`//`) and runs until the end of
|
|||||||
----
|
----
|
||||||
|
|
||||||
Block comment::
|
Block comment::
|
||||||
A nestable multiline comment which is typically used to comment out code.
|
A nestable multiline comment, which is typically used to comment out code.
|
||||||
Starts with `+/*+` and ends with `+*/+`.
|
Starts with `+/*+` and ends with `+*/+`.
|
||||||
+
|
+
|
||||||
[source%parsed,{pkl}]
|
[source%parsed,{pkl}]
|
||||||
@@ -176,7 +176,7 @@ A value of type link:{uri-stdlib-Float}[Float] is a 64-bit link:{uri-double-prec
|
|||||||
|
|
||||||
Float literals use decimal notation.
|
Float literals use decimal notation.
|
||||||
They consist of an integer part, decimal point, fractional part, and exponent part.
|
They consist of an integer part, decimal point, fractional part, and exponent part.
|
||||||
The integer and exponent part are optional.
|
The integer and exponent parts are optional.
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -202,12 +202,12 @@ negativeInfinity = -Infinity
|
|||||||
The link:{uri-stdlib-NaN}[NaN] and link:{uri-stdlib-Infinity}[Infinity] properties are defined in the standard library.
|
The link:{uri-stdlib-NaN}[NaN] and link:{uri-stdlib-Infinity}[Infinity] properties are defined in the standard library.
|
||||||
|
|
||||||
Floats support the same comparison and arithmetic operators as integers.
|
Floats support the same comparison and arithmetic operators as integers.
|
||||||
Float literals with zero fractional part can be safely replaced with integer literals.
|
Float literals with a fractional part of zero can be safely replaced with integer literals.
|
||||||
For example, it is safe to write `1.3 * 42` instead of `1.3 * 42.0`.
|
For example, it is safe to write `1.3 * 42` instead of `1.3 * 42.0`.
|
||||||
|
|
||||||
Floats can also include the same underscore separater as integers. For example, `1_000.4_400` is a float whose value is equivalent to `1000.4400`.
|
Floats can also include the same underscore separator as integers. For example, `1_000.4_400` is a float whose value is equivalent to `1000.4400`.
|
||||||
|
|
||||||
TIP: As integers are more convenient to use than floats with zero fractional part, we recommend to require `x: Number` instead of `x: Float` in type annotations.
|
TIP: As integers are more convenient to use than floats with a fractional part of zero, we recommend requiring `x: Number` instead of `x: Float` in type annotations.
|
||||||
|
|
||||||
To restrict a float to a finite value, use the link:{uri-stdlib-isFinite}[isFinite] <<type-constraints,type constraint>>:
|
To restrict a float to a finite value, use the link:{uri-stdlib-isFinite}[isFinite] <<type-constraints,type constraint>>:
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ String content and closing delimiter must each start on a new line.
|
|||||||
The content of a multiline string starts on the first line after the opening quotes and ends on the last line before the closing quotes.
|
The content of a multiline string starts on the first line after the opening quotes and ends on the last line before the closing quotes.
|
||||||
Line breaks are included in the string and normalized to `\n`.
|
Line breaks are included in the string and normalized to `\n`.
|
||||||
|
|
||||||
The previous multiline string is equivalent to this single line string.
|
The previous multiline string is equivalent to this single-line string.
|
||||||
Notice that there is no leading or trailing whitespace.
|
Notice that there is no leading or trailing whitespace.
|
||||||
|
|
||||||
[source%tested,{pkl-expr}]
|
[source%tested,{pkl-expr}]
|
||||||
@@ -325,7 +325,7 @@ Notice that there is no leading or trailing whitespace.
|
|||||||
"Although the Dodo is extinct,\nthe species will be remembered."
|
"Although the Dodo is extinct,\nthe species will be remembered."
|
||||||
----
|
----
|
||||||
|
|
||||||
String interpolation, character escape sequences, and Unicode escape sequences work the same as for single line strings:
|
String interpolation, character escape sequences, and Unicode escape sequences work the same as for single-line strings:
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -337,7 +337,7 @@ the species will be remembered.
|
|||||||
----
|
----
|
||||||
|
|
||||||
Each content line must begin with the same whitespace characters as the line containing the closing delimiter,
|
Each content line must begin with the same whitespace characters as the line containing the closing delimiter,
|
||||||
which are not included in the string. Any further leading whitespace characters are preserved.
|
which is not included in the string. Any further leading whitespace characters are preserved.
|
||||||
In other words, line indentation is controlled by indenting lines relative to the closing delimiter.
|
In other words, line indentation is controlled by indenting lines relative to the closing delimiter.
|
||||||
|
|
||||||
In the following string, lines have no leading whitespace:
|
In the following string, lines have no leading whitespace:
|
||||||
@@ -368,7 +368,7 @@ str = """
|
|||||||
=== Custom String Delimiters
|
=== Custom String Delimiters
|
||||||
|
|
||||||
Some strings contain many verbatim backslash (`\`) or quote (`"`) characters.
|
Some strings contain many verbatim backslash (`\`) or quote (`"`) characters.
|
||||||
A good example is regular expressions, which make frequent use of backslash characters for their own escaping.
|
A good example is regular expressions, which make frequent use of backslash characters for escaping.
|
||||||
In such cases, using the escape sequences `\\` and `\"` quickly becomes tedious and hampers readability.
|
In such cases, using the escape sequences `\\` and `\"` quickly becomes tedious and hampers readability.
|
||||||
|
|
||||||
Instead, leading/closing string delimiters can be customized to start/end with a pound sign (`\#`).
|
Instead, leading/closing string delimiters can be customized to start/end with a pound sign (`\#`).
|
||||||
@@ -389,7 +389,7 @@ bird = "Dodo"
|
|||||||
str = #" \\\\\ \#n \#u{12AF} \#(bird) """"" "#
|
str = #" \\\\\ \#n \#u{12AF} \#(bird) """"" "#
|
||||||
----
|
----
|
||||||
|
|
||||||
More generally, string delimiters and escape character can be customized to contain _n_ pound signs each, for n >= 1.
|
More generally, string delimiters and escape characters can be customized to contain _n_ pound signs each, for n >= 1.
|
||||||
|
|
||||||
In the following string, _n_ is 2. As a result, the string content is interpreted verbatim:
|
In the following string, _n_ is 2. As a result, the string content is interpreted verbatim:
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ xySeconds = (x + y).s // <2>
|
|||||||
A value of type link:{uri-stdlib-DataSize}[DataSize] has a _value_ component of type `Number` and a _unit_ component of type `String`.
|
A value of type link:{uri-stdlib-DataSize}[DataSize] has a _value_ component of type `Number` and a _unit_ component of type `String`.
|
||||||
The unit component is constrained to the units defined in link:{uri-stdlib-DataSizeUnit}[DataSizeUnit].
|
The unit component is constrained to the units defined in link:{uri-stdlib-DataSizeUnit}[DataSizeUnit].
|
||||||
|
|
||||||
Data sizes with decimal unit (factor 1000) are constructed with the following `Number` properties:
|
Data sizes with decimal units (factor 1000) are constructed with the following `Number` properties:
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -503,7 +503,7 @@ datasize5 = 5.tb // terabytes
|
|||||||
datasize6 = 5.pb // petabytes (largest unit)
|
datasize6 = 5.pb // petabytes (largest unit)
|
||||||
----
|
----
|
||||||
|
|
||||||
Data sizes with binary unit (factor 1024) are constructed with the following `Number` properties:
|
Data sizes with binary units (factor 1024) are constructed with the following `Number` properties:
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -571,7 +571,7 @@ xyKibibytes = (x + y).kib // <2>
|
|||||||
|
|
||||||
An object is an ordered collection of _values_ indexed by _name_.
|
An object is an ordered collection of _values_ indexed by _name_.
|
||||||
|
|
||||||
An object's key–value pairs are called its _properties_.
|
An object's key-value pairs are called its _properties_.
|
||||||
Property values are lazily evaluated on the first read.
|
Property values are lazily evaluated on the first read.
|
||||||
|
|
||||||
Because Pkl's objects differ in important ways from objects in general-purpose programming languages,
|
Because Pkl's objects differ in important ways from objects in general-purpose programming languages,
|
||||||
@@ -621,12 +621,12 @@ dodo {
|
|||||||
As you probably guessed, the nested property `class` can be accessed with `dodo.taxonomy.class`.
|
As you probably guessed, the nested property `class` can be accessed with `dodo.taxonomy.class`.
|
||||||
|
|
||||||
Like all values, objects are _immutable_, which is just a fancy (and short!) way to say that their properties never change.
|
Like all values, objects are _immutable_, which is just a fancy (and short!) way to say that their properties never change.
|
||||||
So what happens when Pigeon moves to a different street? Do we have to construct a new object from scratch?
|
So what happens when Dodo moves to a different street? Do we have to construct a new object from scratch?
|
||||||
|
|
||||||
[[amending-objects]]
|
[[amending-objects]]
|
||||||
=== Amending Objects
|
=== Amending Objects
|
||||||
|
|
||||||
Fortunately we don't have to.
|
Fortunately, we don't have to.
|
||||||
An object can be _amended_ to form a new object that only differs in selected properties.
|
An object can be _amended_ to form a new object that only differs in selected properties.
|
||||||
Here is how this looks:
|
Here is how this looks:
|
||||||
|
|
||||||
@@ -649,13 +649,13 @@ As you can see, it is easy to construct a new object that overrides selected pro
|
|||||||
even if, as in our example, the overridden property is nested inside another object.
|
even if, as in our example, the overridden property is nested inside another object.
|
||||||
|
|
||||||
NOTE: If this way of constructing new objects from existing objects reminds you of prototypical inheritance, you are spot-on:
|
NOTE: If this way of constructing new objects from existing objects reminds you of prototypical inheritance, you are spot-on:
|
||||||
Pkl objects use protoypical inheritance as known from languages such as JavaScript.
|
Pkl objects use prototypical inheritance as known from languages such as JavaScript.
|
||||||
But unlike in JavaScript, their prototype chain cannot be directly accessed or even be modified.
|
But unlike in JavaScript, their prototype chain cannot be directly accessed or even modified.
|
||||||
Another difference is that in Pkl, object properties are late-bound. Read on to see what this means.
|
Another difference is that in Pkl, object properties are late-bound. Read on to see what this means.
|
||||||
|
|
||||||
[[amends-declaration]]
|
[[amends-declaration]]
|
||||||
[NOTE]
|
[NOTE]
|
||||||
.Amends expressions vs. amends declarations
|
.Amends declaration vs. amends expression
|
||||||
====
|
====
|
||||||
|
|
||||||
The <<defining-objects,defining objects>> and <<amending-objects,amending objects>> sections cover two notations that are both a form of amending; called an _amends declaration_ and an _amends expression_, respectively.
|
The <<defining-objects,defining objects>> and <<amending-objects,amending objects>> sections cover two notations that are both a form of amending; called an _amends declaration_ and an _amends expression_, respectively.
|
||||||
@@ -671,16 +671,16 @@ parrot = (pigeon) { // <2>
|
|||||||
name = "Parrot"
|
name = "Parrot"
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> Amends expression.
|
<1> Amends declaration.
|
||||||
<2> Amends declaration.
|
<2> Amends expression.
|
||||||
|
|
||||||
An amends declaration amends the property of the same name in a module's parent module, if the parent property exists.
|
An amends declaration amends a property of the same name if the property exists within a parent module.
|
||||||
Otherwise, an amends declaration implicitly amends {uri-stdlib-Dynamic}[Dynamic].
|
Otherwise, an amends declaration implicitly amends {uri-stdlib-Dynamic}[Dynamic].
|
||||||
|
|
||||||
Another way to think about an amends declaration is that it is shorthand for assignment.
|
Another way to think about an amends declaration is that it is shorthand for assignment.
|
||||||
In practical terms, `pigeon {}` is the same as `pigeon = super.pigeon {}`.
|
In practical terms, `pigeon {}` is the same as `pigeon = (super.pigeon) {}`.
|
||||||
|
|
||||||
Amending object bodies can be chained for both an amends expression and an amends declaration.
|
Amending object bodies can be chained for both an amends declaration and an amends expression.
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -696,8 +696,8 @@ dodo = (pigeon) {
|
|||||||
extinct = true
|
extinct = true
|
||||||
} // <2>
|
} // <2>
|
||||||
----
|
----
|
||||||
<1> Chained amends expression (`pigeon { ... } { ... }` is the amends expression).
|
<1> Chained amends declaration.
|
||||||
<2> Chained amends declaration.
|
<2> Chained amends expression (`(pigeon) { ... } { ... }` is the amends expression).
|
||||||
====
|
====
|
||||||
|
|
||||||
[[late-binding]]
|
[[late-binding]]
|
||||||
@@ -737,13 +737,13 @@ This is what we mean when we say that object properties are _late-bound_.
|
|||||||
====
|
====
|
||||||
A good analogy is that object properties behave like spreadsheet cells.
|
A good analogy is that object properties behave like spreadsheet cells.
|
||||||
When they are linked, changes to "downstream" properties automatically propagate to "upstream" properties.
|
When they are linked, changes to "downstream" properties automatically propagate to "upstream" properties.
|
||||||
The main difference is, editing a spreadsheet cell changes the state of the spreadsheet,
|
The main difference is that editing a spreadsheet cell changes the state of the spreadsheet,
|
||||||
whereas "editing" a property results in a new object, leaving the original object untouched.
|
whereas "editing" a property results in a new object, leaving the original object untouched.
|
||||||
It is as if you made a copy of the entire spreadsheet whenever you edited a cell!
|
It is as if you made a copy of the entire spreadsheet whenever you edited a cell!
|
||||||
====
|
====
|
||||||
|
|
||||||
Late binding of properties is an incredibly useful feature for a configuration language.
|
Late binding of properties is an incredibly useful feature for a configuration language.
|
||||||
It is used extensively in Pkl code (especially in templates), and is the key to understanding how Pkl works.
|
It is used extensively in Pkl code (especially in templates) and is the key to understanding how Pkl works.
|
||||||
|
|
||||||
=== Transforming Objects
|
=== Transforming Objects
|
||||||
|
|
||||||
@@ -855,7 +855,7 @@ faultyPigeon = new Bird {
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Evaluating this, gives:
|
Evaluating this gives:
|
||||||
|
|
||||||
[source,shell,subs="quotes"]
|
[source,shell,subs="quotes"]
|
||||||
----
|
----
|
||||||
@@ -914,7 +914,8 @@ pigeon = new Dynamic { // <1>
|
|||||||
|
|
||||||
==== Hidden Properties
|
==== Hidden Properties
|
||||||
|
|
||||||
A property with modifier `hidden` is omitted from rendered output and from object conversions.
|
A property with the modifier `hidden` is omitted from the rendered output and object conversions.
|
||||||
|
Hidden properties are also ignored when evaluating equality or hashing (e.g. for `Mapping` or `Map` keys).
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -933,12 +934,19 @@ pigeon = new Bird { // <3>
|
|||||||
pigeonInIndex = pigeon.nameAndLifespanInIndex // <4>
|
pigeonInIndex = pigeon.nameAndLifespanInIndex // <4>
|
||||||
|
|
||||||
pigeonDynamic = pigeon.toDynamic() // <5>
|
pigeonDynamic = pigeon.toDynamic() // <5>
|
||||||
|
|
||||||
|
favoritePigeon = (pigeon) {
|
||||||
|
nameAndLifespanInIndex = "Bettie, \(lifespan)"
|
||||||
|
}
|
||||||
|
|
||||||
|
samePigeon = pigeon == favoritePigeon // <6>
|
||||||
----
|
----
|
||||||
<1> Properties defined as `hidden` are accessible on any `Bird` instance, but not output by default.
|
<1> Properties defined as `hidden` are accessible on any `Bird` instance, but not output by default.
|
||||||
<2> Non-hidden properties can refer to hidden properties as usual.
|
<2> Non-hidden properties can refer to hidden properties as usual.
|
||||||
<3> `pigeon` is an object with _four_ properties, but is rendered with _three_ properties.
|
<3> `pigeon` is an object with _four_ properties, but is rendered with _three_ properties.
|
||||||
<4> Accessing a `hidden` property from outside the class and object is like any other property.
|
<4> Accessing a `hidden` property from outside the class and object is like any other property.
|
||||||
<5> Object conversions omit hidden properties, so the resulting `Dynamic` has three properties.
|
<5> Object conversions omit hidden properties, so the resulting `Dynamic` has three properties.
|
||||||
|
<6> Objects that differ only in `hidden` property values are considered equal
|
||||||
|
|
||||||
Invoking Pkl on this file produces the following result.
|
Invoking Pkl on this file produces the following result.
|
||||||
|
|
||||||
@@ -955,10 +963,16 @@ pigeonDynamic {
|
|||||||
lifespan = 8
|
lifespan = 8
|
||||||
nameSignWidth = 9
|
nameSignWidth = 9
|
||||||
}
|
}
|
||||||
|
favoritePigeon {
|
||||||
|
name = "Pigeon"
|
||||||
|
lifespan = 8
|
||||||
|
nameSignWidth = 9
|
||||||
|
}
|
||||||
|
samePigeon = true
|
||||||
----
|
----
|
||||||
|
|
||||||
==== Local properties
|
==== Local properties
|
||||||
A property with modifier `local` can only be referenced in the lexical scope of its definition.
|
A property with the modifier `local` can only be referenced in the lexical scope of its definition.
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -989,8 +1003,8 @@ Because a `local` property is added to the lexical scope, but not (observably) t
|
|||||||
====
|
====
|
||||||
|
|
||||||
An _import clause_ defines a local property in the containing module.
|
An _import clause_ defines a local property in the containing module.
|
||||||
This means `import "someModule.pkl"` is equivalent to `local someModule = import("someModule.pkl")`.
|
This means `import "someModule.pkl"` is effectively `const local someModule = import("someModule.pkl")`.
|
||||||
Also, `import "someModule.pkl" as otherName` is equivalent to `local otherName = import("someModule.pkl")`.
|
Also, `import "someModule.pkl" as otherName` is effectively `const local otherName = import("someModule.pkl")`.
|
||||||
====
|
====
|
||||||
|
|
||||||
[[fixed-properties]]
|
[[fixed-properties]]
|
||||||
@@ -1027,7 +1041,7 @@ birds { // <2>
|
|||||||
<1> Error: cannot assign to fixed property `laysEggs`
|
<1> Error: cannot assign to fixed property `laysEggs`
|
||||||
<2> Error: cannot amend fixed property `birds`
|
<2> Error: cannot amend fixed property `birds`
|
||||||
|
|
||||||
When extending a class and overriding an existing property definition, the fixed-ness of the overridden property must be preserved.
|
When extending a class and overriding an existing property definition, the fixedness of the overridden property must be preserved.
|
||||||
If the property in the parent class is declared `fixed`, the child property must also be declared `fixed`.
|
If the property in the parent class is declared `fixed`, the child property must also be declared `fixed`.
|
||||||
If the property in the parent class is not declared `fixed`, the child property may not add the `fixed` modifier.
|
If the property in the parent class is not declared `fixed`, the child property may not add the `fixed` modifier.
|
||||||
|
|
||||||
@@ -1047,7 +1061,7 @@ class Penguin extends Bird {
|
|||||||
<2> Error: modifier `fixed` cannot be applied to property `name`.
|
<2> Error: modifier `fixed` cannot be applied to property `name`.
|
||||||
|
|
||||||
The `fixed` modifier is useful for defining properties that are meant to be derived from other properties.
|
The `fixed` modifier is useful for defining properties that are meant to be derived from other properties.
|
||||||
In the following snippet, property `result` is not meant to be assigned to, because it is derived
|
In the following snippet, the property `result` is not meant to be assigned to, because it is derived
|
||||||
from other properties.
|
from other properties.
|
||||||
|
|
||||||
[source%parsed,{pkl}]
|
[source%parsed,{pkl}]
|
||||||
@@ -1138,7 +1152,7 @@ const bird: Bird = new {
|
|||||||
----
|
----
|
||||||
<1> `lifespan` is declared within property `bird`. `speciesName` resolves to `this.speciesName`, where `this` is a value within property `bird`.
|
<1> `lifespan` is declared within property `bird`. `speciesName` resolves to `this.speciesName`, where `this` is a value within property `bird`.
|
||||||
|
|
||||||
NOTE: Because `const` members can only reference its own values, or other `const` members, they are not <<late-binding,late bound>>.
|
NOTE: Because `const` members can only reference themselves and other `const` members, they are not <<late-binding,late bound>>.
|
||||||
|
|
||||||
The `const` modifier implies that it is also <<fixed-properties,fixed>>.
|
The `const` modifier implies that it is also <<fixed-properties,fixed>>.
|
||||||
Therefore, the same rules that apply to `fixed` also apply to `const`:
|
Therefore, the same rules that apply to `fixed` also apply to `const`:
|
||||||
@@ -1147,9 +1161,13 @@ Therefore, the same rules that apply to `fixed` also apply to `const`:
|
|||||||
* The const-ness of a property or method must be preserved when it is overridden by a child class.
|
* The const-ness of a property or method must be preserved when it is overridden by a child class.
|
||||||
|
|
||||||
[[class-and-annotation-const]]
|
[[class-and-annotation-const]]
|
||||||
*Class and Annotation Scoping*
|
*Class, Annotation, and Typealias Scoping*
|
||||||
|
|
||||||
Within a class or annotation body, any reference to a property or method of its enclosing module requires that the referenced member is `const`.
|
In these following scenarios, any reference to a property or method of its enclosing module requires that the referenced member is `const`:
|
||||||
|
|
||||||
|
* Class body
|
||||||
|
* Annotation body
|
||||||
|
* Typealiased constrained type
|
||||||
|
|
||||||
.invalid2.pkl
|
.invalid2.pkl
|
||||||
[source%parsed,{pkl}]
|
[source%parsed,{pkl}]
|
||||||
@@ -1162,15 +1180,18 @@ class Bird {
|
|||||||
|
|
||||||
@Deprecated { message = "Replace with \(pigeonName)" } // <2>
|
@Deprecated { message = "Replace with \(pigeonName)" } // <2>
|
||||||
oldPigeonName: String
|
oldPigeonName: String
|
||||||
|
|
||||||
|
typealias IsPigeonName = String(pigeonName) // <3>
|
||||||
----
|
----
|
||||||
<1> Error: cannot reference non-const property `pigeonName` from a class.
|
<1> Error: cannot reference non-const property `pigeonName` from a class.
|
||||||
<2> Error: cannot reference non-const property `pigeonName` from an annotation.
|
<2> Error: cannot reference non-const property `pigeonName` from an annotation.
|
||||||
|
<3> Error: cannot reference non-const property `pigeonname` from a typealias.
|
||||||
|
|
||||||
This rule exists because classes and annotations are not <<late-binding,late bound>>;
|
This rule exists because classes, annotations, and typealiases are not <<late-binding,late bound>>;
|
||||||
it is not possible to change the definition of a class nor annotation by amending the module
|
it is not possible to change the definition of these members by amending the module
|
||||||
where it is defined.
|
where it is defined.
|
||||||
|
|
||||||
Generally, there are two strategies for referencing a property from a class or annotation:
|
Generally, there are two strategies for referencing such properties:
|
||||||
|
|
||||||
*Add the `const` modifier to the referenced property*
|
*Add the `const` modifier to the referenced property*
|
||||||
|
|
||||||
@@ -1187,7 +1208,7 @@ One solution is to add the `const` modifier to the property being referenced.
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
This solution makes sense if `pigeonName` does get assigned/amended when amending module `Birds.pkl` (modules are regular objects that can be amended).
|
This solution makes sense if `pigeonName` does not get assigned/amended when amending module `Birds.pkl` (modules are regular objects that can be amended).
|
||||||
|
|
||||||
*Self-import the module*
|
*Self-import the module*
|
||||||
|
|
||||||
@@ -1296,7 +1317,7 @@ listing = new Listing {
|
|||||||
"A " + pigeon + " is a bird" // <3>
|
"A " + pigeon + " is a bird" // <3>
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> Defines a local property with value `"Pigeon"`.
|
<1> Defines a local property with the value `"Pigeon"`.
|
||||||
Local properties can have a type annotation, as in `pigeon: String = "Pigeon"`.
|
Local properties can have a type annotation, as in `pigeon: String = "Pigeon"`.
|
||||||
<2> Defines a listing element that references the local property.
|
<2> Defines a listing element that references the local property.
|
||||||
<3> Defines another listing element that references the local property.
|
<3> Defines another listing element that references the local property.
|
||||||
@@ -1375,7 +1396,7 @@ newBirds = (birds) { // <1>
|
|||||||
|
|
||||||
secondBirdDiet = newBirds[1].diet // <2>
|
secondBirdDiet = newBirds[1].diet // <2>
|
||||||
----
|
----
|
||||||
<1> Amends listing `birds` and overrides property `diet` of element 0 (whose name is "Pigeon"`) to have value `"Worms"`.
|
<1> Amends listing `birds` and overrides property `diet` of element 0 (whose name is "Pigeon"`) to have the value `"Worms"`.
|
||||||
<2> Because element 1 is defined in terms of element 0, its `diet` property also changes to `"Worms"`.
|
<2> Because element 1 is defined in terms of element 0, its `diet` property also changes to `"Worms"`.
|
||||||
|
|
||||||
=== Transforming Listings
|
=== Transforming Listings
|
||||||
@@ -1510,7 +1531,7 @@ This declaration has the following effects:
|
|||||||
* If `ElementType` has a <<default-values,default value>>, that value becomes the listing's default element.
|
* If `ElementType` has a <<default-values,default value>>, that value becomes the listing's default element.
|
||||||
* The first time `x` is read,
|
* The first time `x` is read,
|
||||||
** its value is checked to have type `Listing`.
|
** its value is checked to have type `Listing`.
|
||||||
** the listing's elements are checked to have type `ElementType`.
|
** the listing's elements are checked to have the type `ElementType`.
|
||||||
|
|
||||||
Here is an example:
|
Here is an example:
|
||||||
|
|
||||||
@@ -1577,12 +1598,12 @@ A value of type link:{uri-stdlib-Mapping}[Mapping] is an ordered collection of _
|
|||||||
NOTE: Most of what has been said about <<listings,listings>> also applies to mappings.
|
NOTE: Most of what has been said about <<listings,listings>> also applies to mappings.
|
||||||
Nevertheless, this section is written to stand on its own.
|
Nevertheless, this section is written to stand on its own.
|
||||||
|
|
||||||
A mapping's key–value pairs are called its _entries_.
|
A mapping's key-value pairs are called its _entries_.
|
||||||
Keys are eagerly evaluated; values are lazily evaluated on the first read.
|
Keys are eagerly evaluated; values are lazily evaluated on the first read.
|
||||||
|
|
||||||
Mappings combine qualities of maps and objects:
|
Mappings combine qualities of maps and objects:
|
||||||
|
|
||||||
* Like maps, mappings can contain arbitrary key–value pairs.
|
* Like maps, mappings can contain arbitrary key-value pairs.
|
||||||
* Like objects, mappings excel at defining and amending nested literal data structures.
|
* Like objects, mappings excel at defining and amending nested literal data structures.
|
||||||
* Like objects, mappings can only be directly manipulated through amendment,
|
* Like objects, mappings can only be directly manipulated through amendment,
|
||||||
but converting them to a map (and, if necessary, back to a mapping) opens the door to arbitrary transformations.
|
but converting them to a map (and, if necessary, back to a mapping) opens the door to arbitrary transformations.
|
||||||
@@ -1591,8 +1612,8 @@ Mappings combine qualities of maps and objects:
|
|||||||
[TIP]
|
[TIP]
|
||||||
.When to use Mapping vs. <<maps,Map>>
|
.When to use Mapping vs. <<maps,Map>>
|
||||||
====
|
====
|
||||||
* When key–value style data needs to be specified literally, use a mapping.
|
* When key-value style data needs to be specified literally, use a mapping.
|
||||||
* When key–value style data needs to be transformed in a way that cannot be achieved by <<amending-mappings,amending>> a mapping, use a map.
|
* When key-value style data needs to be transformed in a way that cannot be achieved by <<amending-mappings,amending>> a mapping, use a map.
|
||||||
* If in doubt, use a mapping.
|
* If in doubt, use a mapping.
|
||||||
|
|
||||||
Templates and schemas should almost always use mappings instead of maps.
|
Templates and schemas should almost always use mappings instead of maps.
|
||||||
@@ -1620,8 +1641,8 @@ birds = new Mapping { // <1>
|
|||||||
<1> Defines a module property named `birds` with a value of type `Mapping`.
|
<1> Defines a module property named `birds` with a value of type `Mapping`.
|
||||||
A type only needs to be stated when the property does not have or inherit a <<mapping-type-annotations,type annotation>>.
|
A type only needs to be stated when the property does not have or inherit a <<mapping-type-annotations,type annotation>>.
|
||||||
Otherwise, amend syntax (`birds { ... }`) or shorthand instantiation syntax (`birds = new { ... }`) should be used.
|
Otherwise, amend syntax (`birds { ... }`) or shorthand instantiation syntax (`birds = new { ... }`) should be used.
|
||||||
<2> Defines a mapping entry with key `"Pigeon"` and a value of type `Dynamic`.
|
<2> Defines a mapping entry with the key `"Pigeon"` and a value of type `Dynamic`.
|
||||||
<3> Defines a mapping entry with key `"Parrot"` and a value of type `Dynamic`.
|
<3> Defines a mapping entry with the key `"Parrot"` and a value of type `Dynamic`.
|
||||||
|
|
||||||
To access a value by key, use the `[]` (subscript) operator:
|
To access a value by key, use the `[]` (subscript) operator:
|
||||||
|
|
||||||
@@ -1677,7 +1698,7 @@ mapping = new Mapping {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> Defines a local property name `parrot` with value `"Parrot"`.
|
<1> Defines a local property name `parrot` with the value `"Parrot"`.
|
||||||
Local properties can have a type annotation, as in `parrot: String = "Parrot"`.
|
Local properties can have a type annotation, as in `parrot: String = "Parrot"`.
|
||||||
<2> Defines a mapping entry whose value references `parrot`.
|
<2> Defines a mapping entry whose value references `parrot`.
|
||||||
The local property is visible to values but not keys.
|
The local property is visible to values but not keys.
|
||||||
@@ -1720,7 +1741,7 @@ birds2 = (birds) { // <1>
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> Defines a module property named `birds2`. Its value is a mapping that amends `birds`.
|
<1> Defines a module property named `birds2`. Its value is a mapping that amends `birds`.
|
||||||
<2> Defines a mapping entry with key `"Barn owl"` and a value of type `Dynamic`.
|
<2> Defines a mapping entry with the key `"Barn owl"` and a value of type `Dynamic`.
|
||||||
<3> Amends mapping entry `"Pigeon"` and overrides property `diet`.
|
<3> Amends mapping entry `"Pigeon"` and overrides property `diet`.
|
||||||
<4> Overrides mapping entry `"Parrot"` with an entirely new value of type `Dynamic`.
|
<4> Overrides mapping entry `"Parrot"` with an entirely new value of type `Dynamic`.
|
||||||
|
|
||||||
@@ -1741,8 +1762,8 @@ birds = new Mapping {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> Defines a mapping entry with key `"Pigeon"` and a value of type `Dynamic`.
|
<1> Defines a mapping entry with the key `"Pigeon"` and a value of type `Dynamic`.
|
||||||
<2> Defines a mapping entry with key `"Parrot"` and a value that amends `"Pigeon"`.
|
<2> Defines a mapping entry with the key `"Parrot"` and a value that amends `"Pigeon"`.
|
||||||
|
|
||||||
Mapping values are late-bound:
|
Mapping values are late-bound:
|
||||||
|
|
||||||
@@ -1829,9 +1850,9 @@ birds = new Mapping {
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> Amends the `default` value and sets property `lifespan`.
|
<1> Amends the `default` value and sets property `lifespan`.
|
||||||
<2> Defines a mapping entry with key `"Pigeon"` that implicitly amends the default value.
|
<2> Defines a mapping entry with the key `"Pigeon"` that implicitly amends the default value.
|
||||||
<3> Defines a new property called `diet`. Property `lifespan` is inherited from the default value.
|
<3> Defines a new property called `diet`. Property `lifespan` is inherited from the default value.
|
||||||
<4> Defines a mapping entry with key `"Parrot"` that implicitly amends the default value.
|
<4> Defines a mapping entry with the key `"Parrot"` that implicitly amends the default value.
|
||||||
<5> Overrides the default for property `lifespan`.
|
<5> Overrides the default for property `lifespan`.
|
||||||
|
|
||||||
`default` is a hidden (that is, not rendered) link:{uri-stdlib-Mapping-default}[property] defined in class `Mapping`.
|
`default` is a hidden (that is, not rendered) link:{uri-stdlib-Mapping-default}[property] defined in class `Mapping`.
|
||||||
@@ -1964,7 +1985,7 @@ parrot = new Bird {
|
|||||||
|
|
||||||
=== Class Inheritance
|
=== Class Inheritance
|
||||||
|
|
||||||
Pkl supports single inheritance with a Java(Script) like syntax.
|
Pkl supports single inheritance with a Java(Script)-like syntax.
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -1985,7 +2006,8 @@ pigeon: ParentBird = new {
|
|||||||
[[methods]]
|
[[methods]]
|
||||||
== Methods
|
== Methods
|
||||||
|
|
||||||
Modules and classes can define methods.
|
Pkl methods can be defined on classes and modules using the `function` keyword.
|
||||||
|
Methods may access properties of their containing type.
|
||||||
Submodules and subclasses can override them.
|
Submodules and subclasses can override them.
|
||||||
|
|
||||||
Like Java and most other object-oriented languages, Pkl uses _single dispatch_ -- methods are dynamically dispatched based on the receiver's runtime type.
|
Like Java and most other object-oriented languages, Pkl uses _single dispatch_ -- methods are dynamically dispatched based on the receiver's runtime type.
|
||||||
@@ -2014,6 +2036,12 @@ greeting2 = greetPigeon(parrot) // <4>
|
|||||||
<3> Call instance method on `pigeon`.
|
<3> Call instance method on `pigeon`.
|
||||||
<4> Call module method (on `this`).
|
<4> Call module method (on `this`).
|
||||||
|
|
||||||
|
NOTE: Methods do not support named parameters or default parameter values.
|
||||||
|
The xref:blog:ROOT:class-as-a-function.adoc[Class-as-a-function] pattern may be a suitable replacement.
|
||||||
|
|
||||||
|
TIP: In most cases, methods without parameters should not be defined.
|
||||||
|
Instead, use <<fixed-properties,`fixed` properties>> on the module or class.
|
||||||
|
|
||||||
[[modules]]
|
[[modules]]
|
||||||
== Modules
|
== Modules
|
||||||
|
|
||||||
@@ -2140,9 +2168,18 @@ For example, a module with URI `modulepath:/animals/birds/pigeon.pkl`
|
|||||||
can import `modulepath:/animals/birds/parrot.pkl`
|
can import `modulepath:/animals/birds/parrot.pkl`
|
||||||
with `import "parrot.pkl"` or `import "/animals/birds/parrot.pkl"`.
|
with `import "parrot.pkl"` or `import "/animals/birds/parrot.pkl"`.
|
||||||
|
|
||||||
NOTE: When importing a relative folder or file that starts with `@`, the import string must be prefixed with `./`.
|
[NOTE]
|
||||||
Otherwise, this syntax will be interpreted as dependency notation.
|
.Paths on Windows
|
||||||
|
====
|
||||||
|
Relative paths use the `/` character as the directory separator on all platforms, including Windows.
|
||||||
|
|
||||||
|
Paths that contain drive letters (e.g. `C:`) must be declared as an absolute file URI, for example: `import "file:///C:/path/to/my/module.pkl"`. Otherwise, they are interpreted as a URI scheme.
|
||||||
|
====
|
||||||
|
|
||||||
|
NOTE: When importing a relative directory or file that starts with `@`, the import string must be prefixed with `./`.
|
||||||
|
Otherwise, this syntax will be interpreted as xref:dependency-notation[dependency notation].
|
||||||
|
|
||||||
|
[#dependency-notation]
|
||||||
==== Dependency notation URIs
|
==== Dependency notation URIs
|
||||||
|
|
||||||
Example: `+@birds/bird.pkl+`
|
Example: `+@birds/bird.pkl+`
|
||||||
@@ -2150,7 +2187,7 @@ Example: `+@birds/bird.pkl+`
|
|||||||
Dependency notation URIs represent a path within a <<project-dependencies,project or package dependency>>.
|
Dependency notation URIs represent a path within a <<project-dependencies,project or package dependency>>.
|
||||||
For example, import `@birds/bird.pkl` represents path `/bird.pkl` in a dependency named "birds".
|
For example, import `@birds/bird.pkl` represents path `/bird.pkl` in a dependency named "birds".
|
||||||
|
|
||||||
A dependency is either a remote package, or a local project dependency.
|
A dependency is either a remote package or a local project dependency.
|
||||||
|
|
||||||
==== Extension points
|
==== Extension points
|
||||||
|
|
||||||
@@ -2329,7 +2366,7 @@ extinct = false
|
|||||||
function say() = "Pkl is great!"
|
function say() = "Pkl is great!"
|
||||||
----
|
----
|
||||||
|
|
||||||
At most, one extends clause is permitted.
|
At most one extends clause is permitted.
|
||||||
A module cannot have both an amends clause and an extends clause.
|
A module cannot have both an amends clause and an extends clause.
|
||||||
|
|
||||||
Extending a module implicitly defines a new module class that extends the original module's class.
|
Extending a module implicitly defines a new module class that extends the original module's class.
|
||||||
@@ -2431,7 +2468,7 @@ When creating a new module, especially one intended for import into other module
|
|||||||
Less than six characters, not counting the `.pkl` file extension, is a good rule of thumb.
|
Less than six characters, not counting the `.pkl` file extension, is a good rule of thumb.
|
||||||
* valid identifier
|
* valid identifier
|
||||||
+
|
+
|
||||||
Stick to alphanumeric characters. Use underscore (`_`) instead of hyphen (`-`) as name separator.
|
Stick to alphanumeric characters. Use an underscore (`_`) instead of a hyphen (`-`) as a name separator.
|
||||||
* descriptive
|
* descriptive
|
||||||
+
|
+
|
||||||
An import name should make sense on its own and when used in qualified member names.
|
An import name should make sense on its own and when used in qualified member names.
|
||||||
@@ -2440,7 +2477,7 @@ An import name should make sense on its own and when used in qualified member na
|
|||||||
[[import-expression]]
|
[[import-expression]]
|
||||||
==== Import Expressions (`import()`)
|
==== Import Expressions (`import()`)
|
||||||
|
|
||||||
An import expression consists of the keyword `import`, following by a <<Module URIs,module URI>> wrapped in parentheses:
|
An import expression consists of the keyword `import`, followed by a <<Module URIs,module URI>> wrapped in parentheses:
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -2460,7 +2497,7 @@ Multiple modules may be imported at once with `import*`.
|
|||||||
When importing multiple modules, a glob pattern is used to match against existing resources.
|
When importing multiple modules, a glob pattern is used to match against existing resources.
|
||||||
A globbed import evaluates to a `Mapping`, where keys are the expanded form of the glob and values are import expressions on each individual module.
|
A globbed import evaluates to a `Mapping`, where keys are the expanded form of the glob and values are import expressions on each individual module.
|
||||||
|
|
||||||
Globbed imports can be expressed as either a clause, or as an expression.
|
Globbed imports can be expressed as either a clause or as an expression.
|
||||||
When expressed as a clause, they follow the same naming rules as a normal <<import-clause,import clause>>: they introduce a local property equal to the last path segment without the `.pkl` extension.
|
When expressed as a clause, they follow the same naming rules as a normal <<import-clause,import clause>>: they introduce a local property equal to the last path segment without the `.pkl` extension.
|
||||||
A globbed import clause cannot be used as a type.
|
A globbed import clause cannot be used as a type.
|
||||||
|
|
||||||
@@ -2472,7 +2509,7 @@ import* "reptiles/*.pkl" <2>
|
|||||||
birds = import*("birds/*.pkl") // <3>
|
birds = import*("birds/*.pkl") // <3>
|
||||||
----
|
----
|
||||||
<1> Globbed import clause
|
<1> Globbed import clause
|
||||||
<2> Globbed import clause without explicit name (will import the name `*`)
|
<2> Globbed import clause without an explicit name (will import the name `*`)
|
||||||
<3> Globbed import expression
|
<3> Globbed import expression
|
||||||
|
|
||||||
Assuming that a file system contains these files:
|
Assuming that a file system contains these files:
|
||||||
@@ -2548,7 +2585,7 @@ By default, there are five trust levels, listed from highest to lowest:
|
|||||||
For example, this means that `file:` modules can import `https:` modules, but not the other way around.
|
For example, this means that `file:` modules can import `https:` modules, but not the other way around.
|
||||||
|
|
||||||
If a module URI is resolved in multiple steps, all URIs are subject to the above security checks.
|
If a module URI is resolved in multiple steps, all URIs are subject to the above security checks.
|
||||||
An example for this is an HTTPS URL that results in a redirect.
|
An example of this is an HTTPS URL that results in a redirect.
|
||||||
|
|
||||||
Pkl embedders can further customize security checks.
|
Pkl embedders can further customize security checks.
|
||||||
|
|
||||||
@@ -2647,7 +2684,7 @@ The standard library provides these renderers:
|
|||||||
* link:{uri-stdlib-xmlModule}/Renderer[xml.Renderer]
|
* link:{uri-stdlib-xmlModule}/Renderer[xml.Renderer]
|
||||||
* link:{uri-stdlib-baseModule}/YamlRenderer[YamlRenderer]
|
* link:{uri-stdlib-baseModule}/YamlRenderer[YamlRenderer]
|
||||||
|
|
||||||
To render a format that is not yet supported, implement your own renderer by extending class link:{uri-stdlib-baseModule}/ValueRenderer[ValueRenderer].
|
To render a format that is not yet supported, you can implement your own renderer by extending the class link:{uri-stdlib-baseModule}/ValueRenderer[ValueRenderer].
|
||||||
|
|
||||||
The standard library renderers can be configured with _value converters_, which influence how particular values are rendered.
|
The standard library renderers can be configured with _value converters_, which influence how particular values are rendered.
|
||||||
|
|
||||||
@@ -2693,7 +2730,7 @@ output {
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
For more on path based converters, see {uri-stdlib-PcfRenderer-converters}[PcfRenderer.converters].
|
For more on path-based converters, see {uri-stdlib-PcfRenderer-converters}[PcfRenderer.converters].
|
||||||
|
|
||||||
Sometimes it is useful to directly compute the final module output, bypassing `output.value` and `output.converters`.
|
Sometimes it is useful to directly compute the final module output, bypassing `output.value` and `output.converters`.
|
||||||
To do so, set the link:{uri-stdlib-baseModule}/ModuleOutput#text[output.text] property to a String value:
|
To do so, set the link:{uri-stdlib-baseModule}/ModuleOutput#text[output.text] property to a String value:
|
||||||
@@ -2716,7 +2753,7 @@ THIS IS THE FINAL OUTPUT
|
|||||||
[[multiple-file-output]]
|
[[multiple-file-output]]
|
||||||
==== Multiple File Output
|
==== Multiple File Output
|
||||||
|
|
||||||
Sometimes, it is desirable for a single module to produce multiple output files.
|
It is sometimes desirable for a single module to produce multiple output files.
|
||||||
This is possible by configuring a module's link:{uri-stdlib-outputFiles}[`output.files`] property
|
This is possible by configuring a module's link:{uri-stdlib-outputFiles}[`output.files`] property
|
||||||
// suppress inspection "AsciiDocLinkResolve"
|
// suppress inspection "AsciiDocLinkResolve"
|
||||||
and specifying the xref:pkl-cli:index.adoc#multiple-file-output-path[`--multiple-file-output-path`]
|
and specifying the xref:pkl-cli:index.adoc#multiple-file-output-path[`--multiple-file-output-path`]
|
||||||
@@ -2883,7 +2920,7 @@ name2OrParrot = name2 ?? "Parrot" // <2>
|
|||||||
[NOTE]
|
[NOTE]
|
||||||
.Default non-null behavior
|
.Default non-null behavior
|
||||||
====
|
====
|
||||||
There are many languages that allow `null` for (almost) every type, but Pkl does not.
|
Many languages allow `null` for (almost) every type, but Pkl does not.
|
||||||
Any type can be extended to include `null` by appending `?` to the type.
|
Any type can be extended to include `null` by appending `?` to the type.
|
||||||
|
|
||||||
For example, `parrot: Bird` will always be non-null, but `pigeon: Bird?` could be `null` - and _is_ by default,
|
For example, `parrot: Bird` will always be non-null, but `pigeon: Bird?` could be `null` - and _is_ by default,
|
||||||
@@ -3112,7 +3149,7 @@ myValue = throw("You won't be able to recover from this one!") // <1>
|
|||||||
----
|
----
|
||||||
<1> `myValue` never receives a value because the program exits.
|
<1> `myValue` never receives a value because the program exits.
|
||||||
|
|
||||||
The error message is printed to the console, and the program exits.
|
The error message is printed to the console and the program exits.
|
||||||
In embedded mode, a link:{uri-pkl-core-PklException}[PklException] is thrown.
|
In embedded mode, a link:{uri-pkl-core-PklException}[PklException] is thrown.
|
||||||
|
|
||||||
[[debugging]]
|
[[debugging]]
|
||||||
@@ -3140,6 +3177,7 @@ pkl: TRACE: num1 * num2 = 672 (at file:///some/module.pkl, line 42)
|
|||||||
|
|
||||||
This section discusses language features that are generally more relevant to template and library authors than template consumers.
|
This section discusses language features that are generally more relevant to template and library authors than template consumers.
|
||||||
|
|
||||||
|
<<meaning-of-new,Meaning of `new`>> +
|
||||||
<<let-expressions,Let Expressions>> +
|
<<let-expressions,Let Expressions>> +
|
||||||
<<type-tests,Type Tests>> +
|
<<type-tests,Type Tests>> +
|
||||||
<<type-casts,Type Casts>> +
|
<<type-casts,Type Casts>> +
|
||||||
@@ -3163,6 +3201,162 @@ This section discusses language features that are generally more relevant to tem
|
|||||||
<<blank-identifiers,Blank Identifiers>> +
|
<<blank-identifiers,Blank Identifiers>> +
|
||||||
<<projects,Projects>>
|
<<projects,Projects>>
|
||||||
|
|
||||||
|
[[meaning-of-new]]
|
||||||
|
=== Meaning of `new`
|
||||||
|
|
||||||
|
Objects in Pkl always <<amending-objects, amends>> _some_ value.
|
||||||
|
The `new` keyword is a special case of amending where a contextual value is amended.
|
||||||
|
In Pkl, there are two forms of `new` objects:
|
||||||
|
|
||||||
|
* `new` with explicit type information, for example, `new Foo {}`.
|
||||||
|
* `new` without type information, for example, `new {}`.
|
||||||
|
|
||||||
|
==== Type defaults
|
||||||
|
|
||||||
|
To understand instantiation cases without explicit parent or type information, it's important to first understand implicit default values.
|
||||||
|
When a property is declared in a module or class but is not provided an explicit default value, the property's default value becomes the type's default value.
|
||||||
|
Similarly, when `Listing` and `Mapping` types are declared with explicit type arguments for their element or value, their `default` property amends that declared type.
|
||||||
|
When `Listing` and `Mapping` types are declared without type arguments, their `default` property amends an empty `Dynamic` object.
|
||||||
|
Some types, including `Pair` and primitives like `String`, `Number`, and `Boolean` have no default value; attempting to render such a property results in the error "Tried to read property `<name>` but its value is undefined".
|
||||||
|
|
||||||
|
[source,{pkl}]
|
||||||
|
----
|
||||||
|
class Bird {
|
||||||
|
name: String = "polly"
|
||||||
|
}
|
||||||
|
|
||||||
|
bird: Bird // <1>
|
||||||
|
birdListing: Listing<Bird> // <2>
|
||||||
|
birdMapping: Mapping<String, Bird> // <3>
|
||||||
|
----
|
||||||
|
<1> Without an explicit default value, this property has default value `new Bird { name = "polly" }`
|
||||||
|
<2> With an explicit element type argument, this property's default value is equivalent to `new Listing<Bird> { default = (_) -> new Bird { name = "polly" } }`
|
||||||
|
<3> With an explicit value type argument, this property's default value is equivalent to `new Mapping<String, Bird> { default = (_) -> new Bird { name = "polly" } }`
|
||||||
|
|
||||||
|
==== Explicitly Typed `new`
|
||||||
|
|
||||||
|
Instantiating an object with `new <type>` results in a value that amends the specified type's default value.
|
||||||
|
Notably, creating a `Listing` element or assigning a `Mapping` entry value with an explicitly typed `new` ignores the object's `default` value.
|
||||||
|
|
||||||
|
[source,{pkl}]
|
||||||
|
----
|
||||||
|
class Bird {
|
||||||
|
/// The name of the bird
|
||||||
|
name: String
|
||||||
|
|
||||||
|
/// Whether this is a bird of prey or not.
|
||||||
|
isPredatory: Boolean?
|
||||||
|
}
|
||||||
|
|
||||||
|
newProperty = new Bird { // <1>
|
||||||
|
name = "Warbler"
|
||||||
|
}
|
||||||
|
|
||||||
|
someListing = new Listing<Bird> {
|
||||||
|
default {
|
||||||
|
isPredatory = true
|
||||||
|
}
|
||||||
|
new Bird { // <2>
|
||||||
|
name = "Sand Piper"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
someMapping = new Mapping<String, Bird> {
|
||||||
|
default {
|
||||||
|
isPredatory = true
|
||||||
|
}
|
||||||
|
["Penguin"] = new Bird { // <3>
|
||||||
|
name = "Penguin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
----
|
||||||
|
<1> Assigning a `new` explicitly-typed value to a property.
|
||||||
|
<2> Adding an `new` explicitly-typed `Listing` element.
|
||||||
|
The value will not have property `isPredatory = true` as the `default` property of the `Listing` is not used.
|
||||||
|
<3> Assigning a `new` explicitly-typed value to a `Mapping` entry.
|
||||||
|
The value will not have property `isPredatory = true` as the `default` property of the `Mapping` is not used.
|
||||||
|
|
||||||
|
==== Implicitly Typed `new`
|
||||||
|
|
||||||
|
When using the implicitly typed `new` invocation, there is no explicit parent value to amend.
|
||||||
|
In these cases, Pkl infers the amend operation's parent value based on context:
|
||||||
|
|
||||||
|
* When assigning to a declared property, the property's default value is amended (<<amend-null, including `null`>>).
|
||||||
|
If there is no type associated with the property, an empty `Dynamic` object is amended.
|
||||||
|
* When assigning to an entry (e.g. a `Mapping` member) or element (e.g. a `Listing` member), the enclosing object's `default` property is applied to the corresponding index or key, respectively, to produce the value to be amended.
|
||||||
|
* In other cases, evaluation fails with the error message "Cannot tell which parent to amend".
|
||||||
|
|
||||||
|
The type annotation of a <<methods,method>> parameter is not used for inference.
|
||||||
|
In this case, the argument's type should be specified explicitly.
|
||||||
|
|
||||||
|
[source,{pkl}]
|
||||||
|
----
|
||||||
|
class Bird {
|
||||||
|
name: String
|
||||||
|
|
||||||
|
function listHatchlings(items: Listing<String>): Listing<String> = new {
|
||||||
|
for (item in items) {
|
||||||
|
"\(name):\(item)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedProperty: Bird = new { // <1>
|
||||||
|
name = "Swift"
|
||||||
|
}
|
||||||
|
|
||||||
|
untypedProperty = new { // <2>
|
||||||
|
hello = "world"
|
||||||
|
}
|
||||||
|
|
||||||
|
typedListing: Listing<Bird> = new {
|
||||||
|
new { // <3>
|
||||||
|
name = "Kite"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
untypedListing: Listing = new {
|
||||||
|
new { // <4>
|
||||||
|
hello = "there"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedMapping: Mapping<String, Bird> = new {
|
||||||
|
default { entryKey ->
|
||||||
|
name = entryKey
|
||||||
|
}
|
||||||
|
["Saltmarsh Sparrow"] = new { // <5>
|
||||||
|
name = "Sharp-tailed Sparrow"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
amendedMapping = (typedMapping) {
|
||||||
|
["Saltmarsh Sparrow"] = new {} // <6>
|
||||||
|
}
|
||||||
|
|
||||||
|
class Aviary {
|
||||||
|
birds: Listing<Bird> = new {
|
||||||
|
new { name = "Osprey" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aviary: Aviary = new {
|
||||||
|
birds = new { // <7>
|
||||||
|
new { name = "Kiwi" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
swiftHatchlings = typedProperty.listHatchlings(new { "Poppy"; "Chirpy" }) // <8>
|
||||||
|
----
|
||||||
|
<1> Assignment to a property with an explicitly declared type, amending `new Bird {}`.
|
||||||
|
<2> Assignment to an undeclared property in module context, amending `new Dynamic {}`.
|
||||||
|
<3> `Listing` element creation, amending implicit `default`, `new Bird {}`.
|
||||||
|
<4> `Listing` element creation, amending implicit `default`, `new Dynamic {}`.
|
||||||
|
<5> `Mapping` value assignment, amdending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
|
||||||
|
<6> `Mapping` value assignment _replacing_ the parent's entry, amending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
|
||||||
|
<7> Admending the property default value `new Listing { new Bird { name = "Osprey" } }`; the result contains both birds.
|
||||||
|
<8> Error: Cannot tell which parent to amend.
|
||||||
|
|
||||||
[[let-expressions]]
|
[[let-expressions]]
|
||||||
=== Let Expressions
|
=== Let Expressions
|
||||||
|
|
||||||
@@ -3184,10 +3378,11 @@ Here is an example:
|
|||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
birdDiets = let (diets = List("Seeds", "Berries", "Mice"))
|
birdDiets =
|
||||||
List(diets[2], diets[0]) // <1>
|
let (diets = List("Seeds", "Berries", "Mice"))
|
||||||
|
List(diets[2], diets[0]) // <1>
|
||||||
----
|
----
|
||||||
<1> result: `List("Mice", "Seeds")`
|
<1> result: `birdDiets = List("Mice", "Seeds")`
|
||||||
|
|
||||||
`let` expressions serve two purposes:
|
`let` expressions serve two purposes:
|
||||||
|
|
||||||
@@ -3198,20 +3393,22 @@ List(diets[2], diets[0]) // <1>
|
|||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
birdDiets = let (diets: List<String> = List("Seeds", "Berries", "Mice"))
|
birdDiets =
|
||||||
diets[2] + diets[0] // <1>
|
let (diets: List<String> = List("Seeds", "Berries", "Mice"))
|
||||||
|
diets[2] + diets[0] // <1>
|
||||||
----
|
----
|
||||||
<1> result: `List("Mice", "Seeds")`
|
<1> result: `birdDiets = List("Mice", "Seeds")`
|
||||||
|
|
||||||
`let` expressions can be stacked:
|
`let` expressions can be stacked:
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
birdDiets = let (birds = List("Pigeon", "Barn owl", "Parrot"))
|
birdDiets =
|
||||||
let (diet = List("Seeds", "Mice", "Berries"))
|
let (birds = List("Pigeon", "Barn owl", "Parrot"))
|
||||||
birds.zip(diet) // <1>
|
let (diet = List("Seeds", "Mice", "Berries"))
|
||||||
|
birds.zip(diet) // <1>
|
||||||
----
|
----
|
||||||
<1> result: `List(Pair("Pigeon", "Seeds"), Pair("Barn owl", "Mice"), Pair("Parrot", "Berries"))`
|
<1> result: `birdDiets = List(Pair("Pigeon", "Seeds"), Pair("Barn owl", "Mice"), Pair("Parrot", "Berries"))`
|
||||||
|
|
||||||
[[type-tests]]
|
[[type-tests]]
|
||||||
=== Type Tests
|
=== Type Tests
|
||||||
@@ -3300,7 +3497,7 @@ list3 = List(1, "x", 5.min, List(1, 2, 3)) // <3>
|
|||||||
----
|
----
|
||||||
<1> result: empty list
|
<1> result: empty list
|
||||||
<2> result: list of length 3
|
<2> result: list of length 3
|
||||||
<3> result: heterogenous list whose last element is another list
|
<3> result: heterogeneous list whose last element is another list
|
||||||
|
|
||||||
To concatenate lists, use the `+` operator:
|
To concatenate lists, use the `+` operator:
|
||||||
|
|
||||||
@@ -3357,7 +3554,7 @@ res4 = Set(1, "x", 5.min, List(1, 2, 3)) // <4>
|
|||||||
<1> result: empty set
|
<1> result: empty set
|
||||||
<2> result: set of length 3
|
<2> result: set of length 3
|
||||||
<3> result: same set of length 3
|
<3> result: same set of length 3
|
||||||
<4> result: heterogenous set that contains a list as its last element
|
<4> result: heterogeneous set that contains a list as its last element
|
||||||
|
|
||||||
To compute the union of sets, use the `+` operator:
|
To compute the union of sets, use the `+` operator:
|
||||||
|
|
||||||
@@ -3388,14 +3585,14 @@ res4 = set.intersect(Set(3, 9, 2)) // <4>
|
|||||||
|
|
||||||
A value of type link:{uri-stdlib-Map}[Map] is an ordered collection of _values_ indexed by _key_.
|
A value of type link:{uri-stdlib-Map}[Map] is an ordered collection of _values_ indexed by _key_.
|
||||||
|
|
||||||
A map's key–value pairs are called its _entries_.
|
A map's key-value pairs are called its _entries_.
|
||||||
Keys and values are eagerly evaluated.
|
Keys and values are eagerly evaluated.
|
||||||
|
|
||||||
[TIP]
|
[TIP]
|
||||||
.When to use Map vs. <<mappings,Mapping>>
|
.When to use Map vs. <<mappings,Mapping>>
|
||||||
====
|
====
|
||||||
* When key–value style data needs to be specified literally, use a mapping.
|
* When key-value style data needs to be specified literally, use a mapping.
|
||||||
* When key–value style data needs to be transformed in ways that cannot be achieved by <<amending-mappings,amending>> a mapping, use a map.
|
* When key-value style data needs to be transformed in ways that cannot be achieved by <<amending-mappings,amending>> a mapping, use a map.
|
||||||
* If in doubt, use a mapping.
|
* If in doubt, use a mapping.
|
||||||
|
|
||||||
Templates and schemas should almost always use mappings instead of maps.
|
Templates and schemas should almost always use mappings instead of maps.
|
||||||
@@ -3414,7 +3611,7 @@ map3 = Map(1, "x", 2, 5.min, 3, Map(1, 2)) // <3>
|
|||||||
<2> result: set of length 3
|
<2> result: set of length 3
|
||||||
<3> result: heterogeneous map whose last value is another map
|
<3> result: heterogeneous map whose last value is another map
|
||||||
|
|
||||||
Any Pkl value can be used as map key:
|
Any Pkl value can be used as a map key:
|
||||||
|
|
||||||
[source%tested,{pkl-expr}]
|
[source%tested,{pkl-expr}]
|
||||||
----
|
----
|
||||||
@@ -3470,7 +3667,7 @@ emailRegex = Regex(#"([\w\.]+)@([\w\.]+)"#)
|
|||||||
|
|
||||||
// note: first \ on next line is asciidoc escape
|
// note: first \ on next line is asciidoc escape
|
||||||
Notice the use of custom string delimiters `\#"` and `"#`, which change the string's escape character from `\` to `\#`.
|
Notice the use of custom string delimiters `\#"` and `"#`, which change the string's escape character from `\` to `\#`.
|
||||||
As a consequence, the regular expression's own backslash escape character no longer needs to be escaped.
|
As a consequence, the regular expression's backslash escape character no longer requires escaping.
|
||||||
|
|
||||||
To test if a string fully matches a regular expression, use link:{uri-stdlib-matches}[String.matches()]:
|
To test if a string fully matches a regular expression, use link:{uri-stdlib-matches}[String.matches()]:
|
||||||
|
|
||||||
@@ -3602,7 +3799,7 @@ Property and method definitions may optionally contain type annotations.
|
|||||||
Type annotations serve the following purposes:
|
Type annotations serve the following purposes:
|
||||||
|
|
||||||
* Documentation
|
* Documentation
|
||||||
+ Type annotations help documenting data models. They are included in generated documentation.
|
+ Type annotations help to document data models. They are included in any generated documentation.
|
||||||
|
|
||||||
* Validation
|
* Validation
|
||||||
+ Type annotations are validated at runtime.
|
+ Type annotations are validated at runtime.
|
||||||
@@ -3705,6 +3902,7 @@ bird2: Bird? = null // <2>
|
|||||||
The only class types that admit `null` values despite not ending in `?` are `Any` and `Null`.
|
The only class types that admit `null` values despite not ending in `?` are `Any` and `Null`.
|
||||||
(`Null` is not very useful as a type because it _only_ admits `null` values.)
|
(`Null` is not very useful as a type because it _only_ admits `null` values.)
|
||||||
`Any?` and `Null?` are equivalent to `Any` and `Null`, respectively.
|
`Any?` and `Null?` are equivalent to `Any` and `Null`, respectively.
|
||||||
|
In some languages, nullable types are also known as _optional types_.
|
||||||
|
|
||||||
[[generic-types]]
|
[[generic-types]]
|
||||||
==== Generic Types
|
==== Generic Types
|
||||||
@@ -3738,7 +3936,7 @@ map: Map<String, Bird> // <5>
|
|||||||
mapping: Mapping<String, Bird> // <6>
|
mapping: Mapping<String, Bird> // <6>
|
||||||
----
|
----
|
||||||
|
|
||||||
<1> a pair with first element of type `String` and second element of type `Bird`
|
<1> a pair `String` and `Bird` as types for the first and second element, respectively
|
||||||
<2> a collection of `Bird` elements
|
<2> a collection of `Bird` elements
|
||||||
<3> a list of `Bird` elements
|
<3> a list of `Bird` elements
|
||||||
<4> a set of `Bird` elements
|
<4> a set of `Bird` elements
|
||||||
@@ -3781,7 +3979,7 @@ More complex union types can be formed:
|
|||||||
foo: List<Boolean|Number|String>|Bird
|
foo: List<Boolean|Number|String>|Bird
|
||||||
----
|
----
|
||||||
|
|
||||||
Union types have no implicit default values, but an explicit type can be choosen using a `*` marker:
|
Union types have no implicit default values, but an explicit type can be chosen using a `*` marker:
|
||||||
[source%parsed,{pkl}]
|
[source%parsed,{pkl}]
|
||||||
----
|
----
|
||||||
foo: "a"|"b" // undefined. Will throw an error if not amended
|
foo: "a"|"b" // undefined. Will throw an error if not amended
|
||||||
@@ -3851,7 +4049,7 @@ it backs off and trusts the code's author to know what they are doing -- for exa
|
|||||||
==== Progressive Disclosure
|
==== Progressive Disclosure
|
||||||
|
|
||||||
In the spirit of link:{uri-progressive-disclosure}[progressive disclosure], type annotations are optional in Pkl.
|
In the spirit of link:{uri-progressive-disclosure}[progressive disclosure], type annotations are optional in Pkl.
|
||||||
Omitting a type annotation is equivalent to specifying type `unknown`:
|
Omitting a type annotation is equivalent to specifying the type `unknown`:
|
||||||
|
|
||||||
[source%parsed,{pkl}]
|
[source%parsed,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -3942,7 +4140,7 @@ pigeon: Bird = new {
|
|||||||
----
|
----
|
||||||
<1> Restricts `name` to have at least three characters.
|
<1> Restricts `name` to have at least three characters.
|
||||||
<2> The name of the bird (`this`) should not be the same as the name of the `parent`.
|
<2> The name of the bird (`this`) should not be the same as the name of the `parent`.
|
||||||
<3> Note how `parent` is different from `name`. If they were the same, we would be thrown a contraint error.
|
<3> Note how `parent` is different from `name`. If they were the same, we would be thrown a constraint error.
|
||||||
|
|
||||||
In the following example, we define a `Bird` with a name of only two characters.
|
In the following example, we define a `Bird` with a name of only two characters.
|
||||||
|
|
||||||
@@ -3956,7 +4154,7 @@ pigeon: Bird = new {
|
|||||||
|
|
||||||
Boolean expressions are convenient for ad-hoc type constraints.
|
Boolean expressions are convenient for ad-hoc type constraints.
|
||||||
Alternatively, type constraints can be given as lambda expressions accepting a single argument, namely the value to be validated.
|
Alternatively, type constraints can be given as lambda expressions accepting a single argument, namely the value to be validated.
|
||||||
This allows to abstract over and reuse type constraints.
|
This allows for the abstraction and reuse of type constraints.
|
||||||
|
|
||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
@@ -4226,7 +4424,7 @@ Function amending can also be used to refine <<mixins,mixins>>.
|
|||||||
[[amend-null]]
|
[[amend-null]]
|
||||||
=== Amending Null Values
|
=== Amending Null Values
|
||||||
|
|
||||||
It's time to lift a secret: The predefined `null` value is just one of potentially many values of type `Null`.
|
It's time to lift a secret: The predefined `null` value is just one of the potentially many values of type `Null`.
|
||||||
|
|
||||||
First, here are the technical facts:
|
First, here are the technical facts:
|
||||||
|
|
||||||
@@ -4459,7 +4657,7 @@ entry value +
|
|||||||
property value
|
property value
|
||||||
|===
|
|===
|
||||||
|
|
||||||
Indices are zero based.
|
Indices are zero-based.
|
||||||
Note that `for` generators can generate elements and entries but not properties.footnote:[More precisely, they cannot generate properties with a non-constant name.]
|
Note that `for` generators can generate elements and entries but not properties.footnote:[More precisely, they cannot generate properties with a non-constant name.]
|
||||||
|
|
||||||
[[spread-syntax]]
|
[[spread-syntax]]
|
||||||
@@ -4532,7 +4730,7 @@ In some ways, spread syntax can be thought of as a shorthand for a xref:for-gene
|
|||||||
[NOTE]
|
[NOTE]
|
||||||
====
|
====
|
||||||
Look out for duplicate key conflicts when using spreads.
|
Look out for duplicate key conflicts when using spreads.
|
||||||
When spreading entries or properties, it is possible that a spread causes conflict due to an existing definition of a key.
|
Spreading entries or properties may cause conflicts due to matched existing key definitions.
|
||||||
|
|
||||||
In the following code snippet, `"Pigeon"` is declared twice in the `newPets` object, and thus is an error.
|
In the following code snippet, `"Pigeon"` is declared twice in the `newPets` object, and thus is an error.
|
||||||
|
|
||||||
@@ -4660,7 +4858,7 @@ If the `-` character exists at the beginning or the end of a character class, it
|
|||||||
Within a character class, the characters `{`, `}`, `\`, `*`, and `?` do not have any special meaning.
|
Within a character class, the characters `{`, `}`, `\`, `*`, and `?` do not have any special meaning.
|
||||||
|
|
||||||
A character class is not allowed to be empty.
|
A character class is not allowed to be empty.
|
||||||
Thus, if the first character within the character class is `]`, it treated literally and not as the closing delimiter of the character class.
|
Thus, if the first character within the character class is `]`, it is treated literally and not as the closing delimiter of the character class.
|
||||||
For example, the glob pattern `[]abc]` matches a single character that is either `]`, `a`, `b`, or `c`.
|
For example, the glob pattern `[]abc]` matches a single character that is either `]`, `a`, `b`, or `c`.
|
||||||
|
|
||||||
[[glob-sub-patterns]]
|
[[glob-sub-patterns]]
|
||||||
@@ -4837,14 +5035,14 @@ To customize the link text, insert the desired text, enclosed in square brackets
|
|||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
----
|
----
|
||||||
/// A [common Bird] found in large cities.
|
/// A [common Bird][Bird] found in large cities.
|
||||||
----
|
----
|
||||||
|
|
||||||
Custom link text can use markup:
|
Custom link text can use markup:
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
----
|
----
|
||||||
/// A [*common* Bird] found in large cities.
|
/// A [*common* Bird][Bird] found in large cities.
|
||||||
----
|
----
|
||||||
|
|
||||||
The short link `[Bird]` is equivalent to `[{backtick}Bird{backtick}][Bird]`.
|
The short link `[Bird]` is equivalent to `[{backtick}Bird{backtick}][Bird]`.
|
||||||
@@ -4969,12 +5167,12 @@ To answer this question, Pkl follows these steps:
|
|||||||
If a match is found, this is the answer.
|
If a match is found, this is the answer.
|
||||||
. Search the `pkl.base` module for a top-level definition of method `x`.
|
. Search the `pkl.base` module for a top-level definition of method `x`.
|
||||||
If a match is found, this is the answer.
|
If a match is found, this is the answer.
|
||||||
. Seach the class inheritance chain of `this`, starting with the class of `this`
|
. Search the class inheritance chain of `this`, starting with the class of `this`
|
||||||
and continuing upwards until and including class `Any`, for a method named `x.`
|
and continuing upwards until and including class `Any`, for a method named `x.`
|
||||||
If a match is found, this is the answer.
|
If a match is found, this is the answer.
|
||||||
. Throw a "method `x` not found" error.
|
. Throw a "method `x` not found" error.
|
||||||
|
|
||||||
NOTE: Pkl does not support arity or type based method overloading.
|
NOTE: Pkl does not support arity or type-based method overloading.
|
||||||
Hence, the argument list of a method call is irrelevant for method resolution.
|
Hence, the argument list of a method call is irrelevant for method resolution.
|
||||||
|
|
||||||
[[prototype-chain]]
|
[[prototype-chain]]
|
||||||
@@ -5064,11 +5262,9 @@ They cannot be used as a regular identifier, and currently do not have any meani
|
|||||||
* `override`
|
* `override`
|
||||||
* `record`
|
* `record`
|
||||||
* `delete`
|
* `delete`
|
||||||
* `match`
|
|
||||||
* `case`
|
* `case`
|
||||||
* `switch`
|
* `switch`
|
||||||
* `vararg`
|
* `vararg`
|
||||||
* `const`
|
|
||||||
|
|
||||||
To use these names in an identifier, <<quoted-identifiers, surround them with backticks>>.
|
To use these names in an identifier, <<quoted-identifiers, surround them with backticks>>.
|
||||||
|
|
||||||
@@ -5076,7 +5272,7 @@ To use these names in an identifier, <<quoted-identifiers, surround them with ba
|
|||||||
=== Blank Identifiers
|
=== Blank Identifiers
|
||||||
|
|
||||||
Blank identifiers can be used in many places to ignore parameters and variables. +
|
Blank identifiers can be used in many places to ignore parameters and variables. +
|
||||||
`_` is not a valid identifier. In order to use it as a parameter or variable name
|
`_` is not a valid identifier. To use it as a parameter or variable name,
|
||||||
it needs to be enclosed in backticks: +`_`+.
|
it needs to be enclosed in backticks: +`_`+.
|
||||||
|
|
||||||
==== Functions and methods
|
==== Functions and methods
|
||||||
@@ -5125,15 +5321,15 @@ birds = new Dynamic {
|
|||||||
[[projects]]
|
[[projects]]
|
||||||
=== Projects
|
=== Projects
|
||||||
|
|
||||||
A _project_ is a directory of Pkl modules, and other resources.
|
A _project_ is a directory of Pkl modules and other resources.
|
||||||
It is defined by the presence of a `PklProject` file, that amends standard library module
|
It is defined by the presence of a `PklProject` file that amends the standard library module
|
||||||
`pkl:Project`.
|
`pkl:Project`.
|
||||||
|
|
||||||
Defining a project serves the following purposes:
|
Defining a project serves the following purposes:
|
||||||
|
|
||||||
1. It allows defining common evaluator settings for Pkl modules within a logical project.
|
1. It allows defining common evaluator settings for Pkl modules within a logical project.
|
||||||
2. It helps with managing <<packages,package>> dependencies for Pkl modules within a logical project.
|
2. It helps with managing <<package-asset-uri,package>> dependencies for Pkl modules within a logical project.
|
||||||
3. It enables packaging and sharing the contents of the project as a <<packages,package>>.
|
3. It enables packaging and sharing the contents of the project as a <<package-asset-uri,package>>.
|
||||||
4. It allows importing packages via dependency notation.
|
4. It allows importing packages via dependency notation.
|
||||||
|
|
||||||
[[project-dependencies]]
|
[[project-dependencies]]
|
||||||
@@ -5179,7 +5375,7 @@ When the project gets published as a _package_, these names and URIs are preserv
|
|||||||
==== Resolving Dependencies
|
==== Resolving Dependencies
|
||||||
|
|
||||||
Dependencies that are declared in a `PklProject` file must be _resolved_ via CLI command xref:pkl-cli:index.adoc#command-project-resolve[`pkl project resolve`].
|
Dependencies that are declared in a `PklProject` file must be _resolved_ via CLI command xref:pkl-cli:index.adoc#command-project-resolve[`pkl project resolve`].
|
||||||
This builds a single dependency list, resolving all transitive dependencies and determines appropriate version for each package.
|
This builds a single dependency list, resolving all transitive dependencies, and determines the appropriate version for each package.
|
||||||
It creates or updates a file called `PklProject.deps.json` in the project's root directory with the list of resolved dependencies.
|
It creates or updates a file called `PklProject.deps.json` in the project's root directory with the list of resolved dependencies.
|
||||||
|
|
||||||
When resolving version conflicts, the CLI will pick the latest link:{uri-semver}[semver] minor version of each package.
|
When resolving version conflicts, the CLI will pick the latest link:{uri-semver}[semver] minor version of each package.
|
||||||
@@ -5212,11 +5408,11 @@ package {
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
<1> The display name of the package. For display purposes only.
|
<1> The display name of the package. For display purposes only.
|
||||||
<2> The package URI, without the version part
|
<2> The package URI, without the version part.
|
||||||
<3> The version of the package
|
<3> The version of the package.
|
||||||
<4> The URL that the package's ZIP file will available for download at.
|
<4> The URL to download the package's ZIP file.
|
||||||
|
|
||||||
The package itself is created by command xref:pkl-cli:index.adoc#command-project-package[`pkl project package`].
|
The package itself is created by the command xref:pkl-cli:index.adoc#command-project-package[`pkl project package`].
|
||||||
|
|
||||||
This command only prepares artifacts to be published.
|
This command only prepares artifacts to be published.
|
||||||
Once the artifacts are prepared, they are expected to be uploaded to an HTTPS server such that the ZIP asset can be downloaded at path `packageZipUrl`, and the metadata can be downloaded at `+https://<package uri>+`.
|
Once the artifacts are prepared, they are expected to be uploaded to an HTTPS server such that the ZIP asset can be downloaded at path `packageZipUrl`, and the metadata can be downloaded at `+https://<package uri>+`.
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 124 KiB |
@@ -33,7 +33,7 @@ parrot = (bird) {
|
|||||||
----
|
----
|
||||||
|
|
||||||
Parrot and Pigeon have nearly identical properties.
|
Parrot and Pigeon have nearly identical properties.
|
||||||
They only differ in their name and taxonomy, so if you have already written out `bird`, you can say that `parrot` is just like `pigeon` except `name` is `"Parrot"`, diet is `"Berries"` the `taxonomy.order` is `"Psittaciformes"`.
|
They only differ in their name and taxonomy, so if you have already written out `bird`, you can say that `parrot` is just like `bird` except `name` is `"Parrot"`, diet is `"Berries"` the `taxonomy.order` is `"Psittaciformes"`.
|
||||||
When you run this, Pkl expands everything fully.
|
When you run this, Pkl expands everything fully.
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
@@ -58,9 +58,12 @@ parrot {
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
[IMPORTANT]
|
[NOTE]
|
||||||
====
|
====
|
||||||
_Amending_ does not allow us to _add_ properties to the (typed) object we are amending.
|
So far, you have only worked with link:{uri-stdlib-Dynamic}[Dynamic] objects.
|
||||||
|
Pkl also offers link:{uri-stdlib-Typed}[Typed] objects.
|
||||||
|
_Amending_ allows you to override, amend, and add new properties to a dynamic object.
|
||||||
|
Typed objects will only let you amend or override existing properties, not add entirely new ones.
|
||||||
The xref:03_writing_a_template.adoc[next part of the tutorial] discusses types in more detail.
|
The xref:03_writing_a_template.adoc[next part of the tutorial] discusses types in more detail.
|
||||||
There, you see that amending _never changes the type_ of the object.
|
There, you see that amending _never changes the type_ of the object.
|
||||||
====
|
====
|
||||||
@@ -72,22 +75,25 @@ Consider the following example.
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.nestedAmends.pkl
|
.nestedAmends.pkl
|
||||||
----
|
----
|
||||||
woodPigeon {
|
stockPigeon {
|
||||||
name = "Common wood pigeon"
|
name = "Stock pigeon"
|
||||||
diet = "Seeds"
|
diet = "Seeds"
|
||||||
taxonomy {
|
taxonomy {
|
||||||
species = "Columba palumbus"
|
kingdom = "Animalia"
|
||||||
}
|
clade = "Columbimorphae"
|
||||||
}
|
order = "Columbiformes"
|
||||||
|
|
||||||
stockPigeon = (woodPigeon) {
|
|
||||||
name = "Stock pigeon"
|
|
||||||
taxonomy { // <1>
|
|
||||||
species = "Columba oenas"
|
species = "Columba oenas"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dodo = (stockPigeon) { // <2>
|
woodPigeon = (stockPigeon) {
|
||||||
|
name = "Common wood pigeon"
|
||||||
|
taxonomy { // <1>
|
||||||
|
species = "Columba palumbus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dodo = (woodPigeon) { // <2>
|
||||||
name = "Dodo"
|
name = "Dodo"
|
||||||
extinct = true // <3>
|
extinct = true // <3>
|
||||||
taxonomy {
|
taxonomy {
|
||||||
@@ -100,7 +106,7 @@ dodo = (stockPigeon) { // <2>
|
|||||||
<3> New fields can be added to objects when amending.
|
<3> New fields can be added to objects when amending.
|
||||||
|
|
||||||
Notice how you only have to change `taxonomy.species`.
|
Notice how you only have to change `taxonomy.species`.
|
||||||
In this example, `bird.taxonomy` has `kingdom`, `clade`, `order` and `species`.
|
In this example, `stockPigeon.taxonomy` has `kingdom`, `clade`, `order` and `species`.
|
||||||
You are amending `stockPigeon`, to define `woodPigeon`.
|
You are amending `stockPigeon`, to define `woodPigeon`.
|
||||||
They have the same `taxonomy`, except for `species`.
|
They have the same `taxonomy`, except for `species`.
|
||||||
This notation says that everything in `taxonomy` should be what it is in the object you are amending (`stockPigeon`), except for `species`, which should be `"Columba palumbus"` .
|
This notation says that everything in `taxonomy` should be what it is in the object you are amending (`stockPigeon`), except for `species`, which should be `"Columba palumbus"` .
|
||||||
@@ -108,27 +114,36 @@ This notation says that everything in `taxonomy` should be what it is in the obj
|
|||||||
For the input above, Pkl produces the following output.
|
For the input above, Pkl produces the following output.
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
----
|
----
|
||||||
woodPigeon {
|
|
||||||
name = "Common wood pigeon"
|
|
||||||
diet = "Seeds"
|
|
||||||
taxonomy {
|
|
||||||
species = "Columba palumbus"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stockPigeon {
|
stockPigeon {
|
||||||
name = "Stock pigeon"
|
name = "Stock pigeon"
|
||||||
diet = "Seeds"
|
diet = "Seeds"
|
||||||
taxonomy {
|
taxonomy {
|
||||||
|
kingdom = "Animalia"
|
||||||
|
clade = "Columbimorphae"
|
||||||
|
order = "Columbiformes"
|
||||||
species = "Columba oenas"
|
species = "Columba oenas"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
woodPigeon {
|
||||||
|
name = "Common wood pigeon"
|
||||||
|
diet = "Seeds"
|
||||||
|
taxonomy {
|
||||||
|
kingdom = "Animalia"
|
||||||
|
clade = "Columbimorphae"
|
||||||
|
order = "Columbiformes"
|
||||||
|
species = "Columba palumbus"
|
||||||
|
}
|
||||||
|
}
|
||||||
dodo {
|
dodo {
|
||||||
name = "Dodo"
|
name = "Dodo"
|
||||||
diet = "Seeds"
|
diet = "Seeds"
|
||||||
extinct = true
|
|
||||||
taxonomy {
|
taxonomy {
|
||||||
|
kingdom = "Animalia"
|
||||||
|
clade = "Columbimorphae"
|
||||||
|
order = "Columbiformes"
|
||||||
species = "Raphus cucullatus"
|
species = "Raphus cucullatus"
|
||||||
}
|
}
|
||||||
|
extinct = true
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
@@ -206,6 +221,8 @@ Going back to the example above, you can write `parrot` as a separate module.
|
|||||||
name = "Common wood pigeon"
|
name = "Common wood pigeon"
|
||||||
diet = "Seeds"
|
diet = "Seeds"
|
||||||
taxonomy {
|
taxonomy {
|
||||||
|
kingdom = "Animalia"
|
||||||
|
clade = "Dinosauria"
|
||||||
species = "Columba palumbus"
|
species = "Columba palumbus"
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
@@ -236,6 +253,8 @@ $ pkl eval /Users/me/tutorial/pigeon.pkl
|
|||||||
name = "Common wood pigeon"
|
name = "Common wood pigeon"
|
||||||
diet = "Seeds"
|
diet = "Seeds"
|
||||||
taxonomy {
|
taxonomy {
|
||||||
|
kingdom = "Animalia"
|
||||||
|
clade = "Dinosauria"
|
||||||
species = "Columba palumbus"
|
species = "Columba palumbus"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,6 +263,8 @@ parrot {
|
|||||||
name = "Great green macaw"
|
name = "Great green macaw"
|
||||||
diet = "Berries"
|
diet = "Berries"
|
||||||
taxonomy {
|
taxonomy {
|
||||||
|
kingdom = "Animalia"
|
||||||
|
clade = "Dinosauria"
|
||||||
species = "Ara ambiguus"
|
species = "Ara ambiguus"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -275,9 +296,9 @@ This terminology describes the _intended use_ of the module and doesn't imply an
|
|||||||
In other words: just by looking at Pkl code, you can't tell whether it is a template or a "normal" module.
|
In other words: just by looking at Pkl code, you can't tell whether it is a template or a "normal" module.
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.acmecicd.pkl
|
.AcmeCICD.pkl
|
||||||
----
|
----
|
||||||
module acmecicd
|
module AcmeCICD
|
||||||
|
|
||||||
class Pipeline {
|
class Pipeline {
|
||||||
name: String(nameRequiresBranchName)?
|
name: String(nameRequiresBranchName)?
|
||||||
@@ -307,7 +328,7 @@ Next, add a time-out of one minute for your job.
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.cicd.pkl
|
.cicd.pkl
|
||||||
----
|
----
|
||||||
amends "acmecicd.pkl"
|
amends "AcmeCICD.pkl"
|
||||||
|
|
||||||
timeout = 1
|
timeout = 1
|
||||||
----
|
----
|
||||||
@@ -320,7 +341,7 @@ Value: 1 // <3>
|
|||||||
|
|
||||||
225 | timeout: Int(this >= 3)? // <4>
|
225 | timeout: Int(this >= 3)? // <4>
|
||||||
^^^^^^^^^
|
^^^^^^^^^
|
||||||
at acmecicd#timeout (file:///Users/me/tutorial/acmecicd.pkl, line 8)
|
at AcmeCICD#timeout (file:///Users/me/tutorial/AcmeCICD.pkl, line 8)
|
||||||
|
|
||||||
3 | timeout = 1 // <5>
|
3 | timeout = 1 // <5>
|
||||||
^
|
^
|
||||||
@@ -360,7 +381,7 @@ Start off by specifying the name of the pipeline and nothing else.
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.cicd.pkl
|
.cicd.pkl
|
||||||
----
|
----
|
||||||
amends "acmecicd.pkl"
|
amends "AcmeCICD.pkl"
|
||||||
|
|
||||||
timeout = 3
|
timeout = 3
|
||||||
pipelines {
|
pipelines {
|
||||||
@@ -372,11 +393,11 @@ pipelines {
|
|||||||
<1> There is no pipeline object to amend. The `new` keyword gives you an object to amend.
|
<1> There is no pipeline object to amend. The `new` keyword gives you an object to amend.
|
||||||
|
|
||||||
So far, you've defined objects the same way you amended them.
|
So far, you've defined objects the same way you amended them.
|
||||||
When the `name` didn't occur before, `new { ... }` _creates_ a property called `name` and assigns to it the object specified on the `Listing`.
|
If the name `foo` didn't occur before, `foo { ... }` _creates_ a property called `foo` and assigns to it the contents in place of the `...` (given that `...` is not valid Pkl, but an abbreviation for illustration purposes).
|
||||||
If `name` is an existing object, this notation is an _amend expression_; resulting in a new _object_ (value), but _not_ a new (named) property.
|
If `foo` is an existing object, this notation is an _amend expression_; resulting in a new _object_ (value), but _not_ a new (named) property.
|
||||||
Since `pipelines` is a listing, you can _add_ elements by writing expressions in an amend expression.
|
Since `pipelines` is a listing, you can _add_ elements by writing expressions in an amend expression.
|
||||||
|
|
||||||
In this case, though, there is no object to amend. Writing `pipelines { ... }` defines a _property_, but listings may only include _elements_.
|
In this case, though, there is no object to amend. Writing `myNewPipeline { ... }` defines a _property_, but listings may only include _elements_.
|
||||||
This is where you can use the keyword `new`.
|
This is where you can use the keyword `new`.
|
||||||
|
|
||||||
`new` gives you an object to amend.
|
`new` gives you an object to amend.
|
||||||
@@ -394,7 +415,7 @@ Pipelines that set a 'name' must also set a 'branchName'.
|
|||||||
|
|
||||||
8 | throw("Pipelines that set a 'name' must also set a 'branchName'.")
|
8 | throw("Pipelines that set a 'name' must also set a 'branchName'.")
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
at acmecicd#Pipeline.nameRequiresBranchName.<function#1> (file:///Users/me/tutorial/acmecicd.pkl, line 8)
|
at AcmeCICD#Pipeline.nameRequiresBranchName.<function#1> (file:///Users/me/tutorial/AcmeCICD.pkl, line 8)
|
||||||
|
|
||||||
6 | name = "prb"
|
6 | name = "prb"
|
||||||
^^^^^
|
^^^^^
|
||||||
@@ -415,7 +436,7 @@ The message is quite instructive, so you can fix the error by adding a `branchNa
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.cicd.pkl
|
.cicd.pkl
|
||||||
----
|
----
|
||||||
amends "acmecicd.pkl"
|
amends "AcmeCICD.pkl"
|
||||||
|
|
||||||
timeout = 3
|
timeout = 3
|
||||||
pipelines {
|
pipelines {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include::ROOT:partial$component-attributes.adoc[]
|
|||||||
|
|
||||||
In parts xref:01_basic_config.adoc[one] and xref:02_filling_out_a_template.adoc[two], you saw that Pkl provides _validation_ of our configurations.
|
In parts xref:01_basic_config.adoc[one] and xref:02_filling_out_a_template.adoc[two], you saw that Pkl provides _validation_ of our configurations.
|
||||||
It checks syntax, types and constraints.
|
It checks syntax, types and constraints.
|
||||||
As you saw in the `acmecicd` example xref:02_filling_out_a_template.adoc#amending-templates[here], the template can provide informative error messages when an amending module violates a type constraint.
|
As you saw in the `AcmeCICD` example xref:02_filling_out_a_template.adoc#amending-templates[here], the template can provide informative error messages when an amending module violates a type constraint.
|
||||||
|
|
||||||
In this final part, you will see some of Pkl's techniques that are particularly relevant for writing a template.
|
In this final part, you will see some of Pkl's techniques that are particularly relevant for writing a template.
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ amountLearned: Float = 13.37
|
|||||||
|
|
||||||
duration: Duration = 30.min
|
duration: Duration = 30.min
|
||||||
|
|
||||||
bandwidthRequirementPerSecond: DataSize = 50.mb
|
bandwidthRequirementPerSecond: DataSize = 52.4288.mb
|
||||||
----
|
----
|
||||||
|
|
||||||
In the above, you've explicitly annotated the code with type signatures.
|
In the above, you've explicitly annotated the code with type signatures.
|
||||||
@@ -45,7 +45,7 @@ part = 3
|
|||||||
hasExercises = true
|
hasExercises = true
|
||||||
amountLearned = 13.37
|
amountLearned = 13.37
|
||||||
duration = 30.min
|
duration = 30.min
|
||||||
bandwidthRequirementPerSecond = 50.mb
|
bandwidthRequirementPerSecond = 52.4288.mb
|
||||||
----
|
----
|
||||||
|
|
||||||
Note how `Duration` and `DataSize` help you prevent https://en.wikipedia.org/wiki/Mars_Climate_Orbiter[unit errors] in these common (for configuration) domains.
|
Note how `Duration` and `DataSize` help you prevent https://en.wikipedia.org/wiki/Mars_Climate_Orbiter[unit errors] in these common (for configuration) domains.
|
||||||
@@ -146,7 +146,7 @@ pklTutorialPart1 {
|
|||||||
hasExercises = true
|
hasExercises = true
|
||||||
amountLearned = 13.37
|
amountLearned = 13.37
|
||||||
duration = 30.min
|
duration = 30.min
|
||||||
bandwidthRequirementPerSecond = 50.mb
|
bandwidthRequirementPerSecond = 52.4288.mb
|
||||||
}
|
}
|
||||||
pklTutorialPart2 {
|
pklTutorialPart2 {
|
||||||
name = "Filling out a Template"
|
name = "Filling out a Template"
|
||||||
@@ -154,7 +154,7 @@ pklTutorialPart2 {
|
|||||||
hasExercises = true
|
hasExercises = true
|
||||||
amountLearned = 13.37
|
amountLearned = 13.37
|
||||||
duration = 30.min
|
duration = 30.min
|
||||||
bandwidthRequirementPerSecond = 50.mb
|
bandwidthRequirementPerSecond = 52.4288.mb
|
||||||
}
|
}
|
||||||
pklTutorialPart3 {
|
pklTutorialPart3 {
|
||||||
name = "Writing a Template"
|
name = "Writing a Template"
|
||||||
@@ -162,7 +162,7 @@ pklTutorialPart3 {
|
|||||||
hasExercises = true
|
hasExercises = true
|
||||||
amountLearned = 13.37
|
amountLearned = 13.37
|
||||||
duration = 30.min
|
duration = 30.min
|
||||||
bandwidthRequirementPerSecond = 50.mb
|
bandwidthRequirementPerSecond = 52.4288.mb
|
||||||
}
|
}
|
||||||
|
|
||||||
----
|
----
|
||||||
@@ -199,7 +199,7 @@ amountLearned: Float = 13.37 // <2>
|
|||||||
|
|
||||||
duration: Duration = 30.min // <2>
|
duration: Duration = 30.min // <2>
|
||||||
|
|
||||||
bandwidthRequirementPerSecond: DataSize = 50.mb // <2>
|
bandwidthRequirementPerSecond: DataSize = 52.4288.mb // <2>
|
||||||
----
|
----
|
||||||
<1> No default value given.
|
<1> No default value given.
|
||||||
<2> Default value given.
|
<2> Default value given.
|
||||||
@@ -239,7 +239,7 @@ part = 3
|
|||||||
hasExercises = true
|
hasExercises = true
|
||||||
amountLearned = 13.37
|
amountLearned = 13.37
|
||||||
duration = 30.min
|
duration = 30.min
|
||||||
bandwidthRequirementPerSecond = 50.mb
|
bandwidthRequirementPerSecond = 52.4288.mb
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ By "precisely" we mean, that amending an object also can't "turn it into" an ins
|
|||||||
== A new template
|
== A new template
|
||||||
|
|
||||||
Now that you know about types, you can start writing your first template.
|
Now that you know about types, you can start writing your first template.
|
||||||
So far, you've written configurations with Pkl, either without a template, or using the `acmecicd` template from xref:02_filling_out_a_template.adoc#amending-templates[Amending templates].
|
So far, you've written configurations with Pkl, either without a template, or using the `AcmeCICD` template from xref:02_filling_out_a_template.adoc#amending-templates[Amending templates].
|
||||||
It is often easiest to first write a (typical) configuration for which you want to create a template.
|
It is often easiest to first write a (typical) configuration for which you want to create a template.
|
||||||
Suppose you want to define what a live workshop for this tutorial looks like.
|
Suppose you want to define what a live workshop for this tutorial looks like.
|
||||||
Consider this example:
|
Consider this example:
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
include::ROOT:partial$component-attributes.adoc[]
|
include::ROOT:partial$component-attributes.adoc[]
|
||||||
:uri-homebrew: https://brew.sh
|
:uri-homebrew: https://brew.sh
|
||||||
|
|
||||||
:uri-pkl-macos-amd64-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-macos-amd64/{pkl-artifact-version}/pkl-cli-macos-amd64-{pkl-artifact-version}.bin
|
:uri-sonatype-snapshot-download: https://s01.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.pkl-lang&v={pkl-artifact-version}
|
||||||
:uri-pkl-macos-aarch64-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-macos-aarch64/{pkl-artifact-version}/pkl-cli-macos-aarch64-{pkl-artifact-version}.bin
|
:uri-pkl-macos-amd64-download: {uri-sonatype-snapshot-download}&a=pkl-cli-macos-amd64&e=bin
|
||||||
:uri-pkl-linux-amd64-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-linux-amd64/{pkl-artifact-version}/pkl-cli-linux-amd64-{pkl-artifact-version}.bin
|
:uri-pkl-macos-aarch64-download: {uri-sonatype-snapshot-download}&a=pkl-cli-macos-aarch64&e=bin
|
||||||
:uri-pkl-linux-aarch64-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-linux-aarch64/{pkl-artifact-version}/pkl-cli-linux-aarch64-{pkl-artifact-version}.bin
|
:uri-pkl-linux-amd64-download: {uri-sonatype-snapshot-download}&a=pkl-cli-linux-amd64&e=bin
|
||||||
:uri-pkl-alpine-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-alpine-linux-amd64/{pkl-artifact-version}/pkl-cli-alpine-linux-amd64-{pkl-artifact-version}.bin
|
:uri-pkl-linux-aarch64-download: {uri-sonatype-snapshot-download}&a=pkl-cli-linux-aarch64&e=bin
|
||||||
:uri-pkl-java-download: https://repo1.maven.org/maven2/org/pkl-lang/pkl-cli-java/{pkl-artifact-version}/pkl-cli-java-{pkl-artifact-version}.jar
|
:uri-pkl-alpine-download: {uri-sonatype-snapshot-download}&a=pkl-cli-alpine-linux-amd64&e=bin
|
||||||
|
:uri-pkl-windows-download: {uri-sonatype-snapshot-download}&a=pkl-cli-windows-amd64&e=exe
|
||||||
|
:uri-pkl-java-download: {uri-sonatype-snapshot-download}&a=pkl-cli-java&e=jar
|
||||||
|
|
||||||
ifdef::is-release-version[]
|
ifdef::is-release-version[]
|
||||||
:uri-pkl-macos-amd64-download: {github-releases}/pkl-macos-amd64
|
:uri-pkl-macos-amd64-download: {github-releases}/pkl-macos-amd64
|
||||||
@@ -15,6 +17,7 @@ ifdef::is-release-version[]
|
|||||||
:uri-pkl-linux-amd64-download: {github-releases}/pkl-linux-amd64
|
:uri-pkl-linux-amd64-download: {github-releases}/pkl-linux-amd64
|
||||||
:uri-pkl-linux-aarch64-download: {github-releases}/pkl-linux-aarch64
|
:uri-pkl-linux-aarch64-download: {github-releases}/pkl-linux-aarch64
|
||||||
:uri-pkl-alpine-download: {github-releases}/pkl-alpine-linux-amd64
|
:uri-pkl-alpine-download: {github-releases}/pkl-alpine-linux-amd64
|
||||||
|
:uri-pkl-windows-download: {github-releases}/pkl-windows-amd64.exe
|
||||||
:uri-pkl-java-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-java/{pkl-artifact-version}/pkl-cli-java-{pkl-artifact-version}.jar
|
:uri-pkl-java-download: {uri-maven-repo}/org/pkl-lang/pkl-cli-java/{pkl-artifact-version}/pkl-cli-java-{pkl-artifact-version}.jar
|
||||||
endif::[]
|
endif::[]
|
||||||
|
|
||||||
@@ -22,6 +25,7 @@ endif::[]
|
|||||||
:uri-pkl-cli-main-sources: {uri-github-tree}/pkl-cli/src/main/kotlin/org/pkl/cli
|
:uri-pkl-cli-main-sources: {uri-github-tree}/pkl-cli/src/main/kotlin/org/pkl/cli
|
||||||
:uri-pkl-cli-CliEvaluatorOptions: {uri-pkl-cli-main-sources}/CliEvaluatorOptions.kt
|
:uri-pkl-cli-CliEvaluatorOptions: {uri-pkl-cli-main-sources}/CliEvaluatorOptions.kt
|
||||||
:uri-certificates: {uri-github-tree}/pkl-commons-cli/src/main/resources/org/pkl/commons/cli/commands
|
:uri-certificates: {uri-github-tree}/pkl-commons-cli/src/main/resources/org/pkl/commons/cli/commands
|
||||||
|
:uri-ci-artifacts: https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/
|
||||||
|
|
||||||
The `pkl` command-line interface (CLI) evaluates Pkl modules and writes their output to the console or a file.
|
The `pkl` command-line interface (CLI) evaluates Pkl modules and writes their output to the console or a file.
|
||||||
For interactive development, the CLI includes a Read-Eval-Print Loop (REPL).
|
For interactive development, the CLI includes a Read-Eval-Print Loop (REPL).
|
||||||
@@ -35,9 +39,10 @@ The CLI comes in multiple flavors:
|
|||||||
* Native Linux executable for amd64
|
* Native Linux executable for amd64
|
||||||
* Native Linux executable for aarch64
|
* Native Linux executable for aarch64
|
||||||
* Native Alpine Linux executable for amd64 (cross-compiled and tested on Oracle Linux 8)
|
* Native Alpine Linux executable for amd64 (cross-compiled and tested on Oracle Linux 8)
|
||||||
* Java executable (tested with Java 11/17 on macOS and Oracle Linux)
|
* Native Windows executable for amd64 (tested on Windows Server 2022)
|
||||||
|
* Java executable (tested with Java 17/21 on macOS and Oracle Linux)
|
||||||
|
|
||||||
On macOS and Linux, we recommend using the native executables.
|
On macOS, Linux, and Windows, we recommend using the native executables.
|
||||||
They are self-contained, start up instantly, and run complex Pkl code much faster than the Java executable.
|
They are self-contained, start up instantly, and run complex Pkl code much faster than the Java executable.
|
||||||
|
|
||||||
.What is the Difference Between the Linux and Alpine Linux Executables?
|
.What is the Difference Between the Linux and Alpine Linux Executables?
|
||||||
@@ -48,7 +53,7 @@ whereas, the Alpine Linux executable is statically linked against _musl libc_ an
|
|||||||
====
|
====
|
||||||
|
|
||||||
The Java executable works on multiple platforms and has a smaller binary size than the native executables.
|
The Java executable works on multiple platforms and has a smaller binary size than the native executables.
|
||||||
However, it requires a Java 11 (or higher) runtime on the system path, has a noticeable startup delay,
|
However, it requires a Java 17 (or higher) runtime on the system path, has a noticeable startup delay,
|
||||||
and runs complex Pkl code slower than the native executables.
|
and runs complex Pkl code slower than the native executables.
|
||||||
|
|
||||||
All flavors are built from the same codebase and undergo the same automated testing.
|
All flavors are built from the same codebase and undergo the same automated testing.
|
||||||
@@ -57,7 +62,7 @@ Except where noted otherwise, the rest of this page discusses the native executa
|
|||||||
[[homebrew]]
|
[[homebrew]]
|
||||||
=== Homebrew
|
=== Homebrew
|
||||||
|
|
||||||
Release versions can be installed with {uri-homebrew}[Homebrew].
|
On macOS and Linux, release versions can be installed with {uri-homebrew}[Homebrew].
|
||||||
|
|
||||||
ifdef::is-release-version[]
|
ifdef::is-release-version[]
|
||||||
To install Pkl, run:
|
To install Pkl, run:
|
||||||
@@ -92,7 +97,7 @@ On aarch64:
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
curl -L -o pkl {uri-pkl-macos-aarch64-download}
|
curl -L -o pkl '{uri-pkl-macos-aarch64-download}'
|
||||||
chmod +x pkl
|
chmod +x pkl
|
||||||
./pkl --version
|
./pkl --version
|
||||||
----
|
----
|
||||||
@@ -102,14 +107,14 @@ On amd64:
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
curl -L -o pkl {uri-pkl-macos-amd64-download}
|
curl -L -o pkl '{uri-pkl-macos-amd64-download}'
|
||||||
chmod +x pkl
|
chmod +x pkl
|
||||||
./pkl --version
|
./pkl --version
|
||||||
----
|
----
|
||||||
|
|
||||||
This should print something similar to:
|
This should print something similar to:
|
||||||
|
|
||||||
[source,shell]
|
[source]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
Pkl {pkl-version} (macOS, native)
|
Pkl {pkl-version} (macOS, native)
|
||||||
@@ -126,7 +131,7 @@ On aarch64:
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
curl -L -o pkl {uri-pkl-linux-aarch64-download}
|
curl -L -o pkl '{uri-pkl-linux-aarch64-download}'
|
||||||
chmod +x pkl
|
chmod +x pkl
|
||||||
./pkl --version
|
./pkl --version
|
||||||
----
|
----
|
||||||
@@ -136,14 +141,14 @@ On amd64:
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
curl -L -o pkl {uri-pkl-linux-amd64-download}
|
curl -L -o pkl '{uri-pkl-linux-amd64-download}'
|
||||||
chmod +x pkl
|
chmod +x pkl
|
||||||
./pkl --version
|
./pkl --version
|
||||||
----
|
----
|
||||||
|
|
||||||
This should print something similar to:
|
This should print something similar to:
|
||||||
|
|
||||||
[source,shell]
|
[source]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
Pkl {pkl-version} (Linux, native)
|
Pkl {pkl-version} (Linux, native)
|
||||||
@@ -158,14 +163,14 @@ For a dynamically linked executable, see <<Linux Executable>>.
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
curl -L -o pkl {uri-pkl-alpine-download}
|
curl -L -o pkl '{uri-pkl-alpine-download}'
|
||||||
chmod +x pkl
|
chmod +x pkl
|
||||||
./pkl --version
|
./pkl --version
|
||||||
----
|
----
|
||||||
|
|
||||||
This should print something similar to:
|
This should print something similar to:
|
||||||
|
|
||||||
[source,shell]
|
[source]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
Pkl {pkl-version} (Linux, native)
|
Pkl {pkl-version} (Linux, native)
|
||||||
@@ -173,12 +178,33 @@ Pkl {pkl-version} (Linux, native)
|
|||||||
|
|
||||||
NOTE: We currently do not support the aarch64 architecture for Alpine Linux.
|
NOTE: We currently do not support the aarch64 architecture for Alpine Linux.
|
||||||
|
|
||||||
|
[[windows-executable]]
|
||||||
|
=== Windows Executable
|
||||||
|
|
||||||
|
[source,PowerShell]
|
||||||
|
[subs="+attributes"]
|
||||||
|
----
|
||||||
|
Invoke-WebRequest '{uri-pkl-windows-download}' -OutFile pkl.exe
|
||||||
|
.\pkl --version
|
||||||
|
----
|
||||||
|
|
||||||
|
This should print something similar to:
|
||||||
|
|
||||||
|
[source]
|
||||||
|
[subs="+attributes"]
|
||||||
|
----
|
||||||
|
Pkl {pkl-version} (Windows 10.0, native)
|
||||||
|
----
|
||||||
|
|
||||||
|
NOTE: We currently do not support the aarch64 architecture for Windows.
|
||||||
|
|
||||||
|
[[java-executable]]
|
||||||
=== Java Executable
|
=== Java Executable
|
||||||
|
|
||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
curl -L -o jpkl {uri-pkl-java-download}
|
curl -L -o jpkl '{uri-pkl-java-download}'
|
||||||
chmod +x jpkl
|
chmod +x jpkl
|
||||||
./jpkl --version
|
./jpkl --version
|
||||||
----
|
----
|
||||||
@@ -188,9 +214,12 @@ This should print something similar to:
|
|||||||
[source,shell]
|
[source,shell]
|
||||||
[subs="+attributes"]
|
[subs="+attributes"]
|
||||||
----
|
----
|
||||||
Pkl {pkl-version} (macOS 10.16, Java 11.0.9)
|
Pkl {pkl-version} (macOS 14.2, Java 17.0.10)
|
||||||
----
|
----
|
||||||
|
|
||||||
|
NOTE: The Java executable does not work as an executable file on Windows.
|
||||||
|
However, it will work as a jar, for example, with `java -jar jpkl`.
|
||||||
|
|
||||||
[[usage]]
|
[[usage]]
|
||||||
== Usage
|
== Usage
|
||||||
|
|
||||||
@@ -365,7 +394,7 @@ This command also takes <<common-options, common options>>.
|
|||||||
[[command-server]]
|
[[command-server]]
|
||||||
=== `pkl server`
|
=== `pkl server`
|
||||||
|
|
||||||
*Synopsys:* `pkl server`
|
*Synopsis:* `pkl server`
|
||||||
|
|
||||||
Run as a server that communicates over standard input/output.
|
Run as a server that communicates over standard input/output.
|
||||||
|
|
||||||
@@ -374,7 +403,7 @@ This option is used for embedding Pkl in an external client, such as xref:swift:
|
|||||||
[[command-test]]
|
[[command-test]]
|
||||||
=== `pkl test`
|
=== `pkl test`
|
||||||
|
|
||||||
*Synopsys:* `pkl test [<options>] [<modules>]`
|
*Synopsis:* `pkl test [<options>] [<modules>]`
|
||||||
|
|
||||||
Evaluate the given `<modules>` as _tests_, producing a test report and appropriate exit code.
|
Evaluate the given `<modules>` as _tests_, producing a test report and appropriate exit code.
|
||||||
|
|
||||||
@@ -409,7 +438,7 @@ This command also takes <<common-options, common options>>.
|
|||||||
[[command-repl]]
|
[[command-repl]]
|
||||||
=== `pkl repl`
|
=== `pkl repl`
|
||||||
|
|
||||||
*Synopsys:* `pkl repl [<options>]`
|
*Synopsis:* `pkl repl [<options>]`
|
||||||
|
|
||||||
Start a REPL session.
|
Start a REPL session.
|
||||||
|
|
||||||
@@ -802,3 +831,48 @@ These certificates can be overridden via either of the two options:
|
|||||||
Both these options will *replace* the default CA certificates bundled with Pkl. +
|
Both these options will *replace* the default CA certificates bundled with Pkl. +
|
||||||
The CLI option takes precedence over the certificates in `~/.pkl/cacerts/`. +
|
The CLI option takes precedence over the certificates in `~/.pkl/cacerts/`. +
|
||||||
Certificates need to be X.509 certificates in PEM format.
|
Certificates need to be X.509 certificates in PEM format.
|
||||||
|
|
||||||
|
[[http-proxy]]
|
||||||
|
== HTTP Proxying
|
||||||
|
|
||||||
|
When making HTTP(s) requests, Pkl can possibly make use of an HTTP proxy.
|
||||||
|
|
||||||
|
There are two values that determine proxy settings; the proxy address and list of noproxy rules.
|
||||||
|
When determining proxy settings, Pkl will look at the following locations, in order of precedence (lowest to highest):
|
||||||
|
|
||||||
|
1. OS settings (on macOS, Windows, and GNOME environments)
|
||||||
|
2. <<settings-file,Settings file>>
|
||||||
|
3. xref:language-reference:index.adoc#projects[PklProject file]
|
||||||
|
4. `--http-proxy` and `--http-no-proxy` CLI flags
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
====
|
||||||
|
The proxy and noproxy values are individually set.
|
||||||
|
For example, using the `--http-no-proxy` flag but not the `--http-proxy` flag will cause Pkl to look at the PklProject file, then the settings file, then system settings for the proxy address.
|
||||||
|
|
||||||
|
One exception to this rule is that setting a proxy address will cause Pkl to ignore any noproxy values set at the OS level.
|
||||||
|
====
|
||||||
|
|
||||||
|
Pkl only supports HTTP proxies, so neither HTTPS nor SOCKS proxies are supported.
|
||||||
|
Pkl does not support authentication with a proxy.
|
||||||
|
|
||||||
|
When specifying a proxy address, it must have scheme `http`, and may not contain anything other than a host and port.
|
||||||
|
|
||||||
|
=== Proxy exclusions
|
||||||
|
|
||||||
|
Pkl can be configured to bypass the proxy for specific requests via a proxy exclusion rule (i.e. the `--http-no-proxy` flag).
|
||||||
|
It may be provided either as a hostname, an IP address, or an IP range via https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation[CIDR notation].
|
||||||
|
When determining whether a proxy should be excluded, hostnames do not get resolved to their IP address.
|
||||||
|
For example, a request to `localhost` will not match `--http-no-proxy=127.0.0.1`.
|
||||||
|
|
||||||
|
For individual hosts (not CIDRs), ports can be specified.
|
||||||
|
When no port is specified for a given host, connections to all ports bypass the proxy.
|
||||||
|
|
||||||
|
A hostname will match all of its subdomains.
|
||||||
|
For example, `example.com` will match `foo.example.com`, and `bar.foo.example.com`, but not `fooexample.com`.
|
||||||
|
|
||||||
|
The value `*` is a special wildcard that matches all hosts.
|
||||||
|
|
||||||
|
A port can optionally be specified. If omitted, it matches all ports.
|
||||||
|
|
||||||
|
NOTE: Pkl follows the rules described in https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/#standardizing-no_proxy[Standardizing `no_proxy`], except it does not look at environment variables.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ The cache directory for storing packages.
|
|||||||
.--no-cache
|
.--no-cache
|
||||||
[%collapsible]
|
[%collapsible]
|
||||||
====
|
====
|
||||||
Disable cacheing of packages.
|
Disable caching of packages.
|
||||||
====
|
====
|
||||||
|
|
||||||
.-e, --env-var
|
.-e, --env-var
|
||||||
@@ -122,3 +122,21 @@ Certificates need to be X.509 certificates in PEM format.
|
|||||||
|
|
||||||
For other methods of configuring certificates, see xref:pkl-cli:index.adoc#ca-certs[CA Certificates].
|
For other methods of configuring certificates, see xref:pkl-cli:index.adoc#ca-certs[CA Certificates].
|
||||||
====
|
====
|
||||||
|
|
||||||
|
.--http-proxy
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: (none) +
|
||||||
|
Example: `\http://proxy.example.com:1234` +
|
||||||
|
Configures HTTP connections to connect to the provided proxy address.
|
||||||
|
The URI must have scheme `http`, and may not contain anything other than a host and port.
|
||||||
|
====
|
||||||
|
|
||||||
|
.--http-no-proxy
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: (none) +
|
||||||
|
Example: `example.com,169.254.0.0/16` +
|
||||||
|
Comma separated list of hosts to which all connections should bypass the proxy.
|
||||||
|
Hosts can be specified by name, IP address, or IP range using https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation[CIDR notation].
|
||||||
|
====
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ The library can also be used to embed Pkl in Java libraries and applications.
|
|||||||
== Installation
|
== Installation
|
||||||
|
|
||||||
The _pkl-core_ library is available {uri-pkl-core-maven-module}[from Maven Central].
|
The _pkl-core_ library is available {uri-pkl-core-maven-module}[from Maven Central].
|
||||||
It requires Java 11 or higher.
|
It requires Java 17 or higher.
|
||||||
|
|
||||||
=== Gradle
|
=== Gradle
|
||||||
|
|
||||||
@@ -30,13 +30,32 @@ To use the library in a Gradle project, declare the following dependency:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
dependencies {
|
||||||
|
implementation("org.pkl-lang:pkl-core:{pkl-artifact-version}")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
[source,groovy,subs="+attributes"]
|
[source,groovy,subs="+attributes"]
|
||||||
----
|
----
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.pkl-lang:pkl-core:{pkl-artifact-version}"
|
implementation "org.pkl-lang:pkl-core:{pkl-artifact-version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -48,25 +67,6 @@ ifndef::is-release-version[]
|
|||||||
endif::[]
|
endif::[]
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
dependencies {
|
|
||||||
compile("org.pkl-lang:pkl-core:{pkl-artifact-version}")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
=== Maven
|
=== Maven
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ See xref:pkl-gradle:index.adoc#installation[Installation] in the _Gradle Plugin_
|
|||||||
=== Java Library
|
=== Java Library
|
||||||
|
|
||||||
The `pkl-doc` library is available {uri-pkl-doc-maven}[from Maven Central].
|
The `pkl-doc` library is available {uri-pkl-doc-maven}[from Maven Central].
|
||||||
It requires Java 11 or higher.
|
It requires Java 17 or higher.
|
||||||
|
|
||||||
ifndef::is-release-version[]
|
ifndef::is-release-version[]
|
||||||
NOTE: Snapshots are published to repository `{uri-sonatype}`.
|
NOTE: Snapshots are published to repository `{uri-sonatype}`.
|
||||||
@@ -86,13 +86,32 @@ To use the library in a Gradle project, declare the following dependency:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
dependencies {
|
||||||
|
implementation("org.pkl-lang:pkl-doc:{pkl-artifact-version}")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
[source,groovy,subs="+attributes"]
|
[source,groovy,subs="+attributes"]
|
||||||
----
|
----
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.pkl-lang:pkl-doc:{pkl-artifact-version}"
|
implementation "org.pkl-lang:pkl-doc:{pkl-artifact-version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -104,25 +123,6 @@ ifndef::is-release-version[]
|
|||||||
endif::[]
|
endif::[]
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
dependencies {
|
|
||||||
compile("org.pkl-lang:pkl-doc:{pkl-artifact-version}")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
==== Maven
|
==== Maven
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ That is, plugin version `x.y.z` uses Pkl version `x.y.z`.
|
|||||||
== Installation
|
== Installation
|
||||||
|
|
||||||
The Gradle plugin is available {uri-pkl-gradle-maven-module}[from Maven Central].
|
The Gradle plugin is available {uri-pkl-gradle-maven-module}[from Maven Central].
|
||||||
It requires Java 11 or higher and Gradle 6.8 or higher.
|
It requires Java 17 or higher and Gradle 8.1 or higher.
|
||||||
Earlier Gradle versions are not supported.
|
Earlier Gradle versions are not supported.
|
||||||
|
|
||||||
ifndef::is-release-version[]
|
ifndef::is-release-version[]
|
||||||
@@ -32,6 +32,31 @@ The plugin is applied as follows:
|
|||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
====
|
====
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
.build.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
plugins {
|
||||||
|
id("org.pkl-lang") version "{pkl-artifact-version}"
|
||||||
|
}
|
||||||
|
----
|
||||||
|
+
|
||||||
|
.settings.gradle.kts
|
||||||
|
[source,kotlin,subs="+attributes"]
|
||||||
|
----
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
ifdef::is-release-version[]
|
||||||
|
mavenCentral()
|
||||||
|
endif::[]
|
||||||
|
ifndef::is-release-version[]
|
||||||
|
maven(url = "{uri-sonatype}")
|
||||||
|
endif::[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
Groovy::
|
Groovy::
|
||||||
+
|
+
|
||||||
.build.gradle
|
.build.gradle
|
||||||
@@ -56,31 +81,6 @@ endif::[]
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
Kotlin::
|
|
||||||
+
|
|
||||||
.build.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
plugins {
|
|
||||||
id("org.pkl-lang") version "{pkl-artifact-version}"
|
|
||||||
}
|
|
||||||
----
|
|
||||||
+
|
|
||||||
.settings.gradle.kts
|
|
||||||
[source,kotlin,subs="+attributes"]
|
|
||||||
----
|
|
||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
ifdef::is-release-version[]
|
|
||||||
mavenCentral()
|
|
||||||
endif::[]
|
|
||||||
ifndef::is-release-version[]
|
|
||||||
maven { url = uri("{uri-sonatype}") }
|
|
||||||
endif::[]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
----
|
|
||||||
====
|
====
|
||||||
|
|
||||||
[[module-evaluation]]
|
[[module-evaluation]]
|
||||||
@@ -626,7 +626,7 @@ Default: `false` +
|
|||||||
Whether to ignore expected example files and generate them again.
|
Whether to ignore expected example files and generate them again.
|
||||||
====
|
====
|
||||||
|
|
||||||
Common propeties:
|
Common properties:
|
||||||
|
|
||||||
include::../partials/gradle-common-properties.adoc[]
|
include::../partials/gradle-common-properties.adoc[]
|
||||||
|
|
||||||
@@ -688,6 +688,6 @@ Example: `projectDirectories.from(file("pkl-config/""))` +
|
|||||||
The project directories to create packages for.
|
The project directories to create packages for.
|
||||||
====
|
====
|
||||||
|
|
||||||
Common propeties:
|
Common properties:
|
||||||
|
|
||||||
include::../partials/gradle-common-properties.adoc[]
|
include::../partials/gradle-common-properties.adoc[]
|
||||||
|
|||||||
@@ -36,4 +36,54 @@ Example: `generateSpringBootConfig = true` +
|
|||||||
Whether to generate config classes for use with Spring Boot.
|
Whether to generate config classes for use with Spring Boot.
|
||||||
====
|
====
|
||||||
|
|
||||||
|
.renames: MapProperty<String, String>
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: `[:]` +
|
||||||
|
Example: `renames = ["foo.": "com.example.foo.", "bar.Config": "com.example.bar.Config"]` +
|
||||||
|
Allows to change default class and package names (derived from Pkl module names) in the generated code.
|
||||||
|
|
||||||
|
When you need the generated class or package names to be different from the default names derived from the Pkl module names, you can define a rename mapping, where the key is the original Pkl module name prefix, and the value is its replacement.
|
||||||
|
When you do, the generated code's `package` declarations, class names, as well as file locations, will be modified according to this mapping.
|
||||||
|
|
||||||
|
The prefixes are replaced literally, which means that dots at the end are important.
|
||||||
|
If you want to rename packages only, in most cases, you must ensure that you have an ending dot on both sides of a mapping (except for an empty mapping, if you use it), otherwise you may get unexpected results:
|
||||||
|
|
||||||
|
----
|
||||||
|
// Assuming the following mapping configuration:
|
||||||
|
renames = [
|
||||||
|
"com.foo.": "x", // Dot on the left only
|
||||||
|
"org.bar": "y.", // Dot on the right only
|
||||||
|
"net.baz": "z" // No dots
|
||||||
|
]
|
||||||
|
|
||||||
|
// The following renames will be made:
|
||||||
|
"com.foo.bar" -> "xbar" // Target prefix merged into the suffix
|
||||||
|
"org.bar.baz" -> "y..baz" // Double dot, invalid name
|
||||||
|
"net.baz.qux" -> "z.qux" // Looks okay, but...
|
||||||
|
"net.bazqux" -> "zqux" // ...may cut the name in the middle.
|
||||||
|
----
|
||||||
|
|
||||||
|
When computing the appropriate target name, the longest matching prefix is used:
|
||||||
|
|
||||||
|
----
|
||||||
|
// Assuming the following mapping configuration:
|
||||||
|
renames = [
|
||||||
|
"com.foo.Main": "w.Main",
|
||||||
|
"com.foo.": "x.",
|
||||||
|
"com.": "y.",
|
||||||
|
"": "z."
|
||||||
|
]
|
||||||
|
|
||||||
|
// The following renames will be made:
|
||||||
|
com.foo.Main -> w.Main
|
||||||
|
com.foo.bar -> x.bar
|
||||||
|
com.baz.qux -> y.baz.qux
|
||||||
|
org.foo.bar -> z.org.foo.bar
|
||||||
|
----
|
||||||
|
|
||||||
|
Keys in this mapping can be arbitrary strings, including an empty string.
|
||||||
|
Values must be valid dot-separated fully qualifed class name prefixes, possibly terminated by a dot.
|
||||||
|
====
|
||||||
|
|
||||||
// TODO: fixme (implementSerializable)
|
// TODO: fixme (implementSerializable)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ If `null`, defaults to `~/.pkl/cache`.
|
|||||||
[%collapsible]
|
[%collapsible]
|
||||||
====
|
====
|
||||||
Default: `false` +
|
Default: `false` +
|
||||||
Disable cacheing of packages.
|
Disable caching of packages.
|
||||||
====
|
====
|
||||||
|
|
||||||
.modulePath: ConfigurableFileCollection
|
.modulePath: ConfigurableFileCollection
|
||||||
@@ -83,3 +83,21 @@ Example: `modulePath.from files("dir1", "zip1.zip", "jar1.jar")` +
|
|||||||
The directories, ZIP archives, or JAR archives to search when resolving `modulepath:` URIs.
|
The directories, ZIP archives, or JAR archives to search when resolving `modulepath:` URIs.
|
||||||
Relative paths are resolved against the project directory.
|
Relative paths are resolved against the project directory.
|
||||||
====
|
====
|
||||||
|
|
||||||
|
.proxy: Property<URI>
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: `null` +
|
||||||
|
Example: `proxy = uri("http://proxy.example.com:1234")` +
|
||||||
|
Configures HTTP connections to connect to the provided proxy address.
|
||||||
|
The URI must have scheme `http`, and may not contain anything other than a host and port.
|
||||||
|
====
|
||||||
|
|
||||||
|
.noProxy: ListProperty<String>
|
||||||
|
[%collapsible]
|
||||||
|
====
|
||||||
|
Default: `null` +
|
||||||
|
Example: `noProxy = ["example.com", "169.254.0.0/16"]` +
|
||||||
|
Hosts to which all connections should bypass the proxy.
|
||||||
|
Hosts can be specified by name, IP address, or IP range using https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation[CIDR notation].
|
||||||
|
====
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
= Pkl 0.25 Release Notes
|
= Pkl 0.25 Release Notes
|
||||||
:version: 0.25
|
:version: 0.25
|
||||||
:version-minor: 0.25.3
|
:version-minor: 0.25.1
|
||||||
:release-date: February 1st, 2024
|
:release-date: February 1st, 2024
|
||||||
|
|
||||||
Pkl {version} was released on {release-date}. +
|
Pkl {version} was released on {release-date}. +
|
||||||
|
|||||||
@@ -0,0 +1,523 @@
|
|||||||
|
= Pkl 0.26 Release Notes
|
||||||
|
:version: 0.26
|
||||||
|
:version-minor: 0.26.3
|
||||||
|
:release-date: June 17th, 2024
|
||||||
|
|
||||||
|
include::ROOT:partial$component-attributes.adoc[]
|
||||||
|
|
||||||
|
Pkl {version} was released on {release-date}. +
|
||||||
|
[.small]#The latest bugfix release is {version-minor}. (xref:changelog.adoc[All Versions])#
|
||||||
|
|
||||||
|
This release brings Windows support, improvements to controlling how Pkl talks over HTTP, and also fixes a scoping bug around typealiases.
|
||||||
|
|
||||||
|
The next release (0.27) is scheduled for October 10th, 2024.
|
||||||
|
|
||||||
|
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. +
|
||||||
|
|
||||||
|
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
|
||||||
|
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
|
||||||
|
|
||||||
|
== Highlights [small]#💖#
|
||||||
|
|
||||||
|
News you don't want to miss.
|
||||||
|
|
||||||
|
[[windows-support]]
|
||||||
|
=== Windows Support
|
||||||
|
|
||||||
|
Pkl is now available on Windows! (https://github.com/apple/pkl/pull/492[#492])
|
||||||
|
|
||||||
|
|
||||||
|
In addition to macOS and Linux, Pkl is now available for download on Windows operating systems.
|
||||||
|
|
||||||
|
For installation instructions, consult xref:pkl-cli:index.adoc#windows-executable[Windows Executable] in the CLI reference.
|
||||||
|
|
||||||
|
==== Writing cross-platform Pkl programs
|
||||||
|
|
||||||
|
On Windows, the in-language filepath separator is still `/`.
|
||||||
|
This means that most existing Pkl code should still continue working as-is.
|
||||||
|
|
||||||
|
A small portion of programs will need to be updated to handle Windows support correctly.
|
||||||
|
One example is the various conversion scripts that read input files as CLI flags.
|
||||||
|
|
||||||
|
For example, here is a snippet from module https://github.com/apple/pkl-pantry/blob/d9571cdce407bb7f1687f81b945a4bfd24ce017d/packages/k8s.contrib/convert.pkl#L100C1-L103C74[k8s.contrib.convert]:
|
||||||
|
|
||||||
|
.convert.pkl#L100-L103
|
||||||
|
[source,pkl]
|
||||||
|
----
|
||||||
|
local inputUri =
|
||||||
|
if (input.startsWith(Regex(#"\w+:"#))) input // absolute URI
|
||||||
|
else if (input.startsWith("/")) "file://\(input)" // absolute file path
|
||||||
|
else "file://\(read("env:PWD"))/\(input)" // relative file path
|
||||||
|
----
|
||||||
|
|
||||||
|
On Windows, the env var `PWD` is a Windows-style path, like `C:\Foo\Bar\Baz`.
|
||||||
|
With the above logic, `inputUri` can expand to a value like `"\file://C:\Foo\Bar\Baz/input.yaml"`.
|
||||||
|
This would an invalid URI; the correct URI should be `"\file:///C:/Foo/Bar/Baz/input.yaml"`.
|
||||||
|
|
||||||
|
Here is a possible fix for this code:
|
||||||
|
|
||||||
|
[source,pkl]
|
||||||
|
----
|
||||||
|
import "pkl:platform"
|
||||||
|
|
||||||
|
local inputUri =
|
||||||
|
if (input.startsWith(Regex(#"\w+:/"#))) input
|
||||||
|
else if (input.startsWith("/")) "file://\(input)"
|
||||||
|
else
|
||||||
|
let (pwd = read("env:PWD"))
|
||||||
|
let (
|
||||||
|
path =
|
||||||
|
if (platform.current.operatingSystem.name == "Windows")
|
||||||
|
"/\(pwd)/\(input)".replaceAll("\\", "/")
|
||||||
|
else "\(pwd)/\(input)"
|
||||||
|
)
|
||||||
|
"file://\(path)"
|
||||||
|
----
|
||||||
|
|
||||||
|
To learn more about this design, consult https://github.com/apple/pkl-evolution/blob/main/spices/SPICE-0006-import-paths-on-windows.adoc[SPICE-0006].
|
||||||
|
|
||||||
|
[[http-proxying]]
|
||||||
|
=== HTTP proxying
|
||||||
|
|
||||||
|
Pkl now supports proxying HTTP(S) requests (https://github.com/apple/pkl/pull/506[#506]).
|
||||||
|
|
||||||
|
For users of the CLI, Pkl will by default look for proxy settings configured within the OS when on macOS, Windows, and GNOME environments.
|
||||||
|
|
||||||
|
This can be changed by adding settings in the following locations:
|
||||||
|
|
||||||
|
1. xref:pkl-cli:index.adoc#settings-file[Settings file]
|
||||||
|
2. xref:language-reference:index.adoc#projects[PklProject file]
|
||||||
|
3. `--http-proxy` and `--http-no-proxy` CLI flags
|
||||||
|
|
||||||
|
As part of this, some changes have been made to the standard library. For details, see <<standard-library-changes,Standard Library changes>>.
|
||||||
|
|
||||||
|
Users of the Java/Kotlin bindings can specify proxy settings when building an <<http-java-client,HTTP client>>.
|
||||||
|
|
||||||
|
HTTP proxy settings are also added as new fields in the message-passing-api.
|
||||||
|
Authors of external Pkl clients are encouraged to support these new fields to provide proxy support in their libraries.
|
||||||
|
For details, see <<message-passing-api-changes,Message passing API changes>>.
|
||||||
|
|
||||||
|
To read more about the design of HTTP proxying, consult https://github.com/apple/pkl-evolution/blob/main/spices/SPICE-0004-HTTP-Proxy-Support.adoc[SPICE-0004], and also the xref:pkl-cli:index.adoc#http-proxy[documentation].
|
||||||
|
|
||||||
|
[[scheme-agnostic-project-dependencies]]
|
||||||
|
=== Scheme-agnostic project dependencies
|
||||||
|
|
||||||
|
Improvements have been made to project dependencies (https://github.com/apple/pkl/pull/486[#486]).
|
||||||
|
|
||||||
|
A project dependency is a way to manage `package`-based modules.
|
||||||
|
It provides two uses:
|
||||||
|
|
||||||
|
1. A package can be imported through xref:language-reference:index.adoc#dependency-notation[dependency notation].
|
||||||
|
2. Conflicting versions in the transitive dependency graph are resolved.
|
||||||
|
|
||||||
|
Currently, dependencies can only be used with file-based modules.
|
||||||
|
This can be limiting in some circumstances:
|
||||||
|
|
||||||
|
1. JVM library users typically interact with Pkl by bundling Pkl files a classpath resources, and load them using `modulepath:` URIs.
|
||||||
|
2. Go library users often embed Pkl code using the https://pkg.go.dev/embed#hdr-Directives[`go:embed` directive], and load them using https://pkg.go.dev/github.com/apple/pkl-go/pkl#WithFs[`WithFs`].
|
||||||
|
|
||||||
|
This means that these users miss out on the benefits of project dependencies.
|
||||||
|
|
||||||
|
Pkl 0.26 adds support for using dependencies in any hierarchical module scheme.
|
||||||
|
This means that `modulepath:` users in Java can now declare projects and dependencies.
|
||||||
|
This also means that other custom methods of embedding modules can also use dependency notation.
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
====
|
||||||
|
A _hierarchical_ URI is a URI whose path part starts with `/`, and in which `/` delimits path segments.
|
||||||
|
|
||||||
|
The URI `myscheme:/foo.pkl` is hierarchical, whereas the URI `myscheme:foo.pkl` is not.
|
||||||
|
====
|
||||||
|
|
||||||
|
To read more about this design, consult https://github.com/apple/pkl-evolution/tree/main/spices/SPICE-0005-scheme-agnostic-projects.adoc[SPICE-0005].
|
||||||
|
|
||||||
|
[[typealias-scoping-fix-and-change]]
|
||||||
|
=== Typealias scoping fix and change
|
||||||
|
|
||||||
|
Improvements have been made to `typealias`es (https://github.com/apple/pkl/pull/144[#144], https://github.com/apple/pkl/pull/373[#373], https://github.com/apple/pkl/pull/516[#516]).
|
||||||
|
|
||||||
|
Currently, a typealias that references a value on its enclosing module will break if used in another module.
|
||||||
|
|
||||||
|
.myModule.pkl
|
||||||
|
[source,pkl]
|
||||||
|
----
|
||||||
|
typealias StartsWithFoo = String(startsWith(foo))
|
||||||
|
|
||||||
|
foo = "foo"
|
||||||
|
----
|
||||||
|
|
||||||
|
[source,pkl]
|
||||||
|
----
|
||||||
|
import "myModule.pkl"
|
||||||
|
|
||||||
|
myStr: StartsWithFoo = "fooey"
|
||||||
|
----
|
||||||
|
|
||||||
|
This results in error:
|
||||||
|
|
||||||
|
[source]
|
||||||
|
----
|
||||||
|
–– Pkl Error ––
|
||||||
|
Cannot find property `foo`.
|
||||||
|
|
||||||
|
1 | typealias StartsWithFoo = String(startsWith(foo))
|
||||||
|
----
|
||||||
|
|
||||||
|
This is a language bug that has been fixed.
|
||||||
|
|
||||||
|
In the process of fixing this bug, we realized that the rules around variable resolution within typealiases were problematic.
|
||||||
|
Typealiases are meant to be statically defined, and shouldn't be able to see properties that can be late-bound.
|
||||||
|
Thus, a new rule is introduced: a typealias can only reference properties/methods that are `const`.
|
||||||
|
|
||||||
|
This is a breaking change. To read more about this breakage and remediation steps, reference <<typealiases-are-treated-as-const>>.
|
||||||
|
|
||||||
|
== Noteworthy [small]#🎶#
|
||||||
|
|
||||||
|
Ready when you need them.
|
||||||
|
|
||||||
|
[[pkldoc-improvements]]
|
||||||
|
=== Pkldoc improvements
|
||||||
|
|
||||||
|
The following improvements have been made to xref:pkl-doc:index.adoc[Pkldoc]:
|
||||||
|
|
||||||
|
1. The documentation for the standard library no longer shows dependent packages, because every package implicitly depends on the standard library (https://github.com/apple/pkl/pull/503[#503]).
|
||||||
|
2. If the standard library exists in the package list, it is shown first (https://github.com/apple/pkl/pull/165[#165]).
|
||||||
|
3. Fewer characters are percent-encoded. For example, the `(` and `)` characters are no longer percent-encoded (https://github.com/apple/pkl/pull/489[#489]).
|
||||||
|
|
||||||
|
[[standard-library-changes]]
|
||||||
|
=== Standard library changes
|
||||||
|
|
||||||
|
To support <<http-proxying,http proxying>>, several changes have been made to the standard library (https://github.com/apple/pkl/pull/506[#506]).
|
||||||
|
|
||||||
|
* Module `pkl.settings` has new property `http`.
|
||||||
|
* class `EvaluatorSettings` originally in `pkl.Project` has been moved to its own module.
|
||||||
|
For backwards compatibility, `pkl.Project` now has a `typealias EvaluatorSettings` pointing to the new module, but it is marked `@Deprecated`.
|
||||||
|
|
||||||
|
=== Java API Changes
|
||||||
|
|
||||||
|
[[http-java-client]]
|
||||||
|
==== HTTP Java Client
|
||||||
|
|
||||||
|
A new Java API is introduced, named `org.pkl.core.http.HttpClient` (https://github.com/apple/pkl/pull/217[#217], https://github.com/apple/pkl/pull/295[#295], https://github.com/apple/pkl/pull/506[#506], https://github.com/apple/pkl/pull/518[#518]).
|
||||||
|
This interface provides the ability to manage how Pkl makes HTTP(S) calls, including how it deals with CA certificates, as well as proxies.
|
||||||
|
|
||||||
|
This client can be passed to Pkl's evaluator using `EvaluatorBuilder` for users of pkl-core, and `ConfigEvaluatorBuilder` for users of pkl-config-java or pkl-config-kotlin.
|
||||||
|
|
||||||
|
[[http-module-key-factory]]
|
||||||
|
==== New HTTP ModuleKeyFactory
|
||||||
|
|
||||||
|
A new module key factory for HTTP(S) modules has been added (https://github.com/apple/pkl/pull/495[#495]), and can be built with `org.pkl.core.ModuleKeyFactories#http`.
|
||||||
|
|
||||||
|
The preconfigured evaluator (`org.pkl.core.EvaluatorBuilder#preconfigured`) includes this module key.
|
||||||
|
Users that build their own evaluator from scratch should add this module key factory if HTTP(S) modules are needed.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
[source,diff]
|
||||||
|
----
|
||||||
|
import org.pkl.core.EvaluatorBuilder;
|
||||||
|
import org.pkl.core.module.ModuleKeyFactories;
|
||||||
|
|
||||||
|
var evaluator = EvaluatorBuilder.unconfigured()
|
||||||
|
+ .addModuleKeyFactory(ModuleKeyFactories.http) // <1>
|
||||||
|
.build();
|
||||||
|
----
|
||||||
|
<1> Add `ModuleKeyFactories.http` to the set of module key factories used by this evaluator.
|
||||||
|
|
||||||
|
If this module key factory is not added, Pkl may still make HTTP(S) requests if `ModuleKeyFactories.genericUrl` is included.
|
||||||
|
However, this bypasses proxy and CA certificate settings.
|
||||||
|
|
||||||
|
[[pkl-executor-changes]]
|
||||||
|
==== `pkl-executor` changes
|
||||||
|
|
||||||
|
A new set of parameters are now available to `org.pkl.executor.Executor` (https://github.com/apple/pkl/pull/217[#217], https://github.com/apple/pkl/pull/518[#518]).
|
||||||
|
These new parameters are exposed by `org.pkl.executor.spi.v1.ExecutorSpiOptions2`.
|
||||||
|
|
||||||
|
The new parameters are:
|
||||||
|
|
||||||
|
* `certificateFiles`: A set of CA certificate files to trust when making HTTPS requests.
|
||||||
|
* `certificateBytes`: A set of PEM-encoded CA certificate bytes to trust when making HTTPS requests.
|
||||||
|
* `testPort`: An option that is used for internal testing only.
|
||||||
|
|
||||||
|
These options are ignored when using a Pkl distribution whose version is lower than 0.26.0.
|
||||||
|
|
||||||
|
[[message-passing-api-changes]]
|
||||||
|
=== Message passing API changes
|
||||||
|
|
||||||
|
A new property, `http`, is added to xref:bindings-specification:message-passing-api.adoc#create-evaluator-request[Create Evaluator Request] (https://github.com/apple/pkl/pull/506[#506], https://github.com/apple/pkl/pull/518[#518]).
|
||||||
|
|
||||||
|
This allows for the configuration of Pkl's HTTP proxy, as well as CA certificates.
|
||||||
|
|
||||||
|
[[rename-codegen-classes]]
|
||||||
|
=== Ability to rename classes produced by Java/Kotlin code generators
|
||||||
|
|
||||||
|
The Java and Kotlin code generators have a new option that allows users to change the name of Java/Kotlin classes that get produced during code generation (https://github.com/apple/pkl/pull/499[#499]).
|
||||||
|
|
||||||
|
The CLIs have a new flag, `--rename`, and the Gradle plugin receives a similarly named property called `renames`.
|
||||||
|
|
||||||
|
This option accepts a map from an old prefix to a new prefix, where longer prefixes have higher precedence than shorter prefixes.
|
||||||
|
|
||||||
|
For example, when generating `module foo.Bar`, specifying `--rename foo.=com.foo.` will cause the Java/Kotlin code generators to emit package `com.foo`, and class `Bar`.
|
||||||
|
|
||||||
|
== Breaking Changes [small]#💔#
|
||||||
|
|
||||||
|
Things to watch out for when upgrading.
|
||||||
|
|
||||||
|
[[typealiases-are-treated-as-const]]
|
||||||
|
=== Typealiases are treated as `const`
|
||||||
|
|
||||||
|
A breaking change has been made to typealiases (https://github.com/apple/pkl/pull/516[#516]).
|
||||||
|
|
||||||
|
Typealiases are types that can stand in for another type declaration.
|
||||||
|
|
||||||
|
The aliased type can have constraints, where these constraints can reference values defined on the enclosing module.
|
||||||
|
|
||||||
|
.baseModule.pkl
|
||||||
|
[source,pkl]
|
||||||
|
----
|
||||||
|
typealias MyValue = Any(isValid) // <1>
|
||||||
|
|
||||||
|
isValid = true
|
||||||
|
----
|
||||||
|
<1> `isValid` is defined on the enclosing module.
|
||||||
|
|
||||||
|
One problem with this is that typealiases are meant to be statically defined.
|
||||||
|
Like classes, typealiases should not be changed by amending its enclosing module.
|
||||||
|
|
||||||
|
[source,pkl]
|
||||||
|
----
|
||||||
|
amends "baseModule.pkl"
|
||||||
|
|
||||||
|
isValid = false // <1>
|
||||||
|
----
|
||||||
|
<1> Despite this amended value, `typealias MyValue` should still stand for `Any(true)`.
|
||||||
|
|
||||||
|
To have clearer semantics, a new rule is introduced: referenced members on the enclosing module must be `const`.
|
||||||
|
Effectively, a typealias is treated as if it is also a `const` member.
|
||||||
|
|
||||||
|
To fix the above typealias, the `const` modifier should be added to `isValid`.
|
||||||
|
|
||||||
|
[source,diff]
|
||||||
|
----
|
||||||
|
typealias MyValue = Any(isValid)
|
||||||
|
|
||||||
|
-isValid = true
|
||||||
|
+const isValid = true
|
||||||
|
----
|
||||||
|
|
||||||
|
It might not always be valid to add the `const` modifier.
|
||||||
|
For example, this property may be overwritten in a downstream module, so adding the `const` modifier this would break that module.
|
||||||
|
In these cases, another fix is to self-import the enclosing module.
|
||||||
|
This works because import declarations introduce values that are implicitly marked `const`.
|
||||||
|
|
||||||
|
.baseModule.pkl
|
||||||
|
[source,diff]
|
||||||
|
----
|
||||||
|
+import "baseModule.pkl" // <1>
|
||||||
|
+
|
||||||
|
-typealias MyValue = Any(isValid)
|
||||||
|
+typealias MyValue = Any(baseModule.isValid)
|
||||||
|
|
||||||
|
isValid = true
|
||||||
|
----
|
||||||
|
<1> Self import
|
||||||
|
|
||||||
|
This change aligns with the behavior of class and annotation bodies.
|
||||||
|
|
||||||
|
To read more about the rationale behind this change, consult https://github.com/apple/pkl-evolution/blob/main/spices/SPICE-0007-const-checks-in-typealiases.adoc[SPICE-0007].
|
||||||
|
|
||||||
|
[[expanded-dependency-notation-uris]]
|
||||||
|
=== Expanded dependency notation URIs
|
||||||
|
|
||||||
|
The parsing of relative path imports has changed (https://github.com/apple/pkl/pull/486[#486]).
|
||||||
|
|
||||||
|
Currently, the declaration `import "@foo/bar.pkl"` is treated as the import of a dependency named `foo`, but _only_ when declared within file-based and package-based modules.
|
||||||
|
In an HTTP-based module, for example, the above import is treated as "bar.pkl inside directory @foo".
|
||||||
|
|
||||||
|
To <<scheme-agnostic-project-dependencies,improve project dependencies>>, such declarations are treated as dependency notation in all modules, and will fail with error "Cannot find dependency".
|
||||||
|
|
||||||
|
Any import/reads that are intentionally relative-path imports will need to be updated to be prefixed with `./`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
[source,diff]
|
||||||
|
----
|
||||||
|
-import "@bar/foo.pkl"
|
||||||
|
+import "./@bar/foo.pkl"
|
||||||
|
----
|
||||||
|
|
||||||
|
[[minimum-java-version-bump]]
|
||||||
|
=== Minimum Java version bumped to Java 17
|
||||||
|
|
||||||
|
The minimum Java version for Pkl has been bumped to Java 17 (https://github.com/apple/pkl/pull/439[#439]).
|
||||||
|
|
||||||
|
This means that when running the xref:pkl-cli:index.adoc#java-executable[jpkl] CLI, the installed `java` is expected to be Java 17 or higher.
|
||||||
|
This also means that users of the JVM libraries need to be on at least Java 17 or higher.
|
||||||
|
|
||||||
|
[[minimum-gradle-version-bump]]
|
||||||
|
=== Gradle plugin minimum version bump
|
||||||
|
|
||||||
|
The minimum Gradle version for the xref:main:pkl-gradle:index.adoc[Gradle plugin] is now 8.1 (https://github.com/apple/pkl/pull/454[#454]).
|
||||||
|
|
||||||
|
[[path-encoding-changes]]
|
||||||
|
=== Path encoding changes
|
||||||
|
|
||||||
|
In order to support Windows, the output of some Pkl tools have unsafe characters encoded in a special format (https://github.com/apple/pkl/pull/489[#489]).
|
||||||
|
|
||||||
|
On Windows, the characters `<`, `>`, `:`, `"`, `\`, `|`, `?`, and `*` are reserved and cannot exist in a filename.
|
||||||
|
Additionally, the ASCII control character code points `0x0` through `0x1f` are also illegal.
|
||||||
|
|
||||||
|
These characters are encoded by wrapping their hexadecimal code point value in parentheses.
|
||||||
|
For example, the character `:` is encoded as `(3a)`.
|
||||||
|
|
||||||
|
In some scenarios, files that get written to disk will be encoded.
|
||||||
|
These are:
|
||||||
|
|
||||||
|
* Files generated by Pkldoc.
|
||||||
|
* `*.kt` files produced by the Kotlin code generator.
|
||||||
|
* Packages written to the cache directory.
|
||||||
|
|
||||||
|
To learn more about this design, consult https://github.com/apple/pkl-evolution/blob/main/spices/SPICE-0003-windows-safe-paths.adoc[SPICE-0003].
|
||||||
|
|
||||||
|
==== Pkldoc links changes
|
||||||
|
|
||||||
|
The links generated by Pkldoc have changed.
|
||||||
|
|
||||||
|
For example, a module called `module `foo<bar`` creates file `foo(3c)bar.html`, instead of `foo<bar.html`.
|
||||||
|
|
||||||
|
As part of this change, some Pkldoc links have also changed.
|
||||||
|
|
||||||
|
==== Cache directory prefix changes
|
||||||
|
|
||||||
|
The cache directory has been changed from `<moduleCacheDir>/package-1` to `<moduleCacheDir>/package-2`.
|
||||||
|
|
||||||
|
If Pkl's dependencies are vendored within a repository, these dependencies will need to be re-vendored.
|
||||||
|
|
||||||
|
=== Java API Breaking Changes
|
||||||
|
|
||||||
|
The following Java APIs have breaking changes:
|
||||||
|
|
||||||
|
|===
|
||||||
|
|Class/method | Breaking change
|
||||||
|
|
||||||
|
|`org.pkl.cli.commands.CliDownloadPackageCommand`
|
||||||
|
|Renamed to `org.pkl.cli.commands.CliPackageDownloader`
|
||||||
|
|
||||||
|
|`org.pkl.cli.commands.CliAbstractProjectCommand`
|
||||||
|
|Renamed to `org.pkl.cli.commands.CliProjectCommand`
|
||||||
|
|
||||||
|
|`org.pkl.config.java.InvalidMappingException`
|
||||||
|
|Fields `pklName` and `javaName` are now `private`.
|
||||||
|
|
||||||
|
|`org.pkl.core.packages.PackageResolver#getInstance`
|
||||||
|
|New parameter `httpClient` added
|
||||||
|
|
||||||
|
|`org.pkl.core.repl.ReplServer.ReplServer`
|
||||||
|
|New parameter `httpClient` added
|
||||||
|
|
||||||
|
|`org.pkl.commons.cli.CliBaseOptions`
|
||||||
|
|New parameters `testPort`, `httpProxy`, `httpNoProxy` added
|
||||||
|
|===
|
||||||
|
|
||||||
|
[[standard-library-breaking-changes]]
|
||||||
|
=== Standard library breaking changes
|
||||||
|
|
||||||
|
Class `pkl.Project.EvaluatorSettings` has been removed.
|
||||||
|
A new (deprecated) typealias is added that points to new module `pkl.EvaluatorSettings`.
|
||||||
|
For both of these, see https://github.com/apple/pkl/pull/506[#506].
|
||||||
|
|
||||||
|
[[type-checked-settings-file]]
|
||||||
|
=== Type-checked settings file
|
||||||
|
|
||||||
|
The loading of the xref:pkl-cli:index.adoc#settings-file[settings file] has changed (https://github.com/apple/pkl/pull/477[#477]).
|
||||||
|
|
||||||
|
The settings file is a way to control the behavior of the Pkl CLI.
|
||||||
|
This module is expected to `amends "pkl:settings"`, but this behavior was not checked.
|
||||||
|
|
||||||
|
In 0.26, it is an error if the settings module neither amends `"pkl:settings"`, nor set its `output.value` to an instance of the settings module.
|
||||||
|
|
||||||
|
[[empty-directories-excluded-from-packaging]]
|
||||||
|
=== Empty directories excluded from packaging
|
||||||
|
|
||||||
|
Currently, the `pkl project package` command will bundle empty directories into the resulting ZIP file.
|
||||||
|
|
||||||
|
In version 0.26, this has been changed to exclude these directories (https://github.com/apple/pkl/pull/330[#330]).
|
||||||
|
This means that the packages can produce a _different_ checksum if there are any empty directories.
|
||||||
|
|
||||||
|
This does not break the usage of existing packages, and does not affect compatibility of new packages used with older Pkl 0.25.
|
||||||
|
|
||||||
|
However, this can break certain workflows.
|
||||||
|
The `pkl project package` command runs a publish check, to determine if a package has already been published but with a different checksum.
|
||||||
|
When upgrading, users might encounter an error message like the following:
|
||||||
|
|
||||||
|
[source]
|
||||||
|
----
|
||||||
|
-- Pkl Error --
|
||||||
|
Package `package://example.com/foo@1.0.0` was already published with different contents.
|
||||||
|
----
|
||||||
|
|
||||||
|
To mitigate, the package's version needs to be bumped, even if package contents have not changed.
|
||||||
|
|
||||||
|
== Miscellaneous [small]#🐸#
|
||||||
|
|
||||||
|
The following changes have been made that are not new features, nor breaking changes.
|
||||||
|
|
||||||
|
* Pkl's user-agent header for HTTP requests has been tweaked to add a semicolon (https://github.com/apple/pkl/pull/221[#221]). Here is an example difference:
|
||||||
|
+
|
||||||
|
Before: `Pkl/0.26 (macOS native)` +
|
||||||
|
After: `Pkl/0.26 (macOS; native)`
|
||||||
|
* Documentation improvements (https://github.com/apple/pkl/pull/120[#120], https://github.com/apple/pkl/pull/121[#121], https://github.com/apple/pkl/pull/142[#142], https://github.com/apple/pkl/pull/121[#121], https://github.com/apple/pkl/pull/337[#337], https://github.com/apple/pkl/pull/341[#341], https://github.com/apple/pkl/pull/372[#372], https://github.com/apple/pkl/pull/386[#386], https://github.com/apple/pkl/pull/391[#391], https://github.com/apple/pkl/pull/397[#397], https://github.com/apple/pkl/pull/422[#422], https://github.com/apple/pkl/pull/436[#436], https://github.com/apple/pkl/pull/469[#469], https://github.com/apple/pkl/pull/484[#484], https://github.com/apple/pkl/pull/485[#485], https://github.com/apple/pkl/pull/[#491]).
|
||||||
|
* Optimization: `const` access is checked when variables are resolved, instead of every time the variable is accessed (https://github.com/apple/pkl/pull/438[#438]).
|
||||||
|
* Optimization: use logical AND instead of bitwise AND when comparing numbers (https://github.com/apple/pkl/pull/102[#102]).
|
||||||
|
* Mark Java classes `final` (https://github.com/apple/pkl/pull/458[#458]).
|
||||||
|
* Migrate code to newer JDK17 features, and clean up existing Java code (https://github.com/apple/pkl/pull/451[#451], https://github.com/apple/pkl/pull/458[#458], https://github.com/apple/pkl/pull/512[#512]).
|
||||||
|
* Improve rendering of string values within generated `<file>.pkl-expected.pcf` files when running `pkl test` (https://github.com/apple/pkl/pull/416[#416]).
|
||||||
|
* Improve performance of loading Pkl's built-in CA certificates (https://github.com/apple/pkl/pull/518[#518]).
|
||||||
|
|
||||||
|
== Bug Fixes [small]#🐜#
|
||||||
|
|
||||||
|
The following bugs have been fixed.
|
||||||
|
|
||||||
|
* `Collection#sortWith` produces un-sorted output (https://github.com/apple/pkl/pull/394[#394]).
|
||||||
|
* Property `typedType` in module `pkl.reflect` reflects upon `Type`, instead of `Typed` (https://github.com/apple/pkl/pull/426[#426]).
|
||||||
|
* `const` members can be assigned to when via an object spread (https://github.com/apple/pkl/pull/428[#428]).
|
||||||
|
* Relative globbed reads resolve to the same value in different modules (https://github.com/apple/pkl/pull/449[#449]).
|
||||||
|
* Performance bug: globbed imports and globbed reads expand to an unbounded number of root nodes (https://github.com/apple/pkl/pull/449[#449]).
|
||||||
|
* Relative globbed imports within a package match no modules (https://github.com/apple/pkl/pull/496[#496]).
|
||||||
|
* Constraints within typealiases resolve to the wrong values (https://github.com/apple/pkl/pull/144[#144]).
|
||||||
|
* Members of `pkl.reflect` cannot be rendered (https://github.com/apple/pkl/pull/170[#170], https://github.com/apple/pkl/pull/470[#470]).
|
||||||
|
* Throws `NullPointerException` if "List Resources Response" or "List Modules Response" messages contain both null `pathElements` and `error` (https://github.com/apple/pkl/pull/480[#480]).
|
||||||
|
* Classes of `com.oracle.truffle` are not shaded in pkl-config-java-all and pkl-tools (https://github.com/apple/pkl/pull/238[#238]).
|
||||||
|
* Throws `PklBugException` when running publish check on an invalid URL (https://github.com/apple/pkl/pull/441[#441]).
|
||||||
|
|
||||||
|
== Contributors [small]#🙏#
|
||||||
|
|
||||||
|
We would like to thank the contributors to this release (in alphabetical order):
|
||||||
|
|
||||||
|
* https://github.com/flyinprogrammer[@flyinprogrammer]
|
||||||
|
* https://github.com/fumiya-kume[@fumiya-kume]
|
||||||
|
* https://github.com/garysassano[@garysassano]
|
||||||
|
* https://github.com/HT154[@HT154]
|
||||||
|
* https://github.com/hoxell[@hoxell]
|
||||||
|
* https://github.com/jw-y[@jw-y]
|
||||||
|
* https://github.com/KushalP[@KushalP]
|
||||||
|
* https://github.com/lilyball[@lilyball]
|
||||||
|
* https://github.com/luuvish[@luuvish]
|
||||||
|
* https://github.com/Malix-off[@Malix-off]
|
||||||
|
* https://github.com/manuelsblanco[@manuelsblanco]
|
||||||
|
* https://github.com/MarkSRobinson[@MarkSRobinson]
|
||||||
|
* https://github.com/mitchcapper[@mitchcapper]
|
||||||
|
* https://github.com/mrs1669[@mrs1669]
|
||||||
|
* https://github.com/netvl[@netvl]
|
||||||
|
* https://github.com/nirinchev[@nirinchev]
|
||||||
|
* https://github.com/raj-j-shah[@raj-j-shah]
|
||||||
|
* https://github.com/sgammon[@sgammon]
|
||||||
|
* https://github.com/StefMa[@StefMa]
|
||||||
|
* https://github.com/stefanobaghino[@stefanobaghino]
|
||||||
|
* https://github.com/TimeTravelPenguin[@TimeTravelPenguin]
|
||||||
|
* https://github.com/TheFruxz[@TheFruxz]
|
||||||
|
* https://github.com/translatenix[@translatenix]
|
||||||
|
* https://github.com/zihluwang[@zihluwang]
|
||||||
|
|
||||||
|
A special thank-you goes out to https://github.com/translatenix[@translatenix]!
|
||||||
|
They submitted multiple bug fixes, improved the quality of the codebase, and provided HTTP improvements.
|
||||||
@@ -1,6 +1,48 @@
|
|||||||
= Changelog
|
= Changelog
|
||||||
include::ROOT:partial$component-attributes.adoc[]
|
include::ROOT:partial$component-attributes.adoc[]
|
||||||
|
|
||||||
|
[[release-0.26.3]]
|
||||||
|
== 0.26.3 (2024-08-06)
|
||||||
|
|
||||||
|
=== Fixes
|
||||||
|
|
||||||
|
* Fixes an issue where CLI argument `--property foo=""` is effectively parsed as `--property foo="true"`. This is now parsed as an empty string (https://github.com/apple/pkl/pull/596[#596]).
|
||||||
|
* Fixes a regression where amending a globbed import or globbed read results in a PklBugException (https://github.com/apple/pkl/pull/607[#607]).
|
||||||
|
* Fixes an issue around using `file()` notation when using the pkl-gradle plugin on Windows (https://github.com/apple/pkl/pull/611[#611]).
|
||||||
|
|
||||||
|
[[release-0.26.2]]
|
||||||
|
== 0.26.2 (2024-07-18)
|
||||||
|
|
||||||
|
=== Fixes
|
||||||
|
|
||||||
|
* Fixes a possible race condition where multiple concurrent Pkl evaluations results in a thrown exception when downloading packages (https://github.com/apple/pkl/pull/584[#584]).
|
||||||
|
|
||||||
|
[[release-0.26.1]]
|
||||||
|
== 0.26.1 (2024-06-28)
|
||||||
|
|
||||||
|
=== Fixes
|
||||||
|
|
||||||
|
* Fixes a regression where native executables fail to run on some environments that don't support newer CPU features (https://github.com/apple/pkl/pull/551[#551]).
|
||||||
|
* Fixes a `PklBugException` when passing `.` as a project directory to `pkl project resolve` and `pkl project package` (https://github.com/apple/pkl/pull/544[#544]).
|
||||||
|
|
||||||
|
=== Changes
|
||||||
|
|
||||||
|
* Disable revocation checking of TLS certificates (https://github.com/apple/pkl/pull/553[#553]).
|
||||||
|
+
|
||||||
|
As part of HTTP improvements in 0.26, we unwittingly fixed a bug where Pkl does not actually perform cert revocation checks when making HTTPS requests.
|
||||||
|
This fix, unfortunately, caused a regression in some cases.
|
||||||
|
For example, this happens when connecting to a server that bears a public trust certificate, while in an environment with no internet access.
|
||||||
|
This is because the HTTP client needs to check the revocation status of all certificates in the chain.
|
||||||
|
+
|
||||||
|
Revocation checks are a nuanced topic with some benefits, and also with its own problem areas.
|
||||||
|
For this reason, revocation checking is disabled for Pkl's native CLIs.
|
||||||
|
Users of Pkl's Java APIs will respect the revocation settings set in the JVM.
|
||||||
|
|
||||||
|
[[release-0.26.0]]
|
||||||
|
== 0.26.0 (2024-06-17)
|
||||||
|
|
||||||
|
xref:0.26.adoc[Release notes]
|
||||||
|
|
||||||
[[release-0.25.3]]
|
[[release-0.25.3]]
|
||||||
== 0.25.3 (2024-03-26)
|
== 0.25.3 (2024-03-26)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
= Release Notes
|
= Release Notes
|
||||||
|
|
||||||
|
* xref:0.26.adoc[0.26 Release Notes]
|
||||||
* xref:0.25.adoc[0.25 Release Notes]
|
* xref:0.25.adoc[0.25 Release Notes]
|
||||||
* xref:changelog.adoc[Changelog]
|
* xref:changelog.adoc[Changelog]
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ myFoo1: Foo = new Foo { foo = "bar" } // <1>
|
|||||||
myFoo2 = new Foo { foo = "bar" } // <2>
|
myFoo2 = new Foo { foo = "bar" } // <2>
|
||||||
----
|
----
|
||||||
<1> Unnecessary `new Foo { ... }`
|
<1> Unnecessary `new Foo { ... }`
|
||||||
<2> Unless amending/extendinge a module where `myFoo2` is already defined, `myFoo2` is effectively the `unknown` type, i.e. `myFoo2: unknown`.
|
<2> Unless amending/extending a module where `myFoo2` is already defined, `myFoo2` is effectively the `unknown` type, i.e. `myFoo2: unknown`.
|
||||||
|
|
||||||
== Comments
|
== Comments
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ Add a single space after `///`.
|
|||||||
|
|
||||||
[source%parsed,{pkl}]
|
[source%parsed,{pkl}]
|
||||||
----
|
----
|
||||||
/// The time alotted for eating lunch.
|
/// The time allotted for eating lunch.
|
||||||
///
|
///
|
||||||
/// Note:
|
/// Note:
|
||||||
/// * Hamburgers typically take longer to eat than salad.
|
/// * Hamburgers typically take longer to eat than salad.
|
||||||
@@ -300,7 +300,7 @@ A line comment may also be placed at the end of a line, as long as the line does
|
|||||||
[source%tested,{pkl}]
|
[source%tested,{pkl}]
|
||||||
----
|
----
|
||||||
/// Designates whether it is zebra party time.
|
/// Designates whether it is zebra party time.
|
||||||
partyTime: Booleean // TODO: Add constraints here?
|
partyTime: Boolean // TODO: Add constraints here?
|
||||||
----
|
----
|
||||||
|
|
||||||
=== Block comments
|
=== Block comments
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
* xref:ROOT:examples.adoc[Examples]
|
* xref:ROOT:examples.adoc[Examples]
|
||||||
|
|
||||||
* xref:release-notes:index.adoc[Release Notes]
|
* xref:release-notes:index.adoc[Release Notes]
|
||||||
|
** xref:release-notes:0.26.adoc[0.26 Release Notes]
|
||||||
** xref:release-notes:0.25.adoc[0.25 Release Notes]
|
** xref:release-notes:0.25.adoc[0.25 Release Notes]
|
||||||
** xref:release-notes:changelog.adoc[Changelog]
|
** xref:release-notes:changelog.adoc[Changelog]
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.pkl.core.repl.ReplServer
|
|||||||
import org.pkl.core.resource.ResourceReaders
|
import org.pkl.core.resource.ResourceReaders
|
||||||
import org.pkl.core.util.IoUtils
|
import org.pkl.core.util.IoUtils
|
||||||
import org.antlr.v4.runtime.ParserRuleContext
|
import org.antlr.v4.runtime.ParserRuleContext
|
||||||
|
import org.pkl.core.http.HttpClient
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import kotlin.io.path.isDirectory
|
import kotlin.io.path.isDirectory
|
||||||
import kotlin.io.path.isRegularFile
|
import kotlin.io.path.isRegularFile
|
||||||
@@ -78,6 +79,7 @@ class DocSnippetTestsEngine : HierarchicalTestEngine<DocSnippetTestsEngine.Execu
|
|||||||
override fun createExecutionContext(request: ExecutionRequest): ExecutionContext {
|
override fun createExecutionContext(request: ExecutionRequest): ExecutionContext {
|
||||||
val replServer = ReplServer(
|
val replServer = ReplServer(
|
||||||
SecurityManagers.defaultManager,
|
SecurityManagers.defaultManager,
|
||||||
|
HttpClient.dummyClient(),
|
||||||
Loggers.stdErr(),
|
Loggers.stdErr(),
|
||||||
listOf(
|
listOf(
|
||||||
ModuleKeyFactories.standardLibrary,
|
ModuleKeyFactories.standardLibrary,
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,7 @@
|
|||||||
# suppress inspection "UnusedProperty" for whole file
|
# suppress inspection "UnusedProperty" for whole file
|
||||||
|
|
||||||
group=org.pkl-lang
|
group=org.pkl-lang
|
||||||
version=0.25.3
|
version=0.26.3
|
||||||
|
|
||||||
# google-java-format requires jdk.compiler exports
|
# google-java-format requires jdk.compiler exports
|
||||||
org.gradle.jvmargs= \
|
org.gradle.jvmargs= \
|
||||||
@@ -13,5 +13,6 @@ org.gradle.jvmargs= \
|
|||||||
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
|
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
|
||||||
|
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
org.gradle.caching=true
|
||||||
kotlin.stdlib.default.dependency=false
|
kotlin.stdlib.default.dependency=false
|
||||||
#org.gradle.workers.max=1
|
#org.gradle.workers.max=1
|
||||||
|
|||||||
+30
-22
@@ -1,47 +1,53 @@
|
|||||||
# NOTE: keep in sync with buildSrc/src/main/kotlin/Versions.kt until the latter can be removed
|
|
||||||
[versions] # ordered alphabetically
|
[versions] # ordered alphabetically
|
||||||
antlr = "4.+"
|
antlr = "4.+"
|
||||||
assertj = "3.+"
|
assertj = "3.+"
|
||||||
checksumPlugin = "1.2.0"
|
checksumPlugin = "1.2.0"
|
||||||
clikt = "3.5.1"
|
clikt = "3.5.1"
|
||||||
commonMark = "0.+"
|
commonMark = "0.+"
|
||||||
downloadTaskPlugin = "4.1.2"
|
downloadTaskPlugin = "5.6.0"
|
||||||
geantyref = "1.+"
|
geantyref = "1.+"
|
||||||
|
googleJavaFormat = "1.21.0"
|
||||||
# must not use `+` because used in download URL
|
# must not use `+` because used in download URL
|
||||||
graalVm = "22.3.1"
|
graalVm = "23.0.2"
|
||||||
# intentionally empty; replaced by patch file when building pkl-cli macos/aarch64
|
graalVmJdkVersion = "17.0.10"
|
||||||
graalVM23JdkVersion = "replace-me"
|
|
||||||
# slightly hacky but convenient place so we remember to update the checksum
|
# slightly hacky but convenient place so we remember to update the checksum
|
||||||
graalVmSha256-darwin-amd64 = "325afad5f1c4a07a458c95e7c444cff63514a6afa6f2655c12b4f494dccf2228"
|
graalVmSha256-macos-x64 = "14f4bd6417809905f86e786c779d0fc2feb840d7dac35ae3503eb25af0530da0"
|
||||||
graalVmSha256-linux-amd64 = "55547725a8be3ceb0a1da29a84cd3e958ba398ce4470ac89a8ba1bdb6d9bddb8"
|
graalVmSha256-macos-aarch64 = "e944c5ce5da56e683fc8f1a57191b46d9cb702930b1688bda064fcf467d876b8"
|
||||||
graalVmSha256-linux-aarch64 = "b46a3f9c82ac70990a62282b1fbe4474e784d9ba453839a428f88e94d21f8abc"
|
graalVmSha256-linux-x64 = "112dc9b92d81a946f1b5b334646151b790785c813e76fcf13527a319003d7e2c"
|
||||||
|
graalVmSha256-linux-aarch64 = "c95ac550d070f06666cf8c1023a098380dd565be00866473caf6ff1b7cdf680c"
|
||||||
|
graalVmSha256-windows-x64 = "1ab2291e71f54d73e3e57b7fccbf184cabcba37e16ca9d1cf42d08474a7c02f0"
|
||||||
ideaExtPlugin = "1.1"
|
ideaExtPlugin = "1.1"
|
||||||
javaPoet = "1.+"
|
javaPoet = "1.+"
|
||||||
javaxInject = "1"
|
javaxInject = "1"
|
||||||
|
jansi = "2.+"
|
||||||
jimfs = "1.+"
|
jimfs = "1.+"
|
||||||
jansi = "2.+"
|
# 3.25.1 doesn't work with native image
|
||||||
jline = "3.+"
|
jline = "3.23.0"
|
||||||
jmh = "1.+"
|
jmh = "1.+"
|
||||||
jmhPlugin = "0.6.6"
|
jmhPlugin = "0.6.6"
|
||||||
jsr305 = "3.+"
|
jsr305 = "3.+"
|
||||||
junit = "5.+"
|
junit = "5.+"
|
||||||
kotlin = "1.7.10"
|
kotlin = "1.7.10"
|
||||||
# 1.7+ generates much more verbose code
|
# 1.7+ generates much more verbose code
|
||||||
kotlinPoet = "1.6.+"
|
kotlinPoet = "1.6.+"
|
||||||
kotlinxHtml = "0.+"
|
# freeze until updating Kotlin version
|
||||||
kotlinxSerialization = "1.+"
|
kotlinxHtml = "0.8.1"
|
||||||
|
# freeze until updating Kotlin version
|
||||||
|
kotlinxSerialization = "1.5.1"
|
||||||
|
ktfmt = "0.44"
|
||||||
# replaces nuValidator's log4j dependency
|
# replaces nuValidator's log4j dependency
|
||||||
# something related to log4j-1.2-api is apparently broken in 2.17.2
|
# something related to log4j-1.2-api is apparently broken in 2.17.2
|
||||||
log4j = "2.17.1"
|
log4j = "2.17.1"
|
||||||
|
msgpack = "0.9.0"
|
||||||
|
nexusPublishPlugin = "1.3.0"
|
||||||
nuValidator = "20.+"
|
nuValidator = "20.+"
|
||||||
paguro = "3.+"
|
paguro = "3.+"
|
||||||
shadowPlugin = "7.1.0"
|
shadowPlugin = "8.1.1"
|
||||||
slf4j = "1.+"
|
slf4j = "1.+"
|
||||||
# Breaking change in snakeYaml 2.6 (removing DumpSettingsBuilder::setScalarResolver), so pin to 2.5
|
# Breaking change in snakeYaml 2.6 (removing DumpSettingsBuilder::setScalarResolver), so pin to 2.5
|
||||||
snakeYaml = "2.5"
|
snakeYaml = "2.5"
|
||||||
spotlessPlugin = "6.11.0"
|
spotlessPlugin = "6.11.0"
|
||||||
msgpack = "0.9.0"
|
wiremock = "3.+"
|
||||||
nexusPublishPlugin = "1.3.0"
|
|
||||||
|
|
||||||
[libraries] # ordered alphabetically
|
[libraries] # ordered alphabetically
|
||||||
antlr = { group = "com.tunnelvisionlabs", name = "antlr4", version.ref = "antlr" }
|
antlr = { group = "com.tunnelvisionlabs", name = "antlr4", version.ref = "antlr" }
|
||||||
@@ -57,8 +63,8 @@ graalSdk = { group = "org.graalvm.sdk", name = "graal-sdk", version.ref = "graal
|
|||||||
graalJs = { group = "org.graalvm.js", name = "js", version.ref = "graalVm" }
|
graalJs = { group = "org.graalvm.js", name = "js", version.ref = "graalVm" }
|
||||||
javaPoet = { group = "com.squareup", name = "javapoet", version.ref = "javaPoet" }
|
javaPoet = { group = "com.squareup", name = "javapoet", version.ref = "javaPoet" }
|
||||||
javaxInject = { group = "javax.inject", name = "javax.inject", version.ref = "javaxInject" }
|
javaxInject = { group = "javax.inject", name = "javax.inject", version.ref = "javaxInject" }
|
||||||
jimfs = { group = "com.google.jimfs", name = "jimfs", version.ref = "jimfs" }
|
|
||||||
jansi = { group = "org.fusesource.jansi", name = "jansi", version.ref = "jansi" }
|
jansi = { group = "org.fusesource.jansi", name = "jansi", version.ref = "jansi" }
|
||||||
|
jimfs = { group = "com.google.jimfs", name = "jimfs", version.ref = "jimfs" }
|
||||||
jlineReader = { group = "org.jline", name = "jline-reader", version.ref = "jline" }
|
jlineReader = { group = "org.jline", name = "jline-reader", version.ref = "jline" }
|
||||||
jlineTerminal = { group = "org.jline", name = "jline-terminal", version.ref = "jline" }
|
jlineTerminal = { group = "org.jline", name = "jline-terminal", version.ref = "jline" }
|
||||||
jlineTerminalJansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jline" }
|
jlineTerminalJansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jline" }
|
||||||
@@ -67,19 +73,21 @@ junitApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.re
|
|||||||
junitEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" }
|
junitEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" }
|
||||||
junitParams = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" }
|
junitParams = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" }
|
||||||
kotlinCompilerEmbeddable = { group = "org.jetbrains.kotlin", name = "kotlin-compiler-embeddable", version.ref = "kotlin" }
|
kotlinCompilerEmbeddable = { group = "org.jetbrains.kotlin", name = "kotlin-compiler-embeddable", version.ref = "kotlin" }
|
||||||
kotlinScriptingCompilerEmbeddable = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-compiler-embeddable", version.ref = "kotlin" }
|
|
||||||
kotlinScriptUtil = { group = "org.jetbrains.kotlin", name = "kotlin-script-util", version.ref = "kotlin" }
|
|
||||||
kotlinPlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
|
kotlinPlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||||
kotlinPoet = { group = "com.squareup", name = "kotlinpoet", version.ref = "kotlinPoet" }
|
kotlinPoet = { group = "com.squareup", name = "kotlinpoet", version.ref = "kotlinPoet" }
|
||||||
kotlinReflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
|
kotlinReflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
|
||||||
|
kotlinScriptingCompilerEmbeddable = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-compiler-embeddable", version.ref = "kotlin" }
|
||||||
|
kotlinScriptUtil = { group = "org.jetbrains.kotlin", name = "kotlin-script-util", version.ref = "kotlin" }
|
||||||
kotlinStdLib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
kotlinStdLib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
||||||
kotlinxHtml = { group = "org.jetbrains.kotlinx", name = "kotlinx-html-jvm", version.ref = "kotlinxHtml" }
|
kotlinxHtml = { group = "org.jetbrains.kotlinx", name = "kotlinx-html-jvm", version.ref = "kotlinxHtml" }
|
||||||
kotlinxSerializationJson = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
|
kotlinxSerializationJson = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
|
||||||
log4j12Api = { group = "org.apache.logging.log4j", name = "log4j-1.2-api", version.ref = "log4j" }
|
log4j12Api = { group = "org.apache.logging.log4j", name = "log4j-1.2-api", version.ref = "log4j" }
|
||||||
|
msgpack = { group = "org.msgpack", name = "msgpack-core", version.ref = "msgpack" }
|
||||||
nuValidator = { group = "nu.validator", name = "validator", version.ref = "nuValidator" }
|
nuValidator = { group = "nu.validator", name = "validator", version.ref = "nuValidator" }
|
||||||
# to be replaced with https://github.com/usethesource/capsule or https://github.com/lacuna/bifurcan
|
# to be replaced with https://github.com/usethesource/capsule or https://github.com/lacuna/bifurcan
|
||||||
paguro = { group = "org.organicdesign", name = "Paguro", version.ref = "paguro" }
|
paguro = { group = "org.organicdesign", name = "Paguro", version.ref = "paguro" }
|
||||||
shadowPlugin = { group = "gradle.plugin.com.github.johnrengelman", name = "shadow", version.ref = "shadowPlugin" }
|
pklConfigJavaAll025 = { group = "org.pkl-lang", name = "pkl-config-java-all", version = "0.25.0" }
|
||||||
|
shadowPlugin = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadowPlugin" }
|
||||||
slf4jApi = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
|
slf4jApi = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
|
||||||
slf4jSimple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
|
slf4jSimple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
|
||||||
snakeYaml = { group = "org.snakeyaml", name = "snakeyaml-engine", version.ref = "snakeYaml" }
|
snakeYaml = { group = "org.snakeyaml", name = "snakeyaml-engine", version.ref = "snakeYaml" }
|
||||||
@@ -87,12 +95,12 @@ spotlessPlugin = { group = "com.diffplug.spotless", name = "spotless-plugin-grad
|
|||||||
svm = { group = "org.graalvm.nativeimage", name = "svm", version.ref = "graalVm" }
|
svm = { group = "org.graalvm.nativeimage", name = "svm", version.ref = "graalVm" }
|
||||||
truffleApi = { group = "org.graalvm.truffle", name = "truffle-api", version.ref = "graalVm" }
|
truffleApi = { group = "org.graalvm.truffle", name = "truffle-api", version.ref = "graalVm" }
|
||||||
truffleDslProcessor = { group = "org.graalvm.truffle", name = "truffle-dsl-processor", version.ref = "graalVm" }
|
truffleDslProcessor = { group = "org.graalvm.truffle", name = "truffle-dsl-processor", version.ref = "graalVm" }
|
||||||
msgpack = { group = "org.msgpack", name = "msgpack-core", version.ref = "msgpack" }
|
wiremock = { group = "org.wiremock", name = "wiremock", version.ref = "wiremock" }
|
||||||
|
|
||||||
[plugins] # ordered alphabetically
|
[plugins] # ordered alphabetically
|
||||||
checksum = { id = "org.gradle.crypto.checksum", version.ref = "checksumPlugin" }
|
checksum = { id = "org.gradle.crypto.checksum", version.ref = "checksumPlugin" }
|
||||||
ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExtPlugin" }
|
ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExtPlugin" }
|
||||||
jmh = { id = "me.champeau.jmh", version.ref = "jmhPlugin" }
|
jmh = { id = "me.champeau.jmh", version.ref = "jmhPlugin" }
|
||||||
kotlinxSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
kotlinxSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadowPlugin" }
|
|
||||||
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublishPlugin" }
|
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublishPlugin" }
|
||||||
|
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadowPlugin" }
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+4
-1
@@ -1,5 +1,8 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,13 +80,11 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,22 +131,29 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
# double quotes to make sure that they get re-expanded; and
|
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
@@ -205,6 +214,12 @@ set -- \
|
|||||||
org.gradle.wrapper.GradleWrapperMain \
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
# Use "xargs" to parse quoted args.
|
||||||
#
|
#
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
|||||||
Vendored
+92
-89
@@ -1,89 +1,92 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original author or authors.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
@rem This is normally unused
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
set JAVA_EXE=java.exe
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo. 1>&2
|
||||||
echo.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo. 1>&2
|
||||||
echo location of your Java installation.
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
goto fail
|
|
||||||
|
goto fail
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
:findJavaFromJavaHome
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
if exist "%JAVA_EXE%" goto execute
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo. 1>&2
|
||||||
echo.
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo. 1>&2
|
||||||
echo location of your Java installation.
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
goto fail
|
|
||||||
|
goto fail
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
:end
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
:fail
|
||||||
rem the _cmd.exe /c_ return code!
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
rem the _cmd.exe /c_ return code!
|
||||||
exit /b 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
:mainEnd
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:omega
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
|
|||||||
@@ -1,529 +0,0 @@
|
|||||||
diff --git a/bench/gradle.lockfile b/bench/gradle.lockfile
|
|
||||||
index 0673df5..3a9d913 100644
|
|
||||||
--- a/bench/gradle.lockfile
|
|
||||||
+++ b/bench/gradle.lockfile
|
|
||||||
@@ -8,9 +8,9 @@ net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhImplementationDe
|
|
||||||
org.apache.commons:commons-math3:3.2=jmh,jmhCompileClasspath,jmhImplementationDependenciesMetadata,jmhRuntimeClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.compiler:compiler:22.3.1=graal
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=graal,jmh,jmhRuntimeClasspath,truffle
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=graal,jmh,jmhRuntimeClasspath,truffle
|
|
||||||
+org.graalvm.compiler:compiler:23.0.2=graal
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=graal,jmh,jmhRuntimeClasspath,truffle
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=graal,jmh,jmhRuntimeClasspath,truffle
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
|
|
||||||
index 73eb367..6e526b6 100644
|
|
||||||
--- a/buildSrc/build.gradle.kts
|
|
||||||
+++ b/buildSrc/build.gradle.kts
|
|
||||||
@@ -12,6 +12,6 @@ dependencies {
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
- sourceCompatibility = JavaVersion.VERSION_11
|
|
||||||
- targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
+ sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
+ targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
diff --git a/buildSrc/src/main/kotlin/pklAllProjects.gradle.kts b/buildSrc/src/main/kotlin/pklAllProjects.gradle.kts
|
|
||||||
index 4daf287..6ef0256 100644
|
|
||||||
--- a/buildSrc/src/main/kotlin/pklAllProjects.gradle.kts
|
|
||||||
+++ b/buildSrc/src/main/kotlin/pklAllProjects.gradle.kts
|
|
||||||
@@ -24,13 +24,13 @@ configurations {
|
|
||||||
|
|
||||||
plugins.withType(JavaPlugin::class).configureEach {
|
|
||||||
val java = project.extensions.getByType<JavaPluginExtension>()
|
|
||||||
- java.sourceCompatibility = JavaVersion.VERSION_11
|
|
||||||
- java.targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
+ java.sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
+ java.targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
- jvmTarget = "11"
|
|
||||||
+ jvmTarget = "17"
|
|
||||||
freeCompilerArgs = freeCompilerArgs + listOf("-Xjsr305=strict", "-Xjvm-default=all")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/docs/gradle.lockfile b/docs/gradle.lockfile
|
|
||||||
index 196e592..e33eb75 100644
|
|
||||||
--- a/docs/gradle.lockfile
|
|
||||||
+++ b/docs/gradle.lockfile
|
|
||||||
@@ -7,8 +7,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
|
|
||||||
index 5171a9a..6761c58 100644
|
|
||||||
--- a/gradle/libs.versions.toml
|
|
||||||
+++ b/gradle/libs.versions.toml
|
|
||||||
@@ -8,11 +8,11 @@ commonMark = "0.+"
|
|
||||||
downloadTaskPlugin = "4.1.2"
|
|
||||||
geantyref = "1.+"
|
|
||||||
# must not use `+` because used in download URL
|
|
||||||
-graalVm = "22.3.1"
|
|
||||||
-# intentionally empty; replaced by patch file when building pkl-cli macos/aarch64
|
|
||||||
-graalVM23JdkVersion = "replace-me"
|
|
||||||
+graalVm = "23.0.2"
|
|
||||||
+graalVM23JdkVersion = "17.0.9"
|
|
||||||
# slightly hacky but convenient place so we remember to update the checksum
|
|
||||||
graalVmSha256-darwin-amd64 = "325afad5f1c4a07a458c95e7c444cff63514a6afa6f2655c12b4f494dccf2228"
|
|
||||||
+graalVmSha256-macos-aarch64 = "2214b6ecb32faacc84dffcbfae930450abe77c31730c4b6310e22d8f743959a5"
|
|
||||||
graalVmSha256-linux-amd64 = "55547725a8be3ceb0a1da29a84cd3e958ba398ce4470ac89a8ba1bdb6d9bddb8"
|
|
||||||
graalVmSha256-linux-aarch64 = "b46a3f9c82ac70990a62282b1fbe4474e784d9ba453839a428f88e94d21f8abc"
|
|
||||||
ideaExtPlugin = "1.1"
|
|
||||||
diff --git a/pkl-cli/gradle.lockfile b/pkl-cli/gradle.lockfile
|
|
||||||
index 1360caa..0892665 100644
|
|
||||||
--- a/pkl-cli/gradle.lockfile
|
|
||||||
+++ b/pkl-cli/gradle.lockfile
|
|
||||||
@@ -9,13 +9,13 @@ net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.fusesource.jansi:jansi:2.4.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.compiler:compiler:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
-org.graalvm.nativeimage:native-image-base:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
-org.graalvm.nativeimage:objectfile:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
-org.graalvm.nativeimage:pointsto:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
-org.graalvm.nativeimage:svm:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.compiler:compiler:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
+org.graalvm.nativeimage:native-image-base:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
+org.graalvm.nativeimage:objectfile:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
+org.graalvm.nativeimage:pointsto:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
+org.graalvm.nativeimage:svm:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -26,10 +26,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jline:jline-native:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jline:jline-reader:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
@@ -45,4 +49,4 @@ org.msgpack:msgpack-core:0.9.0=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,archives,compile,intransitiveDependenciesMetadata,javaExecutable,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,archives,compile,intransitiveDependenciesMetadata,javaExecutable,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,signatures,sourcesJar,stagedAlpineLinuxAmd64Executable,stagedLinuxAarch64Executable,stagedLinuxAmd64Executable,stagedMacAarch64Executable,stagedMacAmd64Executable,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-codegen-java/gradle.lockfile b/pkl-codegen-java/gradle.lockfile
|
|
||||||
index 9bf6cba..901c8d8 100644
|
|
||||||
--- a/pkl-codegen-java/gradle.lockfile
|
|
||||||
+++ b/pkl-codegen-java/gradle.lockfile
|
|
||||||
@@ -10,8 +10,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -22,10 +22,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
@@ -36,4 +40,4 @@ org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMet
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-codegen-kotlin/gradle.lockfile b/pkl-codegen-kotlin/gradle.lockfile
|
|
||||||
index 42331c2..7974715 100644
|
|
||||||
--- a/pkl-codegen-kotlin/gradle.lockfile
|
|
||||||
+++ b/pkl-codegen-kotlin/gradle.lockfile
|
|
||||||
@@ -10,8 +10,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testRuntimeClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-client:1.7.10=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
@@ -24,10 +24,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
@@ -39,4 +43,4 @@ org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMet
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-commons-cli/gradle.lockfile b/pkl-commons-cli/gradle.lockfile
|
|
||||||
index 6cac9f4..f603276 100644
|
|
||||||
--- a/pkl-commons-cli/gradle.lockfile
|
|
||||||
+++ b/pkl-commons-cli/gradle.lockfile
|
|
||||||
@@ -8,8 +8,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -20,10 +20,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
@@ -34,4 +38,4 @@ org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMet
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-commons/gradle.lockfile b/pkl-commons/gradle.lockfile
|
|
||||||
index 4170e1a..0a23c04 100644
|
|
||||||
--- a/pkl-commons/gradle.lockfile
|
|
||||||
+++ b/pkl-commons/gradle.lockfile
|
|
||||||
@@ -27,4 +27,4 @@ org.junit.platform:junit-platform-commons:1.9.3=testCompileClasspath,testImpleme
|
|
||||||
org.junit.platform:junit-platform-engine:1.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
-empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-config-java/gradle.lockfile b/pkl-config-java/gradle.lockfile
|
|
||||||
index 271ca49..3648401 100644
|
|
||||||
--- a/pkl-config-java/gradle.lockfile
|
|
||||||
+++ b/pkl-config-java/gradle.lockfile
|
|
||||||
@@ -11,8 +11,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,pklCodegenJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,pklCodegenJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,pklCodegenJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,pklCodegenJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -23,10 +23,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,pklCodegenJava,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=pklCodegenJava,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=pklCodegenJava,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,pklCodegenJava,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=pklCodegenJava
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=pklCodegenJava
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=pklCodegenJava
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=pklCodegenJava
|
|
||||||
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,pklCodegenJava,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
@@ -37,4 +41,4 @@ org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMet
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,pklCodegenJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,pklCodegenJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileOnly,compileOnlyDependenciesMetadata,fatJar,firstPartySourcesJars,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,pklCoreSourcesJar,runtime,runtimeOnlyDependenciesMetadata,shadow,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileOnly,compileOnlyDependenciesMetadata,fatJar,firstPartySourcesJars,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,pklCoreSourcesJar,runtime,runtimeOnlyDependenciesMetadata,shadow,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-config-kotlin/gradle.lockfile b/pkl-config-kotlin/gradle.lockfile
|
|
||||||
index 681ecdb..5c8f48b 100644
|
|
||||||
--- a/pkl-config-kotlin/gradle.lockfile
|
|
||||||
+++ b/pkl-config-kotlin/gradle.lockfile
|
|
||||||
@@ -10,8 +10,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,pklCodegenKotlin,pklConfigJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,pklCodegenKotlin,pklConfigJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,pklCodegenKotlin,pklConfigJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,pklCodegenKotlin,pklConfigJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -22,10 +22,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,pklCodegenKotlin,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,pklCodegenKotlin,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,pklCodegenKotlin,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,pklCodegenKotlin,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=pklCodegenKotlin
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=pklCodegenKotlin
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=pklCodegenKotlin
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=pklCodegenKotlin
|
|
||||||
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,pklCodegenKotlin,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
@@ -36,4 +40,4 @@ org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMet
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,pklCodegenKotlin,pklConfigJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,pklCodegenKotlin,pklConfigJava,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,pklConfigJavaAll,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,pklConfigJavaAll,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-core/gradle.lockfile b/pkl-core/gradle.lockfile
|
|
||||||
index a4ad3ca..cf5be68 100644
|
|
||||||
--- a/pkl-core/gradle.lockfile
|
|
||||||
+++ b/pkl-core/gradle.lockfile
|
|
||||||
@@ -13,9 +13,9 @@ org.antlr:ST4:4.3=antlr
|
|
||||||
org.antlr:antlr-runtime:3.5.2=antlr
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=compileClasspath,default,generatorCompileClasspath,generatorImplementationDependenciesMetadata,generatorRuntimeClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=compileClasspath,default,generatorCompileClasspath,generatorImplementationDependenciesMetadata,generatorRuntimeClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-dsl-processor:22.3.1=annotationProcessor
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=compileClasspath,default,generatorCompileClasspath,generatorImplementationDependenciesMetadata,generatorRuntimeClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=compileClasspath,default,generatorCompileClasspath,generatorImplementationDependenciesMetadata,generatorRuntimeClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-dsl-processor:23.0.2=annotationProcessor
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -41,4 +41,4 @@ org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenc
|
|
||||||
org.organicdesign:Paguro:3.10.3=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.slf4j:slf4j-api:1.7.32=compileOnly
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-empty=apiDependenciesMetadata,archives,compile,generatorAnnotationProcessor,generatorApiDependenciesMetadata,generatorCompileOnly,generatorCompileOnlyDependenciesMetadata,generatorIntransitiveDependenciesMetadata,generatorKotlinScriptDef,generatorKotlinScriptDefExtensions,generatorRuntimeOnlyDependenciesMetadata,intransitiveDependenciesMetadata,javaExecutable,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=apiDependenciesMetadata,archives,compile,generatorAnnotationProcessor,generatorApiDependenciesMetadata,generatorCompileOnly,generatorCompileOnlyDependenciesMetadata,generatorIntransitiveDependenciesMetadata,generatorKotlinScriptDef,generatorKotlinScriptDefExtensions,generatorRuntimeOnlyDependenciesMetadata,intransitiveDependenciesMetadata,javaExecutable,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-doc/gradle.lockfile b/pkl-doc/gradle.lockfile
|
|
||||||
index 9a78e5a..629fd77 100644
|
|
||||||
--- a/pkl-doc/gradle.lockfile
|
|
||||||
+++ b/pkl-doc/gradle.lockfile
|
|
||||||
@@ -11,7 +11,7 @@ com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=test
|
|
||||||
com.google.j2objc:j2objc-annotations:1.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
com.google.jimfs:jimfs:1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
com.ibm.icu:icu4j:58.2=validator
|
|
||||||
-com.ibm.icu:icu4j:71.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+com.ibm.icu:icu4j:72.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
com.shapesecurity:salvation:2.7.2=validator
|
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
commons-codec:commons-codec:1.10=validator
|
|
||||||
@@ -38,10 +38,10 @@ org.commonmark:commonmark-ext-gfm-tables:0.21.0=compileClasspath,default,impleme
|
|
||||||
org.commonmark:commonmark:0.21.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.eclipse.jetty:jetty-util-ajax:9.4.18.v20190429=validator
|
|
||||||
org.eclipse.jetty:jetty-util:9.4.18.v20190429=validator
|
|
||||||
-org.graalvm.js:js:22.3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.regex:regex:22.3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.js:js:23.0.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.regex:regex:23.0.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -56,10 +56,14 @@ org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerP
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-serialization:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.8.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testImplementationDependenciesMetadata
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.8.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-tooling-core:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-util-io:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.1=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
@@ -78,4 +82,4 @@ org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMet
|
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,archives,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions
|
|
||||||
+empty=annotationProcessor,archives,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions
|
|
||||||
diff --git a/pkl-executor/gradle.lockfile b/pkl-executor/gradle.lockfile
|
|
||||||
index c5fa512..0d31a41 100644
|
|
||||||
--- a/pkl-executor/gradle.lockfile
|
|
||||||
+++ b/pkl-executor/gradle.lockfile
|
|
||||||
@@ -6,8 +6,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
@@ -34,4 +34,4 @@ org.organicdesign:Paguro:3.10.3=testRuntimeClasspath
|
|
||||||
org.slf4j:slf4j-api:1.7.36=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.slf4j:slf4j-simple:1.7.36=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=testRuntimeClasspath
|
|
||||||
-empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,pklDistribution,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
+empty=annotationProcessor,apiDependenciesMetadata,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,pklDistribution,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
|
||||||
diff --git a/pkl-gradle/gradle.lockfile b/pkl-gradle/gradle.lockfile
|
|
||||||
index 4db8f8d..d8eaca1 100644
|
|
||||||
--- a/pkl-gradle/gradle.lockfile
|
|
||||||
+++ b/pkl-gradle/gradle.lockfile
|
|
||||||
@@ -17,10 +17,14 @@ org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspat
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=compileClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.10=compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=compileClasspath
|
|
||||||
org.jetbrains:annotations:13.0=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
|
||||||
diff --git a/pkl-server/gradle.lockfile b/pkl-server/gradle.lockfile
|
|
||||||
index 22b6965..813fd46 100644
|
|
||||||
--- a/pkl-server/gradle.lockfile
|
|
||||||
+++ b/pkl-server/gradle.lockfile
|
|
||||||
@@ -6,8 +6,8 @@ net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependen
|
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
|
||||||
diff --git a/pkl-tools/gradle.lockfile b/pkl-tools/gradle.lockfile
|
|
||||||
index a04dc3b..c1a960c 100644
|
|
||||||
--- a/pkl-tools/gradle.lockfile
|
|
||||||
+++ b/pkl-tools/gradle.lockfile
|
|
||||||
@@ -10,13 +10,15 @@ io.leangen.geantyref:geantyref:1.3.14=default,runtimeClasspath,testRuntimeClassp
|
|
||||||
org.commonmark:commonmark-ext-gfm-tables:0.21.0=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.commonmark:commonmark:0.21.0=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.fusesource.jansi:jansi:2.4.0=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlin:kotlin-reflect:1.7.10=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21=compileClasspath,testCompileClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.8.21=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.7.21=compileClasspath,testCompileClasspath
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.8.21=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlinx:kotlinx-serialization-bom:1.5.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.5.1=default,runtimeClasspath,testRuntimeClasspath
|
|
||||||
diff --git a/stdlib/gradle.lockfile b/stdlib/gradle.lockfile
|
|
||||||
index 00a8691..7e06c36 100644
|
|
||||||
--- a/stdlib/gradle.lockfile
|
|
||||||
+++ b/stdlib/gradle.lockfile
|
|
||||||
@@ -6,12 +6,12 @@ com.github.ajalt.clikt:clikt:3.5.1=pkldoc
|
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=pkldoc
|
|
||||||
org.commonmark:commonmark-ext-gfm-tables:0.21.0=pkldoc
|
|
||||||
org.commonmark:commonmark:0.21.0=pkldoc
|
|
||||||
-org.graalvm.sdk:graal-sdk:22.3.1=pkldoc
|
|
||||||
-org.graalvm.truffle:truffle-api:22.3.1=pkldoc
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=pkldoc
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=pkldoc
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=pkldoc
|
|
||||||
-org.jetbrains.kotlin:kotlin-stdlib:1.7.10=pkldoc
|
|
||||||
+org.graalvm.sdk:graal-sdk:23.0.2=pkldoc
|
|
||||||
+org.graalvm.truffle:truffle-api:23.0.2=pkldoc
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-common:1.8.21=pkldoc
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21=pkldoc
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21=pkldoc
|
|
||||||
+org.jetbrains.kotlin:kotlin-stdlib:1.8.21=pkldoc
|
|
||||||
org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.1=pkldoc
|
|
||||||
org.jetbrains.kotlinx:kotlinx-serialization-bom:1.5.1=pkldoc
|
|
||||||
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.5.1=pkldoc
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# This is a Gradle generated file for dependency locking.
|
||||||
|
# Manual edits can break the build and are not advised.
|
||||||
|
# This file is expected to be part of source control.
|
||||||
|
net.bytebuddy:byte-buddy:1.14.16=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
|
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
||||||
|
org.assertj:assertj-core:3.26.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.7.10=kotlinKlibCommonizerClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-reflect:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-script-runtime:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.jetbrains:annotations:13.0=kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.junit.jupiter:junit-jupiter-api:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
|
org.junit.jupiter:junit-jupiter-engine:5.10.2=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
|
org.junit.jupiter:junit-jupiter-params:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.junit.platform:junit-platform-commons:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
|
org.junit.platform:junit-platform-engine:1.10.2=testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
|
org.junit:junit-bom:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
|
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
|
empty=annotationProcessor,apiDependenciesMetadata,compileClasspath,compileOnlyDependenciesMetadata,implementationDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtimeClasspath,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions
|
||||||
+74
-18
@@ -1,21 +1,70 @@
|
|||||||
# This is a Gradle generated file for dependency locking.
|
# This is a Gradle generated file for dependency locking.
|
||||||
# Manual edits can break the build and are not advised.
|
# Manual edits can break the build and are not advised.
|
||||||
# This file is expected to be part of source control.
|
# This file is expected to be part of source control.
|
||||||
|
com.ethlo.time:itu:1.8.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-annotations:2.17.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-core:2.17.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-databind:2.17.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson:jackson-bom:2.17.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
com.github.ajalt.clikt:clikt-jvm:3.5.1=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
com.github.ajalt.clikt:clikt-jvm:3.5.1=compileClasspath,default,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
com.github.ajalt.clikt:clikt:3.5.1=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
com.github.ajalt.clikt:clikt:3.5.1=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.github.jknack:handlebars-helpers:4.3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.github.jknack:handlebars:4.3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.google.errorprone:error_prone_annotations:2.26.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.google.guava:failureaccess:1.0.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.google.guava:guava:33.2.0-jre=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.google.j2objc:j2objc-annotations:3.0.0=testCompileClasspath,testImplementationDependenciesMetadata
|
||||||
|
com.jayway.jsonpath:json-path:2.9.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
com.networknt:json-schema-validator:1.4.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=default,runtimeClasspath,testRuntimeClasspath
|
com.tunnelvisionlabs:antlr4-runtime:4.9.0=default,runtimeClasspath,testRuntimeClasspath
|
||||||
net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
commons-io:commons-io:2.11.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
net.bytebuddy:byte-buddy:1.14.16=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
|
net.javacrumbs.json-unit:json-unit-core:2.38.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
net.minidev:accessors-smart:2.5.1=testRuntimeClasspath
|
||||||
|
net.minidev:json-smart:2.5.1=testRuntimeClasspath
|
||||||
|
net.sf.jopt-simple:jopt-simple:5.0.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.apache.httpcomponents.client5:httpclient5:5.3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.apache.httpcomponents.core5:httpcore5-h2:5.2.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.apache.httpcomponents.core5:httpcore5:5.2.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.assertj:assertj-core:3.26.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.fusesource.jansi:jansi:2.4.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.checkerframework:checker-qual:3.42.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.compiler:compiler:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
org.eclipse.jetty.http2:http2-common:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.nativeimage:native-image-base:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
org.eclipse.jetty.http2:http2-hpack:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.nativeimage:objectfile:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
org.eclipse.jetty.http2:http2-server:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.nativeimage:pointsto:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.nativeimage:svm:22.3.1=compileClasspath,compileOnlyDependenciesMetadata
|
org.eclipse.jetty:jetty-alpn-client:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.sdk:graal-sdk:22.3.1=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
org.eclipse.jetty:jetty-alpn-java-client:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.truffle:truffle-api:22.3.1=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
org.eclipse.jetty:jetty-alpn-java-server:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-alpn-server:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-bom:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-client:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-http:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-io:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-proxy:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-security:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-server:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-servlet:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-servlets:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-util:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-webapp:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-xml:11.0.20=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.fusesource.jansi:jansi:2.4.0=default
|
||||||
|
org.fusesource.jansi:jansi:2.4.1=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.graalvm.compiler:compiler:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
||||||
|
org.graalvm.nativeimage:native-image-base:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
||||||
|
org.graalvm.nativeimage:objectfile:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
||||||
|
org.graalvm.nativeimage:pointsto:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
||||||
|
org.graalvm.nativeimage:svm:23.0.2=compileClasspath,compileOnlyDependenciesMetadata
|
||||||
|
org.graalvm.sdk:graal-sdk:23.0.2=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
||||||
|
org.graalvm.truffle:truffle-api:23.0.2=compileClasspath,compileOnlyDependenciesMetadata,default,runtimeClasspath,testRuntimeClasspath
|
||||||
|
org.hamcrest:hamcrest-core:2.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.hamcrest:hamcrest:2.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
@@ -35,14 +84,21 @@ org.jline:jline-native:3.23.0=compileClasspath,default,implementationDependencie
|
|||||||
org.jline:jline-reader:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jline:jline-reader:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jline:jline-terminal-jansi:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jline:jline-terminal-jansi:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jline:jline-terminal:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jline:jline-terminal:3.23.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-api:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-engine:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-params:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.junit.jupiter:junit-jupiter-params:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.platform:junit-platform-commons:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-commons:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.platform:junit-platform-engine:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-engine:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit:junit-bom:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.msgpack:msgpack-core:0.9.0=default,runtimeClasspath,testRuntimeClasspath
|
org.msgpack:msgpack-core:0.9.0=default,runtimeClasspath,testRuntimeClasspath
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
||||||
|
org.slf4j:slf4j-api:2.0.11=testRuntimeClasspath
|
||||||
|
org.slf4j:slf4j-api:2.0.9=testCompileClasspath,testImplementationDependenciesMetadata
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
||||||
empty=annotationProcessor,archives,compile,intransitiveDependenciesMetadata,javaExecutable,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
org.wiremock:wiremock:3.6.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.xmlunit:xmlunit-core:2.10.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.xmlunit:xmlunit-legacy:2.10.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.xmlunit:xmlunit-placeholders:2.10.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
org.yaml:snakeyaml:2.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
|
empty=annotationProcessor,archives,compile,intransitiveDependenciesMetadata,javaExecutable,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,signatures,sourcesJar,stagedAlpineLinuxAmd64Executable,stagedLinuxAarch64Executable,stagedLinuxAmd64Executable,stagedMacAarch64Executable,stagedMacAmd64Executable,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
||||||
|
|||||||
+163
-104
@@ -33,34 +33,39 @@ val stagedMacAarch64Executable: Configuration by configurations.creating
|
|||||||
val stagedLinuxAmd64Executable: Configuration by configurations.creating
|
val stagedLinuxAmd64Executable: Configuration by configurations.creating
|
||||||
val stagedLinuxAarch64Executable: Configuration by configurations.creating
|
val stagedLinuxAarch64Executable: Configuration by configurations.creating
|
||||||
val stagedAlpineLinuxAmd64Executable: Configuration by configurations.creating
|
val stagedAlpineLinuxAmd64Executable: Configuration by configurations.creating
|
||||||
|
val stagedWindowsAmd64Executable: Configuration by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly(libs.svm)
|
compileOnly(libs.svm)
|
||||||
|
|
||||||
// CliEvaluator exposes PClass
|
// CliEvaluator exposes PClass
|
||||||
api(project(":pkl-core"))
|
api(projects.pklCore)
|
||||||
// CliEvaluatorOptions exposes CliBaseOptions
|
// CliEvaluatorOptions exposes CliBaseOptions
|
||||||
api(project(":pkl-commons-cli"))
|
api(projects.pklCommonsCli)
|
||||||
|
|
||||||
implementation(project(":pkl-commons"))
|
implementation(projects.pklCommons)
|
||||||
implementation(libs.jansi)
|
implementation(libs.jansi)
|
||||||
implementation(libs.jlineReader)
|
implementation(libs.jlineReader)
|
||||||
implementation(libs.jlineTerminal)
|
implementation(libs.jlineTerminal)
|
||||||
implementation(libs.jlineTerminalJansi)
|
implementation(libs.jlineTerminalJansi)
|
||||||
implementation(project(":pkl-server"))
|
implementation(projects.pklServer)
|
||||||
implementation(libs.clikt) {
|
implementation(libs.clikt) {
|
||||||
// force clikt to use our version of the kotlin stdlib
|
// force clikt to use our version of the kotlin stdlib
|
||||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
|
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
|
||||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common")
|
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common")
|
||||||
}
|
}
|
||||||
|
|
||||||
testImplementation(project(":pkl-commons-test"))
|
testImplementation(projects.pklCommonsTest)
|
||||||
|
testImplementation(libs.wiremock)
|
||||||
|
|
||||||
stagedMacAmd64Executable(files("$buildDir/executable/pkl-macos-amd64"))
|
fun executableDir(name: String) = files(layout.buildDirectory.dir("executable/$name"))
|
||||||
stagedMacAarch64Executable(files("$buildDir/executable/pkl-macos-aarch64"))
|
stagedMacAmd64Executable(executableDir("pkl-macos-amd64"))
|
||||||
stagedLinuxAmd64Executable(files("$buildDir/executable/pkl-linux-amd64"))
|
stagedMacAmd64Executable(executableDir("pkl-macos-amd64"))
|
||||||
stagedLinuxAarch64Executable(files("$buildDir/executable/pkl-linux-aarch64"))
|
stagedMacAarch64Executable(executableDir("pkl-macos-aarch64"))
|
||||||
stagedAlpineLinuxAmd64Executable(files("$buildDir/executable/pkl-alpine-linux-amd64"))
|
stagedLinuxAmd64Executable(executableDir("pkl-linux-amd64"))
|
||||||
|
stagedLinuxAarch64Executable(executableDir("pkl-linux-aarch64"))
|
||||||
|
stagedAlpineLinuxAmd64Executable(executableDir("pkl-alpine-linux-amd64"))
|
||||||
|
stagedWindowsAmd64Executable(executableDir("pkl-windows-amd64.exe"))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.jar {
|
tasks.jar {
|
||||||
@@ -90,7 +95,7 @@ tasks.shadowJar {
|
|||||||
|
|
||||||
val javaExecutable by tasks.registering(ExecutableJar::class) {
|
val javaExecutable by tasks.registering(ExecutableJar::class) {
|
||||||
inJar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
inJar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||||
outJar.set(file("$buildDir/executable/jpkl"))
|
outJar.set(layout.buildDirectory.file("executable/jpkl"))
|
||||||
|
|
||||||
// uncomment for debugging
|
// uncomment for debugging
|
||||||
//jvmArgs.addAll("-ea", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
|
//jvmArgs.addAll("-ea", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
|
||||||
@@ -99,8 +104,8 @@ val javaExecutable by tasks.registering(ExecutableJar::class) {
|
|||||||
val testJavaExecutable by tasks.registering(Test::class) {
|
val testJavaExecutable by tasks.registering(Test::class) {
|
||||||
testClassesDirs = tasks.test.get().testClassesDirs
|
testClassesDirs = tasks.test.get().testClassesDirs
|
||||||
classpath =
|
classpath =
|
||||||
// compiled test classes
|
// compiled test classes
|
||||||
sourceSets.test.get().output +
|
sourceSets.test.get().output +
|
||||||
// java executable
|
// java executable
|
||||||
javaExecutable.get().outputs.files +
|
javaExecutable.get().outputs.files +
|
||||||
// test-only dependencies
|
// test-only dependencies
|
||||||
@@ -117,91 +122,92 @@ tasks.check {
|
|||||||
// To catch this and similar problems, test that Java executable starts successfully.
|
// To catch this and similar problems, test that Java executable starts successfully.
|
||||||
val testStartJavaExecutable by tasks.registering(Exec::class) {
|
val testStartJavaExecutable by tasks.registering(Exec::class) {
|
||||||
dependsOn(javaExecutable)
|
dependsOn(javaExecutable)
|
||||||
val outputFile = file("$buildDir/testStartJavaExecutable") // dummy output to satisfy up-to-date check
|
val outputFile =
|
||||||
|
layout.buildDirectory.file("testStartJavaExecutable") // dummy output to satisfy up-to-date check
|
||||||
outputs.file(outputFile)
|
outputs.file(outputFile)
|
||||||
|
|
||||||
executable = javaExecutable.get().outputs.files.singleFile.toString()
|
if (buildInfo.os.isWindows) {
|
||||||
args("--version")
|
executable = "java"
|
||||||
|
args("-jar", javaExecutable.get().outputs.files.singleFile.toString(), "--version")
|
||||||
doFirst { outputFile.delete() }
|
} else {
|
||||||
|
executable = javaExecutable.get().outputs.files.singleFile.toString()
|
||||||
doLast { outputFile.writeText("OK") }
|
args("--version")
|
||||||
|
}
|
||||||
|
|
||||||
|
doFirst { outputFile.get().asFile.delete() }
|
||||||
|
|
||||||
|
doLast { outputFile.get().asFile.writeText("OK") }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.check {
|
tasks.check {
|
||||||
dependsOn(testStartJavaExecutable)
|
dependsOn(testStartJavaExecutable)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Exec.configureExecutable(isEnabled: Boolean, outputFile: File, extraArgs: List<String> = listOf()) {
|
fun Exec.configureExecutable(
|
||||||
enabled = isEnabled
|
graalVm: BuildInfo.GraalVm,
|
||||||
dependsOn(":installGraalVm")
|
outputFile: Provider<RegularFile>,
|
||||||
|
extraArgs: List<String> = listOf()
|
||||||
|
) {
|
||||||
inputs.files(sourceSets.main.map { it.output })
|
inputs.files(sourceSets.main.map { it.output })
|
||||||
|
.withPropertyName("mainSourceSets")
|
||||||
|
.withPathSensitivity(PathSensitivity.RELATIVE)
|
||||||
inputs.files(configurations.runtimeClasspath)
|
inputs.files(configurations.runtimeClasspath)
|
||||||
|
.withPropertyName("runtimeClasspath")
|
||||||
|
.withNormalizer(ClasspathNormalizer::class)
|
||||||
|
val nativeImageCommandName = if (buildInfo.os.isWindows) "native-image.cmd" else "native-image"
|
||||||
|
inputs.files(
|
||||||
|
file(graalVm.baseDir)
|
||||||
|
.resolve("bin/$nativeImageCommandName")
|
||||||
|
)
|
||||||
|
.withPropertyName("graalVmNativeImage")
|
||||||
|
.withPathSensitivity(PathSensitivity.ABSOLUTE)
|
||||||
outputs.file(outputFile)
|
outputs.file(outputFile)
|
||||||
|
outputs.cacheIf { true }
|
||||||
|
|
||||||
workingDir = outputFile.parentFile
|
workingDir(outputFile.map { it.asFile.parentFile })
|
||||||
executable = "${buildInfo.graalVm.baseDir}/bin/native-image"
|
executable = "${graalVm.baseDir}/bin/$nativeImageCommandName"
|
||||||
|
|
||||||
// JARs to exclude from the class path for the native-image build.
|
// JARs to exclude from the class path for the native-image build.
|
||||||
val exclusions =
|
val exclusions = listOf(libs.truffleApi, libs.graalSdk).map { it.get().module.name }
|
||||||
if (buildInfo.graalVm.isGraal22) emptyList()
|
|
||||||
else listOf(libs.truffleApi, libs.graalSdk).map { it.get().module.name }
|
|
||||||
// https://www.graalvm.org/22.0/reference-manual/native-image/Options/
|
// https://www.graalvm.org/22.0/reference-manual/native-image/Options/
|
||||||
argumentProviders.add(CommandLineArgumentProvider {
|
argumentProviders.add(CommandLineArgumentProvider {
|
||||||
listOf(
|
buildList {
|
||||||
// currently gives a deprecation warning, but we've been told
|
// currently gives a deprecation warning, but we've been told
|
||||||
// that the "initialize everything at build time" *CLI* option is likely here to stay
|
// that the "initialize everything at build time" *CLI* option is likely here to stay
|
||||||
"--initialize-at-build-time="
|
add("--initialize-at-build-time=")
|
||||||
,"--no-fallback"
|
// needed for messagepack-java (see https://github.com/msgpack/msgpack-java/issues/600)
|
||||||
,"-H:IncludeResources=org/pkl/core/stdlib/.*\\.pkl"
|
add("--initialize-at-run-time=org.msgpack.core.buffer.DirectBufferAccess")
|
||||||
,"-H:IncludeResources=org/jline/utils/.*"
|
add("--no-fallback")
|
||||||
,"-H:IncludeResources=org/pkl/commons/cli/commands/IncludedCARoots.pem"
|
add("-H:IncludeResources=org/pkl/core/stdlib/.*\\.pkl")
|
||||||
//,"-H:IncludeResources=org/pkl/core/Release.properties"
|
add("-H:IncludeResources=org/jline/utils/.*")
|
||||||
,"-H:IncludeResourceBundles=org.pkl.core.errorMessages"
|
add("-H:IncludeResourceBundles=org.pkl.core.errorMessages")
|
||||||
,"--macro:truffle"
|
add("-H:IncludeResources=org/pkl/commons/cli/PklCARoots.pem")
|
||||||
,"-H:Class=org.pkl.cli.Main"
|
add("--macro:truffle")
|
||||||
,"-H:Name=${outputFile.name}"
|
add("-H:Class=org.pkl.cli.Main")
|
||||||
//,"--native-image-info"
|
add("-H:Name=${outputFile.get().asFile.name}")
|
||||||
//,"-Dpolyglot.image-build-time.PreinitializeContexts=pkl"
|
// the actual limit (currently) used by native-image is this number + 1400 (idea is to compensate for Truffle's own nodes)
|
||||||
// the actual limit (currently) used by native-image is this number + 1400 (idea is to compensate for Truffle's own nodes)
|
add("-H:MaxRuntimeCompileMethods=1800")
|
||||||
,"-H:MaxRuntimeCompileMethods=1800"
|
add("-H:+EnforceMaxRuntimeCompileMethods")
|
||||||
,"-H:+EnforceMaxRuntimeCompileMethods"
|
add("--enable-url-protocols=http,https")
|
||||||
,"--enable-url-protocols=http,https"
|
add("-H:+ReportExceptionStackTraces")
|
||||||
//,"--install-exit-handlers"
|
// disable automatic support for JVM CLI options (puts our main class in full control of argument parsing)
|
||||||
,"-H:+ReportExceptionStackTraces"
|
add("-H:-ParseRuntimeOptions")
|
||||||
,"-H:-ParseRuntimeOptions" // disable automatic support for JVM CLI options (puts our main class in full control of argument parsing)
|
// quick build mode: 40% faster compilation, 20% smaller (but presumably also slower) executable
|
||||||
//,"-H:+PrintAnalysisCallTree"
|
if (!buildInfo.isReleaseBuild) {
|
||||||
//,"-H:PrintAnalysisCallTreeType=CSV"
|
add("-Ob")
|
||||||
//,"-H:+PrintImageObjectTree"
|
}
|
||||||
//,"--features=org.pkl.cli.svm.InitFeature"
|
add("-march=compatibility")
|
||||||
//,"-H:Dump=:2"
|
// native-image rejects non-existing class path entries -> filter
|
||||||
//,"-H:MethodFilter=ModuleCache.getOrLoad*,VmLanguage.loadModule"
|
add("--class-path")
|
||||||
//,"-g"
|
val pathInput = sourceSets.main.get().output + configurations.runtimeClasspath.get()
|
||||||
//,"-verbose"
|
.filter { it.exists() && !exclusions.any { exclude -> it.name.contains(exclude) } }
|
||||||
//,"--debug-attach"
|
add(pathInput.asPath)
|
||||||
//,"-H:+AllowVMInspection"
|
// make sure dev machine stays responsive (15% slowdown on my laptop)
|
||||||
//,"-H:+PrintHeapHistogram"
|
val processors = Runtime.getRuntime().availableProcessors() /
|
||||||
//,"-H:+ReportDeletedElementsAtRuntime"
|
if (buildInfo.os.isMacOsX && !buildInfo.isCiBuild) 4 else 1
|
||||||
//,"-H:+PrintMethodHistogram"
|
add("-J-XX:ActiveProcessorCount=${processors}")
|
||||||
//,"-H:+PrintRuntimeCompileMethods"
|
addAll(extraArgs)
|
||||||
//,"-H:NumberOfThreads=1"
|
}
|
||||||
//,"-J-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime"
|
|
||||||
//,"-J-Dcom.oracle.truffle.aot=true"
|
|
||||||
//,"-J:-ea"
|
|
||||||
//,"-J:-esa"
|
|
||||||
// for use with https://www.graalvm.org/docs/tools/dashboard/
|
|
||||||
//,"-H:DashboardDump=dashboard.dump", "-H:+DashboardAll"
|
|
||||||
// native-image rejects non-existing class path entries -> filter
|
|
||||||
,"--class-path"
|
|
||||||
,((sourceSets.main.get().output + configurations.runtimeClasspath.get())
|
|
||||||
.filter { it.exists() && !exclusions.any { exclude -> it.name.contains(exclude) }})
|
|
||||||
.asPath
|
|
||||||
// make sure dev machine stays responsive (15% slowdown on my laptop)
|
|
||||||
,"-J-XX:ActiveProcessorCount=${
|
|
||||||
Runtime.getRuntime().availableProcessors() / (if (buildInfo.os.isMacOsX && !buildInfo.isCiBuild) 4 else 1)
|
|
||||||
}"
|
|
||||||
) + extraArgs
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,21 +215,22 @@ fun Exec.configureExecutable(isEnabled: Boolean, outputFile: File, extraArgs: Li
|
|||||||
* Builds the pkl CLI for macOS/amd64.
|
* Builds the pkl CLI for macOS/amd64.
|
||||||
*/
|
*/
|
||||||
val macExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
val macExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||||
configureExecutable(buildInfo.os.isMacOsX && buildInfo.graalVm.isGraal22, file("$buildDir/executable/pkl-macos-amd64"))
|
dependsOn(":installGraalVmAmd64")
|
||||||
|
configureExecutable(
|
||||||
|
buildInfo.graalVmAmd64,
|
||||||
|
layout.buildDirectory.file("executable/pkl-macos-amd64")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the pkl CLI for macOS/aarch64.
|
* Builds the pkl CLI for macOS/aarch64.
|
||||||
*
|
|
||||||
* This requires that GraalVM be set to version 23.0 or greater, because 22.x does not support this
|
|
||||||
* os/arch pair.
|
|
||||||
*/
|
*/
|
||||||
val macExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
val macExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||||
|
dependsOn(":installGraalVmAarch64")
|
||||||
configureExecutable(
|
configureExecutable(
|
||||||
buildInfo.os.isMacOsX && !buildInfo.graalVm.isGraal22,
|
buildInfo.graalVmAarch64,
|
||||||
file("$buildDir/executable/pkl-macos-aarch64"),
|
layout.buildDirectory.file("executable/pkl-macos-aarch64"),
|
||||||
listOf(
|
listOf(
|
||||||
"--initialize-at-run-time=org.msgpack.core.buffer.DirectBufferAccess",
|
|
||||||
"-H:+AllowDeprecatedBuilderClassesOnImageClasspath"
|
"-H:+AllowDeprecatedBuilderClassesOnImageClasspath"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -233,7 +240,11 @@ val macExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
|||||||
* Builds the pkl CLI for linux/amd64.
|
* Builds the pkl CLI for linux/amd64.
|
||||||
*/
|
*/
|
||||||
val linuxExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
val linuxExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||||
configureExecutable(buildInfo.os.isLinux && buildInfo.arch == "amd64", file("$buildDir/executable/pkl-linux-amd64"))
|
dependsOn(":installGraalVmAmd64")
|
||||||
|
configureExecutable(
|
||||||
|
buildInfo.graalVmAmd64,
|
||||||
|
layout.buildDirectory.file("executable/pkl-linux-amd64")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -243,7 +254,11 @@ val linuxExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
|||||||
* ARM instances.
|
* ARM instances.
|
||||||
*/
|
*/
|
||||||
val linuxExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
val linuxExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||||
configureExecutable(buildInfo.os.isLinux && buildInfo.arch == "aarch64", file("$buildDir/executable/pkl-linux-aarch64"))
|
dependsOn(":installGraalVmAarch64")
|
||||||
|
configureExecutable(
|
||||||
|
buildInfo.graalVmAarch64,
|
||||||
|
layout.buildDirectory.file("executable/pkl-linux-aarch64")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -253,20 +268,47 @@ val linuxExecutableAarch64: TaskProvider<Exec> by tasks.registering(Exec::class)
|
|||||||
* Details: https://www.graalvm.org/22.0/reference-manual/native-image/ARM64/
|
* Details: https://www.graalvm.org/22.0/reference-manual/native-image/ARM64/
|
||||||
*/
|
*/
|
||||||
val alpineExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
val alpineExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||||
|
dependsOn(":installGraalVmAmd64")
|
||||||
configureExecutable(
|
configureExecutable(
|
||||||
buildInfo.os.isLinux && buildInfo.arch == "amd64" && buildInfo.hasMuslToolchain,
|
buildInfo.graalVmAmd64,
|
||||||
file("$buildDir/executable/pkl-alpine-linux-amd64"),
|
layout.buildDirectory.file("executable/pkl-alpine-linux-amd64"),
|
||||||
listOf(
|
listOf("--static", "--libc=musl")
|
||||||
"--static",
|
)
|
||||||
"--libc=musl",
|
}
|
||||||
"-H:CCompilerOption=-Wl,-z,stack-size=10485760",
|
|
||||||
"-Dorg.pkl.compat=alpine"
|
val windowsExecutableAmd64: TaskProvider<Exec> by tasks.registering(Exec::class) {
|
||||||
)
|
dependsOn(":installGraalVmAmd64")
|
||||||
|
configureExecutable(
|
||||||
|
buildInfo.graalVmAmd64,
|
||||||
|
layout.buildDirectory.file("executable/pkl-windows-amd64"),
|
||||||
|
listOf("-Dfile.encoding=UTF-8")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.assembleNative {
|
tasks.assembleNative {
|
||||||
dependsOn(macExecutableAmd64, macExecutableAarch64, linuxExecutableAmd64, linuxExecutableAarch64, alpineExecutableAmd64)
|
when {
|
||||||
|
buildInfo.os.isMacOsX -> {
|
||||||
|
dependsOn(macExecutableAmd64)
|
||||||
|
if (buildInfo.arch == "aarch64") {
|
||||||
|
dependsOn(macExecutableAarch64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildInfo.os.isWindows -> {
|
||||||
|
dependsOn(windowsExecutableAmd64)
|
||||||
|
}
|
||||||
|
|
||||||
|
buildInfo.os.isLinux && buildInfo.arch == "aarch64" -> {
|
||||||
|
dependsOn(linuxExecutableAarch64)
|
||||||
|
}
|
||||||
|
|
||||||
|
buildInfo.os.isLinux && buildInfo.arch == "amd64" -> {
|
||||||
|
dependsOn(linuxExecutableAmd64)
|
||||||
|
if (buildInfo.hasMuslToolchain) {
|
||||||
|
dependsOn(alpineExecutableAmd64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make Java executable available to other subprojects
|
// make Java executable available to other subprojects
|
||||||
@@ -294,11 +336,13 @@ publishing {
|
|||||||
|
|
||||||
pom {
|
pom {
|
||||||
url.set("https://github.com/apple/pkl/tree/main/pkl-cli")
|
url.set("https://github.com/apple/pkl/tree/main/pkl-cli")
|
||||||
description.set("""
|
description.set(
|
||||||
|
"""
|
||||||
Pkl CLI executable for Java.
|
Pkl CLI executable for Java.
|
||||||
Can be executed directly on *nix (if the `java` command is found on the PATH) and with `java -jar` otherwise.
|
Can be executed directly on *nix (if the `java` command is found on the PATH) and with `java -jar` otherwise.
|
||||||
Requires Java 11 or higher.
|
Requires Java 17 or higher.
|
||||||
""".trimIndent())
|
""".trimIndent()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
create<MavenPublication>("macExecutableAmd64") {
|
create<MavenPublication>("macExecutableAmd64") {
|
||||||
@@ -366,6 +410,20 @@ publishing {
|
|||||||
description.set("Native Pkl CLI executable for linux/amd64 and statically linked to musl.")
|
description.set("Native Pkl CLI executable for linux/amd64 and statically linked to musl.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("windowsExecutableAmd64") {
|
||||||
|
artifactId = "pkl-cli-windows-amd64"
|
||||||
|
artifact(stagedWindowsAmd64Executable.singleFile) {
|
||||||
|
classifier = null
|
||||||
|
extension = "exe"
|
||||||
|
builtBy(stagedWindowsAmd64Executable)
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name.set("pkl-cli-windows-amd64")
|
||||||
|
url.set("https://github.com/apple/pkl/tree/main/pkl-cli")
|
||||||
|
description.set("Native Pkl CLI executable for windows/amd64.")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,5 +434,6 @@ signing {
|
|||||||
sign(publishing.publications["macExecutableAarch64"])
|
sign(publishing.publications["macExecutableAarch64"])
|
||||||
sign(publishing.publications["macExecutableAmd64"])
|
sign(publishing.publications["macExecutableAmd64"])
|
||||||
sign(publishing.publications["alpineLinuxExecutableAmd64"])
|
sign(publishing.publications["alpineLinuxExecutableAmd64"])
|
||||||
|
sign(publishing.publications["windowsExecutableAmd64"])
|
||||||
}
|
}
|
||||||
//endregion
|
//endregion
|
||||||
|
|||||||
@@ -111,7 +111,9 @@ constructor(
|
|||||||
|
|
||||||
return moduleUris.associateWith { uri ->
|
return moduleUris.associateWith { uri ->
|
||||||
val moduleDir: String? =
|
val moduleDir: String? =
|
||||||
IoUtils.toPath(uri)?.let { workingDir.relativize(it.parent).toString().ifEmpty { "." } }
|
IoUtils.toPath(uri)?.let {
|
||||||
|
IoUtils.relativize(it.parent, workingDir).toString().ifEmpty { "." }
|
||||||
|
}
|
||||||
val moduleKey =
|
val moduleKey =
|
||||||
try {
|
try {
|
||||||
moduleResolver.resolve(uri)
|
moduleResolver.resolve(uri)
|
||||||
@@ -158,7 +160,7 @@ constructor(
|
|||||||
} else {
|
} else {
|
||||||
if (output.isNotEmpty()) {
|
if (output.isNotEmpty()) {
|
||||||
outputFile.writeString(
|
outputFile.writeString(
|
||||||
options.moduleOutputSeparator + IoUtils.getLineSeparator(),
|
options.moduleOutputSeparator + '\n',
|
||||||
Charsets.UTF_8,
|
Charsets.UTF_8,
|
||||||
StandardOpenOption.WRITE,
|
StandardOpenOption.WRITE,
|
||||||
StandardOpenOption.APPEND
|
StandardOpenOption.APPEND
|
||||||
@@ -192,6 +194,14 @@ constructor(
|
|||||||
if (uri == VmUtils.REPL_TEXT_URI) ModuleSource.create(uri, reader.readText())
|
if (uri == VmUtils.REPL_TEXT_URI) ModuleSource.create(uri, reader.readText())
|
||||||
else ModuleSource.uri(uri)
|
else ModuleSource.uri(uri)
|
||||||
|
|
||||||
|
private fun checkPathSpec(pathSpec: String) {
|
||||||
|
val illegal = pathSpec.indexOfFirst { IoUtils.isReservedFilenameChar(it) && it != '/' }
|
||||||
|
if (illegal == -1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
throw CliException("Path spec `$pathSpec` contains illegal character `${pathSpec[illegal]}`.")
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders each module's `output.files`, writing each entry as a file into the specified output
|
* Renders each module's `output.files`, writing each entry as a file into the specified output
|
||||||
* directory.
|
* directory.
|
||||||
@@ -207,6 +217,7 @@ constructor(
|
|||||||
val moduleSource = toModuleSource(moduleUri, consoleReader)
|
val moduleSource = toModuleSource(moduleUri, consoleReader)
|
||||||
val output = evaluator.evaluateOutputFiles(moduleSource)
|
val output = evaluator.evaluateOutputFiles(moduleSource)
|
||||||
for ((pathSpec, fileOutput) in output) {
|
for ((pathSpec, fileOutput) in output) {
|
||||||
|
checkPathSpec(pathSpec)
|
||||||
val resolvedPath = outputDir.resolve(pathSpec).normalize()
|
val resolvedPath = outputDir.resolve(pathSpec).normalize()
|
||||||
val realPath = if (resolvedPath.exists()) resolvedPath.toRealPath() else resolvedPath
|
val realPath = if (resolvedPath.exists()) resolvedPath.toRealPath() else resolvedPath
|
||||||
if (!realPath.startsWith(outputDir)) {
|
if (!realPath.startsWith(outputDir)) {
|
||||||
@@ -228,7 +239,10 @@ constructor(
|
|||||||
writtenFiles[realPath] = OutputFile(pathSpec, moduleUri)
|
writtenFiles[realPath] = OutputFile(pathSpec, moduleUri)
|
||||||
realPath.createParentDirectories()
|
realPath.createParentDirectories()
|
||||||
realPath.writeString(fileOutput.text)
|
realPath.writeString(fileOutput.text)
|
||||||
consoleWriter.write(currentWorkingDir.relativize(resolvedPath).toString() + "\n")
|
consoleWriter.write(
|
||||||
|
IoUtils.relativize(resolvedPath, currentWorkingDir).toString() +
|
||||||
|
IoUtils.getLineSeparator()
|
||||||
|
)
|
||||||
consoleWriter.flush()
|
consoleWriter.flush()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-5
@@ -21,28 +21,32 @@ import org.pkl.commons.cli.CliException
|
|||||||
import org.pkl.core.packages.PackageResolver
|
import org.pkl.core.packages.PackageResolver
|
||||||
import org.pkl.core.packages.PackageUri
|
import org.pkl.core.packages.PackageUri
|
||||||
|
|
||||||
class CliDownloadPackageCommand(
|
class CliPackageDownloader(
|
||||||
baseOptions: CliBaseOptions,
|
baseOptions: CliBaseOptions,
|
||||||
private val packageUris: List<PackageUri>,
|
private val packageUris: List<PackageUri>,
|
||||||
private val noTranstive: Boolean
|
private val noTransitive: Boolean
|
||||||
) : CliCommand(baseOptions) {
|
) : CliCommand(baseOptions) {
|
||||||
|
|
||||||
override fun doRun() {
|
override fun doRun() {
|
||||||
if (moduleCacheDir == null) {
|
if (moduleCacheDir == null) {
|
||||||
throw CliException("Cannot download packages because no cache directory is specified.")
|
throw CliException("Cannot download packages because no cache directory is specified.")
|
||||||
}
|
}
|
||||||
val packageResolver = PackageResolver.getInstance(securityManager, moduleCacheDir)
|
val packageResolver = PackageResolver.getInstance(securityManager, httpClient, moduleCacheDir)
|
||||||
val errors = mutableMapOf<PackageUri, Throwable>()
|
val errors = mutableMapOf<PackageUri, Throwable>()
|
||||||
for (pkg in packageUris) {
|
for (pkg in packageUris) {
|
||||||
try {
|
try {
|
||||||
packageResolver.downloadPackage(pkg, pkg.checksums, noTranstive)
|
packageResolver.downloadPackage(pkg, pkg.checksums, noTransitive)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
errors[pkg] = e
|
errors[pkg] = e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
when (errors.size) {
|
when (errors.size) {
|
||||||
0 -> return
|
0 -> return
|
||||||
1 -> throw CliException(errors.values.single().message!!)
|
1 ->
|
||||||
|
throw CliException(
|
||||||
|
errors.values.single().message
|
||||||
|
?: ("An unexpected error occurred: " + errors.values.single())
|
||||||
|
)
|
||||||
else ->
|
else ->
|
||||||
throw CliException(
|
throw CliException(
|
||||||
buildString {
|
buildString {
|
||||||
+3
-5
@@ -23,10 +23,8 @@ import org.pkl.commons.cli.CliCommand
|
|||||||
import org.pkl.commons.cli.CliException
|
import org.pkl.commons.cli.CliException
|
||||||
import org.pkl.core.module.ProjectDependenciesManager.PKL_PROJECT_FILENAME
|
import org.pkl.core.module.ProjectDependenciesManager.PKL_PROJECT_FILENAME
|
||||||
|
|
||||||
abstract class CliAbstractProjectCommand(
|
abstract class CliProjectCommand(cliOptions: CliBaseOptions, private val projectDirs: List<Path>) :
|
||||||
cliOptions: CliBaseOptions,
|
CliCommand(cliOptions) {
|
||||||
private val projectDirs: List<Path>
|
|
||||||
) : CliCommand(cliOptions) {
|
|
||||||
|
|
||||||
protected val normalizedProjectFiles: List<Path> by lazy {
|
protected val normalizedProjectFiles: List<Path> by lazy {
|
||||||
if (projectDirs.isEmpty()) {
|
if (projectDirs.isEmpty()) {
|
||||||
@@ -37,7 +35,7 @@ abstract class CliAbstractProjectCommand(
|
|||||||
)
|
)
|
||||||
return@lazy listOf(projectFile.normalize())
|
return@lazy listOf(projectFile.normalize())
|
||||||
}
|
}
|
||||||
projectDirs.map { dir ->
|
projectDirs.map(cliOptions.normalizedWorkingDir::resolve).map { dir ->
|
||||||
val projectFile = dir.resolve(PKL_PROJECT_FILENAME)
|
val projectFile = dir.resolve(PKL_PROJECT_FILENAME)
|
||||||
if (!Files.exists(projectFile)) {
|
if (!Files.exists(projectFile)) {
|
||||||
throw CliException("Directory $dir does not contain a PklProject file.")
|
throw CliException("Directory $dir does not contain a PklProject file.")
|
||||||
@@ -33,7 +33,7 @@ class CliProjectPackager(
|
|||||||
private val skipPublishCheck: Boolean,
|
private val skipPublishCheck: Boolean,
|
||||||
private val consoleWriter: Writer = System.out.writer(),
|
private val consoleWriter: Writer = System.out.writer(),
|
||||||
private val errWriter: Writer = System.err.writer()
|
private val errWriter: Writer = System.err.writer()
|
||||||
) : CliAbstractProjectCommand(baseOptions, projectDirs) {
|
) : CliProjectCommand(baseOptions, projectDirs) {
|
||||||
|
|
||||||
private fun runApiTests(project: Project) {
|
private fun runApiTests(project: Project) {
|
||||||
val apiTests = project.`package`!!.apiTests
|
val apiTests = project.`package`!!.apiTests
|
||||||
@@ -82,6 +82,7 @@ class CliProjectPackager(
|
|||||||
outputPath,
|
outputPath,
|
||||||
stackFrameTransformer,
|
stackFrameTransformer,
|
||||||
securityManager,
|
securityManager,
|
||||||
|
httpClient,
|
||||||
skipPublishCheck,
|
skipPublishCheck,
|
||||||
consoleWriter
|
consoleWriter
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class CliProjectResolver(
|
|||||||
projectDirs: List<Path>,
|
projectDirs: List<Path>,
|
||||||
private val consoleWriter: Writer = System.out.writer(),
|
private val consoleWriter: Writer = System.out.writer(),
|
||||||
private val errWriter: Writer = System.err.writer()
|
private val errWriter: Writer = System.err.writer()
|
||||||
) : CliAbstractProjectCommand(baseOptions, projectDirs) {
|
) : CliProjectCommand(baseOptions, projectDirs) {
|
||||||
override fun doRun() {
|
override fun doRun() {
|
||||||
for (projectFile in normalizedProjectFiles) {
|
for (projectFile in normalizedProjectFiles) {
|
||||||
val project = loadProject(projectFile)
|
val project = loadProject(projectFile)
|
||||||
@@ -40,6 +40,7 @@ class CliProjectResolver(
|
|||||||
SecurityManagers.defaultTrustLevels,
|
SecurityManagers.defaultTrustLevels,
|
||||||
rootDir
|
rootDir
|
||||||
),
|
),
|
||||||
|
httpClient,
|
||||||
moduleCacheDir
|
moduleCacheDir
|
||||||
)
|
)
|
||||||
val dependencies = ProjectDependenciesResolver(project, packageResolver, errWriter).resolve()
|
val dependencies = ProjectDependenciesResolver(project, packageResolver, errWriter).resolve()
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ internal class CliRepl(private val options: CliEvaluatorOptions) : CliCommand(op
|
|||||||
SecurityManagers.defaultTrustLevels,
|
SecurityManagers.defaultTrustLevels,
|
||||||
rootDir
|
rootDir
|
||||||
),
|
),
|
||||||
|
httpClient,
|
||||||
Loggers.stdErr(),
|
Loggers.stdErr(),
|
||||||
listOf(
|
listOf(
|
||||||
ModuleKeyFactories.standardLibrary,
|
ModuleKeyFactories.standardLibrary,
|
||||||
@@ -44,6 +45,7 @@ internal class CliRepl(private val options: CliEvaluatorOptions) : CliCommand(op
|
|||||||
ModuleKeyFactories.fromServiceProviders() +
|
ModuleKeyFactories.fromServiceProviders() +
|
||||||
listOf(
|
listOf(
|
||||||
ModuleKeyFactories.file,
|
ModuleKeyFactories.file,
|
||||||
|
ModuleKeyFactories.http,
|
||||||
ModuleKeyFactories.pkg,
|
ModuleKeyFactories.pkg,
|
||||||
ModuleKeyFactories.projectpackage,
|
ModuleKeyFactories.projectpackage,
|
||||||
ModuleKeyFactories.genericUrl
|
ModuleKeyFactories.genericUrl
|
||||||
|
|||||||
@@ -19,37 +19,23 @@ package org.pkl.cli
|
|||||||
|
|
||||||
import com.github.ajalt.clikt.core.subcommands
|
import com.github.ajalt.clikt.core.subcommands
|
||||||
import org.pkl.cli.commands.*
|
import org.pkl.cli.commands.*
|
||||||
import org.pkl.commons.cli.CliMain
|
|
||||||
import org.pkl.commons.cli.cliMain
|
import org.pkl.commons.cli.cliMain
|
||||||
import org.pkl.core.Release
|
import org.pkl.core.Release
|
||||||
|
|
||||||
/** Main method of the Pkl CLI (command-line evaluator and REPL). */
|
/** Main method of the Pkl CLI (command-line evaluator and REPL). */
|
||||||
internal fun main(args: Array<String>) {
|
internal fun main(args: Array<String>) {
|
||||||
val version = Release.current().versionInfo()
|
|
||||||
val helpLink = "${Release.current().documentation().homepage()}pkl-cli/index.html#usage"
|
|
||||||
val commands =
|
|
||||||
arrayOf(
|
|
||||||
EvalCommand(helpLink),
|
|
||||||
ReplCommand(helpLink),
|
|
||||||
ServerCommand(helpLink),
|
|
||||||
TestCommand(helpLink),
|
|
||||||
ProjectCommand(helpLink),
|
|
||||||
DownloadPackageCommand(helpLink)
|
|
||||||
)
|
|
||||||
val cmd = RootCommand("pkl", version, helpLink).subcommands(*commands)
|
|
||||||
cliMain {
|
cliMain {
|
||||||
if (CliMain.compat == "alpine") {
|
val version = Release.current().versionInfo()
|
||||||
// Alpine's main thread has a prohibitively small stack size by default;
|
val helpLink = "${Release.current().documentation().homepage()}pkl-cli/index.html#usage"
|
||||||
// https://github.com/oracle/graal/issues/3398
|
RootCommand("pkl", version, helpLink)
|
||||||
var throwable: Throwable? = null
|
.subcommands(
|
||||||
Thread(null, { cmd.main(args) }, "alpineMain", 10000000).apply {
|
EvalCommand(helpLink),
|
||||||
setUncaughtExceptionHandler { _, t -> throwable = t }
|
ReplCommand(helpLink),
|
||||||
start()
|
ServerCommand(helpLink),
|
||||||
join()
|
TestCommand(helpLink),
|
||||||
}
|
ProjectCommand(helpLink),
|
||||||
throwable?.let { throw it }
|
DownloadPackageCommand(helpLink)
|
||||||
} else {
|
)
|
||||||
cmd.main(args)
|
.main(args)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import com.github.ajalt.clikt.parameters.arguments.multiple
|
|||||||
import com.github.ajalt.clikt.parameters.groups.provideDelegate
|
import com.github.ajalt.clikt.parameters.groups.provideDelegate
|
||||||
import com.github.ajalt.clikt.parameters.options.flag
|
import com.github.ajalt.clikt.parameters.options.flag
|
||||||
import com.github.ajalt.clikt.parameters.options.option
|
import com.github.ajalt.clikt.parameters.options.option
|
||||||
import org.pkl.cli.CliDownloadPackageCommand
|
import org.pkl.cli.CliPackageDownloader
|
||||||
import org.pkl.commons.cli.commands.BaseCommand
|
import org.pkl.commons.cli.commands.BaseCommand
|
||||||
import org.pkl.commons.cli.commands.ProjectOptions
|
import org.pkl.commons.cli.commands.ProjectOptions
|
||||||
import org.pkl.commons.cli.commands.single
|
import org.pkl.commons.cli.commands.single
|
||||||
@@ -62,7 +62,7 @@ class DownloadPackageCommand(helpLink: String) :
|
|||||||
.flag()
|
.flag()
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions.baseOptions(emptyList(), projectOptions),
|
baseOptions.baseOptions(emptyList(), projectOptions),
|
||||||
packageUris,
|
packageUris,
|
||||||
noTransitive
|
noTransitive
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class ProjectCommand(helpLink: String) :
|
|||||||
This command runs a project's api tests, as defined by `apiTests` in `PklProject`.
|
This command runs a project's api tests, as defined by `apiTests` in `PklProject`.
|
||||||
Additionally, it verifies that all imports resolve to paths that are local to the project.
|
Additionally, it verifies that all imports resolve to paths that are local to the project.
|
||||||
|
|
||||||
Finally, this command writes the folowing artifacts into the output directory specified by the output path.
|
Finally, this command writes the following artifacts into the output directory specified by the output path.
|
||||||
|
|
||||||
- `name@version` - dependency metadata$NEWLINE
|
- `name@version` - dependency metadata$NEWLINE
|
||||||
- `name@version.sha256` - dependency metadata's SHA-256 checksum$NEWLINE
|
- `name@version.sha256` - dependency metadata's SHA-256 checksum$NEWLINE
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.github.ajalt.clikt.parameters.groups.provideDelegate
|
|||||||
import java.net.URI
|
import java.net.URI
|
||||||
import org.pkl.cli.CliTestRunner
|
import org.pkl.cli.CliTestRunner
|
||||||
import org.pkl.commons.cli.commands.BaseCommand
|
import org.pkl.commons.cli.commands.BaseCommand
|
||||||
|
import org.pkl.commons.cli.commands.BaseOptions
|
||||||
import org.pkl.commons.cli.commands.ProjectOptions
|
import org.pkl.commons.cli.commands.ProjectOptions
|
||||||
import org.pkl.commons.cli.commands.TestOptions
|
import org.pkl.commons.cli.commands.TestOptions
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ class TestCommand(helpLink: String) :
|
|||||||
BaseCommand(name = "test", help = "Run tests within the given module(s)", helpLink = helpLink) {
|
BaseCommand(name = "test", help = "Run tests within the given module(s)", helpLink = helpLink) {
|
||||||
val modules: List<URI> by
|
val modules: List<URI> by
|
||||||
argument(name = "<modules>", help = "Module paths or URIs to evaluate.")
|
argument(name = "<modules>", help = "Module paths or URIs to evaluate.")
|
||||||
.convert { parseModuleName(it) }
|
.convert { BaseOptions.parseModuleName(it) }
|
||||||
.multiple()
|
.multiple()
|
||||||
|
|
||||||
private val projectOptions by ProjectOptions()
|
private val projectOptions by ProjectOptions()
|
||||||
|
|||||||
+1
-1
@@ -2,6 +2,6 @@ amends "pkl:Project"
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,38 +15,59 @@
|
|||||||
*/
|
*/
|
||||||
package org.pkl.cli
|
package org.pkl.cli
|
||||||
|
|
||||||
|
import com.github.tomakehurst.wiremock.client.WireMock.*
|
||||||
|
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo
|
||||||
|
import com.github.tomakehurst.wiremock.junit5.WireMockTest
|
||||||
import java.io.StringReader
|
import java.io.StringReader
|
||||||
import java.io.StringWriter
|
import java.io.StringWriter
|
||||||
|
import java.net.ServerSocket
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import kotlin.io.path.createDirectories
|
import java.util.regex.Pattern
|
||||||
import kotlin.io.path.listDirectoryEntries
|
import kotlin.io.path.*
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.assertj.core.api.Assertions.assertThatCode
|
import org.assertj.core.api.Assertions.assertThatCode
|
||||||
|
import org.junit.jupiter.api.AfterAll
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
|
import org.junit.jupiter.api.Disabled
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.assertThrows
|
import org.junit.jupiter.api.assertThrows
|
||||||
|
import org.junit.jupiter.api.condition.DisabledOnOs
|
||||||
|
import org.junit.jupiter.api.condition.EnabledOnOs
|
||||||
|
import org.junit.jupiter.api.condition.OS
|
||||||
|
import org.junit.jupiter.api.io.TempDir
|
||||||
import org.junit.jupiter.params.ParameterizedTest
|
import org.junit.jupiter.params.ParameterizedTest
|
||||||
import org.junit.jupiter.params.provider.EnumSource
|
import org.junit.jupiter.params.provider.EnumSource
|
||||||
import org.pkl.commons.*
|
import org.pkl.commons.*
|
||||||
import org.pkl.commons.cli.CliBaseOptions
|
import org.pkl.commons.cli.CliBaseOptions
|
||||||
import org.pkl.commons.cli.CliException
|
import org.pkl.commons.cli.CliException
|
||||||
import org.pkl.commons.cli.commands.BaseOptions
|
|
||||||
import org.pkl.commons.test.FileTestUtils
|
import org.pkl.commons.test.FileTestUtils
|
||||||
import org.pkl.commons.test.PackageServer
|
import org.pkl.commons.test.PackageServer
|
||||||
import org.pkl.core.OutputFormat
|
import org.pkl.core.OutputFormat
|
||||||
|
import org.pkl.core.SecurityManagers
|
||||||
import org.pkl.core.util.IoUtils
|
import org.pkl.core.util.IoUtils
|
||||||
|
|
||||||
|
@WireMockTest(httpsEnabled = true, proxyMode = true)
|
||||||
class CliEvaluatorTest {
|
class CliEvaluatorTest {
|
||||||
companion object {
|
companion object {
|
||||||
const val defaultContents = """
|
private val defaultContents =
|
||||||
person {
|
"""
|
||||||
name = "pigeon"
|
person {
|
||||||
age = 20 + 10
|
name = "pigeon"
|
||||||
}
|
age = 20 + 10
|
||||||
|
}
|
||||||
"""
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
|
||||||
|
private val packageServer = PackageServer()
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
@JvmStatic
|
||||||
|
fun afterAll() {
|
||||||
|
packageServer.close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// use manually constructed temp dir instead of @TempDir to work around
|
// use manually constructed temp dir instead of @TempDir to work around
|
||||||
@@ -414,7 +435,10 @@ result = someLib.x
|
|||||||
checkOutputFile(outputFiles[0], "result.pcf", contents)
|
checkOutputFile(outputFiles[0], "result.pcf", contents)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Can't reliably create symlinks on Windows.
|
||||||
|
// Might get errors like "A required privilege is not held by the client".
|
||||||
@Test
|
@Test
|
||||||
|
@DisabledOnOs(OS.WINDOWS)
|
||||||
fun `moduleDir is relative to workingDir even through symlinks`() {
|
fun `moduleDir is relative to workingDir even through symlinks`() {
|
||||||
val contents = "foo = 42"
|
val contents = "foo = 42"
|
||||||
val realWorkingDir = tempDir.resolve("workingDir").createDirectories()
|
val realWorkingDir = tempDir.resolve("workingDir").createDirectories()
|
||||||
@@ -968,6 +992,56 @@ result = someLib.x
|
|||||||
.hasMessageContaining("resolve to the same file path")
|
.hasMessageContaining("resolve to the same file path")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@EnabledOnOs(OS.WINDOWS)
|
||||||
|
fun `multiple-file output throws when using invalid Windows characters`() {
|
||||||
|
val moduleUri =
|
||||||
|
writePklFile(
|
||||||
|
"test.pkl",
|
||||||
|
"""
|
||||||
|
output {
|
||||||
|
files {
|
||||||
|
["foo:bar"] { text = "bar" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(sourceModules = listOf(moduleUri), workingDir = tempDir),
|
||||||
|
multipleFileOutputPath = ".output"
|
||||||
|
)
|
||||||
|
assertThatCode { evalToConsole(options) }
|
||||||
|
.hasMessageContaining("Path spec `foo:bar` contains illegal character `:`.")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@EnabledOnOs(OS.WINDOWS)
|
||||||
|
fun `multiple-file output - cannot use backslash as dir separator on Windows`() {
|
||||||
|
val moduleUri =
|
||||||
|
writePklFile(
|
||||||
|
"test.pkl",
|
||||||
|
"""
|
||||||
|
output {
|
||||||
|
files {
|
||||||
|
["foo\\bar"] { text = "bar" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(sourceModules = listOf(moduleUri), workingDir = tempDir),
|
||||||
|
multipleFileOutputPath = ".output"
|
||||||
|
)
|
||||||
|
assertThatCode { evalToConsole(options) }
|
||||||
|
.hasMessageContaining("Path spec `foo\\bar` contains illegal character `\\`.")
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `evaluate output expression`() {
|
fun `evaluate output expression`() {
|
||||||
val moduleUri =
|
val moduleUri =
|
||||||
@@ -1118,12 +1192,11 @@ result = someLib.x
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `setting noCache will skip writing to the cache dir`() {
|
fun `setting noCache will skip writing to the cache dir`() {
|
||||||
PackageServer.ensureStarted()
|
|
||||||
val moduleUri =
|
val moduleUri =
|
||||||
writePklFile(
|
writePklFile(
|
||||||
"test.pkl",
|
"test.pkl",
|
||||||
"""
|
"""
|
||||||
import "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
import "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||||
|
|
||||||
res = Swallow
|
res = Swallow
|
||||||
"""
|
"""
|
||||||
@@ -1137,7 +1210,8 @@ result = someLib.x
|
|||||||
workingDir = tempDir,
|
workingDir = tempDir,
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
noCache = true,
|
noCache = true,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
CliEvaluator(options, consoleWriter = buffer).run()
|
CliEvaluator(options, consoleWriter = buffer).run()
|
||||||
@@ -1154,36 +1228,257 @@ result = someLib.x
|
|||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
)
|
)
|
||||||
assertThat(tempDir.resolve("package-1")).doesNotExist()
|
assertThat(tempDir.resolve("package-2")).doesNotExist()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `not including the self signed certificate will result in a error`() {
|
fun `gives decent error message if certificate file contains random text`() {
|
||||||
PackageServer.ensureStarted()
|
val certsFile = tempDir.writeFile("random.pem", "RANDOM")
|
||||||
|
val err = assertThrows<CliException> { evalModuleThatImportsPackage(certsFile) }
|
||||||
|
assertThat(err)
|
||||||
|
.hasMessageContaining("Error parsing CA certificate file `${certsFile.pathString}`:")
|
||||||
|
.hasMessageContaining("No certificate data found")
|
||||||
|
.hasMessageNotContainingAny("java.", "sun.") // class names have been filtered out
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `gives decent error message if certificate file is emtpy`(@TempDir tempDir: Path) {
|
||||||
|
val emptyCerts = tempDir.writeEmptyFile("empty.pem")
|
||||||
|
val err = assertThrows<CliException> { evalModuleThatImportsPackage(emptyCerts) }
|
||||||
|
assertThat(err).hasMessageContaining("CA certificate file `${emptyCerts.pathString}` is empty.")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `gives decent error message if certificate cannot be parsed`(@TempDir tempDir: Path) {
|
||||||
|
val invalidCerts = FileTestUtils.writeCertificateWithMissingLines(tempDir)
|
||||||
|
val err = assertThrows<CliException> { evalModuleThatImportsPackage(invalidCerts) }
|
||||||
|
assertThat(err)
|
||||||
|
// no assert for detail message because it differs between JDK implementations
|
||||||
|
.hasMessageContaining("Error parsing CA certificate file `${invalidCerts.pathString}`:")
|
||||||
|
.hasMessageNotContainingAny("java.", "sun.") // class names have been filtered out
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `gives decent error message if CLI doesn't have the required CA certificate`() {
|
||||||
|
val err = assertThrows<CliException> { evalModuleThatImportsPackage(null, packageServer.port) }
|
||||||
|
assertThat(err)
|
||||||
|
.hasMessageContaining("Error during SSL handshake with host `localhost`:")
|
||||||
|
.hasMessageContaining("unable to find valid certification path to requested target")
|
||||||
|
.hasMessageNotContainingAny("java.", "sun.") // class names have been filtered out
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `eval http module from proxy`(wwRuntimeInfo: WireMockRuntimeInfo) {
|
||||||
|
stubFor(
|
||||||
|
get(urlEqualTo("/bar.pkl")).withHost(equalTo("not.a.valid.host")).willReturn(ok("foo = 1"))
|
||||||
|
)
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(
|
||||||
|
sourceModules = listOf(URI("http://not.a.valid.host/bar.pkl")),
|
||||||
|
httpProxy = URI("http://localhost:${wwRuntimeInfo.httpPort}"),
|
||||||
|
allowedModules = SecurityManagers.defaultAllowedModules + Pattern.compile("http:"),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
val output = evalToConsole(options)
|
||||||
|
assertThat(output).isEqualTo("foo = 1\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `eval https -- no proxy`(wwRuntimeInfo: WireMockRuntimeInfo) {
|
||||||
|
// pick an address on the local machine so we can be sure this test is not making any outbound
|
||||||
|
// connections.
|
||||||
|
val openPort = ServerSocket(0).use { it.localPort }
|
||||||
|
val targetAddress = "https://127.0.0.1:$openPort"
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(
|
||||||
|
// use loopback address to prevent test from making outbound http connection.
|
||||||
|
sourceModules = listOf(URI("$targetAddress/foo.pkl")),
|
||||||
|
httpProxy = URI(wwRuntimeInfo.httpBaseUrl),
|
||||||
|
httpNoProxy = listOf("*"),
|
||||||
|
allowedModules = SecurityManagers.defaultAllowedModules + Pattern.compile("http:"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
assertThatCode { evalToConsole(options) }
|
||||||
|
.hasMessageContaining("I/O error loading module `$targetAddress/foo.pkl`")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Disabled // TODO: figure out why this is failing.
|
||||||
|
fun `eval package from proxy`(wwRuntimeInfo: WireMockRuntimeInfo) {
|
||||||
|
stubFor(
|
||||||
|
any(anyUrl()).willReturn(aResponse().proxiedFrom("https://localhost:${packageServer.port}"))
|
||||||
|
)
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(
|
||||||
|
sourceModules = listOf(URI("package://localhost:1/birds@0.5.0#/catalog/Ostritch.pkl")),
|
||||||
|
noCache = true,
|
||||||
|
httpProxy = URI(wwRuntimeInfo.httpBaseUrl),
|
||||||
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
allowedModules = SecurityManagers.defaultAllowedModules + Pattern.compile("http:")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
val output = evalToConsole(options)
|
||||||
|
assertThat(output)
|
||||||
|
.isEqualTo(
|
||||||
|
"""
|
||||||
|
name = "Ostritch"
|
||||||
|
|
||||||
|
favoriteFruit {
|
||||||
|
name = "Orange"
|
||||||
|
}
|
||||||
|
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
verify(getRequestedFor(urlEqualTo("birds@0.5.0")))
|
||||||
|
verify(getRequestedFor(urlEqualTo("fruit@1.0.5")))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `eval http module from proxy -- configured in settings`(
|
||||||
|
@TempDir tempDir: Path,
|
||||||
|
wwRuntimeInfo: WireMockRuntimeInfo
|
||||||
|
) {
|
||||||
|
val settingsModule =
|
||||||
|
tempDir.writeFile(
|
||||||
|
"settings.pkl",
|
||||||
|
"""
|
||||||
|
amends "pkl:settings"
|
||||||
|
|
||||||
|
http {
|
||||||
|
proxy {
|
||||||
|
address = "${wwRuntimeInfo.httpBaseUrl}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
stubFor(
|
||||||
|
get(urlEqualTo("/bar.pkl")).withHost(equalTo("not.a.valid.host")).willReturn(ok("foo = 1"))
|
||||||
|
)
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(
|
||||||
|
sourceModules = listOf(URI("http://not.a.valid.host/bar.pkl")),
|
||||||
|
settings = settingsModule.toUri(),
|
||||||
|
allowedModules = SecurityManagers.defaultAllowedModules + Pattern.compile("http:"),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
val output = evalToConsole(options)
|
||||||
|
assertThat(output).isEqualTo("foo = 1\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `eval http module from proxy -- configured in PklProject`(
|
||||||
|
@TempDir tempDir: Path,
|
||||||
|
wwRuntimeInfo: WireMockRuntimeInfo
|
||||||
|
) {
|
||||||
|
tempDir.writeFile(
|
||||||
|
"PklProject",
|
||||||
|
"""
|
||||||
|
amends "pkl:Project"
|
||||||
|
|
||||||
|
evaluatorSettings {
|
||||||
|
http {
|
||||||
|
proxy {
|
||||||
|
address = "${wwRuntimeInfo.httpBaseUrl}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
stubFor(
|
||||||
|
get(urlEqualTo("/bar.pkl")).withHost(equalTo("not.a.valid.host")).willReturn(ok("foo = 1"))
|
||||||
|
)
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(
|
||||||
|
sourceModules = listOf(URI("http://not.a.valid.host/bar.pkl")),
|
||||||
|
allowedModules = SecurityManagers.defaultAllowedModules + Pattern.compile("http:"),
|
||||||
|
projectDir = tempDir
|
||||||
|
),
|
||||||
|
)
|
||||||
|
val output = evalToConsole(options)
|
||||||
|
assertThat(output).isEqualTo("foo = 1\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `eval http module from proxy -- PklProject beats user settings`(
|
||||||
|
@TempDir tempDir: Path,
|
||||||
|
wwRuntimeInfo: WireMockRuntimeInfo
|
||||||
|
) {
|
||||||
|
val projectDir = tempDir.resolve("my-project")
|
||||||
|
projectDir.writeFile(
|
||||||
|
"PklProject",
|
||||||
|
"""
|
||||||
|
amends "pkl:Project"
|
||||||
|
|
||||||
|
evaluatorSettings {
|
||||||
|
http {
|
||||||
|
proxy {
|
||||||
|
address = "${wwRuntimeInfo.httpBaseUrl}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
val homeDir = tempDir.resolve("my-home")
|
||||||
|
homeDir.writeFile(
|
||||||
|
"settings.pkl",
|
||||||
|
"""
|
||||||
|
amends "pkl:settings"
|
||||||
|
|
||||||
|
http {
|
||||||
|
proxy {
|
||||||
|
address = "http://invalid.proxy.address"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
val options =
|
||||||
|
CliEvaluatorOptions(
|
||||||
|
CliBaseOptions(
|
||||||
|
sourceModules = listOf(URI("http://not.a.valid.host/bar.pkl")),
|
||||||
|
allowedModules = SecurityManagers.defaultAllowedModules + Pattern.compile("http:"),
|
||||||
|
projectDir = projectDir,
|
||||||
|
settings = homeDir.resolve("settings.pkl").toUri()
|
||||||
|
),
|
||||||
|
)
|
||||||
|
stubFor(get(anyUrl()).willReturn(ok("result = 1")))
|
||||||
|
val output = evalToConsole(options)
|
||||||
|
assertThat(output).isEqualTo("result = 1\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun evalModuleThatImportsPackage(certsFile: Path?, testPort: Int = -1) {
|
||||||
val moduleUri =
|
val moduleUri =
|
||||||
writePklFile(
|
writePklFile(
|
||||||
"test.pkl",
|
"test.pkl",
|
||||||
"""
|
"""
|
||||||
import "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
import "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||||
|
|
||||||
res = Swallow
|
res = Swallow
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
|
||||||
)
|
)
|
||||||
val buffer = StringWriter()
|
|
||||||
val options =
|
val options =
|
||||||
CliEvaluatorOptions(
|
CliEvaluatorOptions(
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
sourceModules = listOf(moduleUri),
|
sourceModules = listOf(moduleUri),
|
||||||
|
caCertificates = buildList { if (certsFile != null) add(certsFile) },
|
||||||
workingDir = tempDir,
|
workingDir = tempDir,
|
||||||
moduleCacheDir = tempDir,
|
|
||||||
noCache = true,
|
noCache = true,
|
||||||
// ensure we override any previously set root cert to the default buundle.
|
testPort = testPort
|
||||||
caCertificates = listOf(BaseOptions.Companion.includedCARootCerts())
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val err = assertThrows<CliException> { CliEvaluator(options, consoleWriter = buffer).run() }
|
CliEvaluator(options).run()
|
||||||
assertThat(err.message).contains("unable to find valid certification path to requested target")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun writePklFile(fileName: String, contents: String = defaultContents): URI {
|
private fun writePklFile(fileName: String, contents: String = defaultContents): URI {
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import org.assertj.core.api.Assertions.assertThat
|
|||||||
import org.assertj.core.api.AssertionsForClassTypes.assertThatCode
|
import org.assertj.core.api.AssertionsForClassTypes.assertThatCode
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.assertThrows
|
import org.junit.jupiter.api.assertThrows
|
||||||
|
import org.junit.jupiter.api.condition.DisabledOnOs
|
||||||
|
import org.junit.jupiter.api.condition.OS
|
||||||
import org.junit.jupiter.api.io.TempDir
|
import org.junit.jupiter.api.io.TempDir
|
||||||
import org.pkl.cli.commands.EvalCommand
|
import org.pkl.cli.commands.EvalCommand
|
||||||
import org.pkl.cli.commands.RootCommand
|
import org.pkl.cli.commands.RootCommand
|
||||||
@@ -35,7 +37,7 @@ class CliMainTest {
|
|||||||
private val cmd = RootCommand("pkl", "pkl version 1", "").subcommands(evalCmd)
|
private val cmd = RootCommand("pkl", "pkl version 1", "").subcommands(evalCmd)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `duplicate CLI option produces meaningful errror message`(@TempDir tempDir: Path) {
|
fun `duplicate CLI option produces meaningful error message`(@TempDir tempDir: Path) {
|
||||||
val inputFile = tempDir.resolve("test.pkl").writeString("").toString()
|
val inputFile = tempDir.resolve("test.pkl").writeString("").toString()
|
||||||
|
|
||||||
assertThatCode {
|
assertThatCode {
|
||||||
@@ -54,7 +56,10 @@ class CliMainTest {
|
|||||||
assertThatCode { cmd.parse(arrayOf("eval")) }.hasMessage("""Missing argument "<modules>"""")
|
assertThatCode { cmd.parse(arrayOf("eval")) }.hasMessage("""Missing argument "<modules>"""")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Can't reliably create symlinks on Windows.
|
||||||
|
// Might get errors like "A required privilege is not held by the client".
|
||||||
@Test
|
@Test
|
||||||
|
@DisabledOnOs(OS.WINDOWS)
|
||||||
fun `output to symlinked directory works`(@TempDir tempDir: Path) {
|
fun `output to symlinked directory works`(@TempDir tempDir: Path) {
|
||||||
val code =
|
val code =
|
||||||
"""
|
"""
|
||||||
|
|||||||
+71
-64
@@ -18,7 +18,7 @@ package org.pkl.cli
|
|||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.assertj.core.api.Assertions.assertThatCode
|
import org.assertj.core.api.Assertions.assertThatCode
|
||||||
import org.junit.jupiter.api.BeforeAll
|
import org.junit.jupiter.api.AfterAll
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.io.TempDir
|
import org.junit.jupiter.api.io.TempDir
|
||||||
import org.pkl.commons.cli.CliBaseOptions
|
import org.pkl.commons.cli.CliBaseOptions
|
||||||
@@ -26,39 +26,42 @@ import org.pkl.commons.test.FileTestUtils
|
|||||||
import org.pkl.commons.test.PackageServer
|
import org.pkl.commons.test.PackageServer
|
||||||
import org.pkl.core.packages.PackageUri
|
import org.pkl.core.packages.PackageUri
|
||||||
|
|
||||||
class CliDownloadPackageCommandTest {
|
class CliPackageDownloaderTest {
|
||||||
companion object {
|
companion object {
|
||||||
@BeforeAll
|
val server = PackageServer()
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun beforeAll() {
|
fun afterAll() {
|
||||||
PackageServer.ensureStarted()
|
server.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `download packages`(@TempDir tempDir: Path) {
|
fun `download packages`(@TempDir tempDir: Path) {
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris =
|
packageUris =
|
||||||
listOf(
|
listOf(
|
||||||
PackageUri("package://localhost:12110/birds@0.5.0"),
|
PackageUri("package://localhost:0/birds@0.5.0"),
|
||||||
PackageUri("package://localhost:12110/fruit@1.0.5"),
|
PackageUri("package://localhost:0/fruit@1.0.5"),
|
||||||
PackageUri("package://localhost:12110/fruit@1.1.0")
|
PackageUri("package://localhost:0/fruit@1.1.0")
|
||||||
),
|
),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
cmd.run()
|
cmd.run()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.1.0/fruit@1.1.0.zip")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/fruit@1.1.0/fruit@1.1.0.zip")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.1.0/fruit@1.1.0.json")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/fruit@1.1.0/fruit@1.1.0.json")).exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -76,79 +79,80 @@ class CliDownloadPackageCommandTest {
|
|||||||
)
|
)
|
||||||
|
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
workingDir = tempDir,
|
workingDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
|
packageUris = listOf(PackageUri("package://localhost:0/birds@0.5.0")),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
cmd.run()
|
cmd.run()
|
||||||
assertThat(tempDir.resolve(".my-cache/package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip"))
|
assertThat(tempDir.resolve(".my-cache/package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.zip"))
|
||||||
.exists()
|
.exists()
|
||||||
assertThat(tempDir.resolve(".my-cache/package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json"))
|
assertThat(tempDir.resolve(".my-cache/package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.json"))
|
||||||
.exists()
|
.exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `download package while specifying checksum`(@TempDir tempDir: Path) {
|
fun `download package while specifying checksum`(@TempDir tempDir: Path) {
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris =
|
packageUris =
|
||||||
listOf(
|
listOf(
|
||||||
PackageUri(
|
PackageUri("package://localhost:0/birds@0.5.0::sha256:${PackageServer.BIRDS_SHA}"),
|
||||||
"package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
cmd.run()
|
cmd.run()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `download package with invalid checksum`(@TempDir tempDir: Path) {
|
fun `download package with invalid checksum`(@TempDir tempDir: Path) {
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris =
|
packageUris =
|
||||||
listOf(
|
listOf(
|
||||||
PackageUri("package://localhost:12110/birds@0.5.0::sha256:intentionallyBogusChecksum"),
|
PackageUri("package://localhost:0/birds@0.5.0::sha256:intentionallyBogusChecksum"),
|
||||||
),
|
),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
assertThatCode { cmd.run() }
|
assertThatCode { cmd.run() }
|
||||||
.hasMessage(
|
.hasMessage(
|
||||||
"""
|
"""
|
||||||
Cannot download package `package://localhost:12110/birds@0.5.0` because the computed checksum for package metadata does not match the expected checksum.
|
Cannot download package `package://localhost:0/birds@0.5.0` because the computed checksum for package metadata does not match the expected checksum.
|
||||||
|
|
||||||
Computed checksum: "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
Computed checksum: "${PackageServer.BIRDS_SHA}"
|
||||||
Expected checksum: "intentionallyBogusChecksum"
|
Expected checksum: "intentionallyBogusChecksum"
|
||||||
Asset URL: "https://localhost:12110/birds@0.5.0"
|
Asset URL: "https://localhost:0/birds@0.5.0"
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `disabling cacheing is an error`(@TempDir tempDir: Path) {
|
fun `disabling caching is an error`(@TempDir tempDir: Path) {
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions = CliBaseOptions(workingDir = tempDir, noCache = true),
|
baseOptions = CliBaseOptions(workingDir = tempDir, noCache = true),
|
||||||
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
|
packageUris = listOf(PackageUri("package://localhost:0/birds@0.5.0")),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
assertThatCode { cmd.run() }
|
assertThatCode { cmd.run() }
|
||||||
.hasMessage("Cannot download packages because no cache directory is specified.")
|
.hasMessage("Cannot download packages because no cache directory is specified.")
|
||||||
@@ -157,52 +161,54 @@ class CliDownloadPackageCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `download packages with bad checksum`(@TempDir tempDir: Path) {
|
fun `download packages with bad checksum`(@TempDir tempDir: Path) {
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris = listOf(PackageUri("package://localhost:12110/badChecksum@1.0.0")),
|
packageUris = listOf(PackageUri("package://localhost:0/badChecksum@1.0.0")),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
assertThatCode { cmd.run() }
|
assertThatCode { cmd.run() }
|
||||||
.hasMessageStartingWith(
|
.hasMessageStartingWith(
|
||||||
"Cannot download package `package://localhost:12110/badChecksum@1.0.0` because the computed checksum does not match the expected checksum."
|
"Cannot download package `package://localhost:0/badChecksum@1.0.0` because the computed checksum does not match the expected checksum."
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `download multiple failing packages`(@TempDir tempDir: Path) {
|
fun `download multiple failing packages`(@TempDir tempDir: Path) {
|
||||||
val cmd =
|
val cmd =
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris =
|
packageUris =
|
||||||
listOf(
|
listOf(
|
||||||
PackageUri("package://localhost:12110/badChecksum@1.0.0"),
|
PackageUri("package://localhost:0/badChecksum@1.0.0"),
|
||||||
PackageUri("package://bogus.domain/notAPackage@1.0.0")
|
PackageUri("package://bogus.domain/notAPackage@1.0.0")
|
||||||
),
|
),
|
||||||
noTranstive = true
|
noTransitive = true
|
||||||
)
|
)
|
||||||
assertThatCode { cmd.run() }
|
assertThatCode { cmd.run() }
|
||||||
.hasMessage(
|
.hasMessage(
|
||||||
"""
|
"""
|
||||||
Failed to download some packages.
|
Failed to download some packages.
|
||||||
|
|
||||||
Failed to download package://localhost:12110/badChecksum@1.0.0 because:
|
Failed to download package://localhost:0/badChecksum@1.0.0 because:
|
||||||
Cannot download package `package://localhost:12110/badChecksum@1.0.0` because the computed checksum does not match the expected checksum.
|
Cannot download package `package://localhost:0/badChecksum@1.0.0` because the computed checksum does not match the expected checksum.
|
||||||
|
|
||||||
Computed checksum: "0ec8a501e974802d0b71b8d58141e1e6eaa10bc2033e18200be3a978823d98aa"
|
Computed checksum: "a6bf858cdd1c09da475c2abe50525902580910ee5cc1ff624999170591bf8f69"
|
||||||
Expected checksum: "intentionally bogus checksum"
|
Expected checksum: "intentionally bogus checksum"
|
||||||
Asset URL: "https://localhost:12110/badChecksum@1.0.0/badChecksum@1.0.0.zip"
|
Asset URL: "https://localhost:0/badChecksum@1.0.0/badChecksum@1.0.0.zip"
|
||||||
|
|
||||||
Failed to download package://bogus.domain/notAPackage@1.0.0 because:
|
Failed to download package://bogus.domain/notAPackage@1.0.0 because:
|
||||||
Exception when making request `GET https://bogus.domain/notAPackage@1.0.0`:
|
Exception when making request `GET https://bogus.domain/notAPackage@1.0.0`:
|
||||||
bogus.domain
|
Error connecting to host `bogus.domain`.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
@@ -211,19 +217,20 @@ class CliDownloadPackageCommandTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `download package, including transitive dependencies`(@TempDir tempDir: Path) {
|
fun `download package, including transitive dependencies`(@TempDir tempDir: Path) {
|
||||||
CliDownloadPackageCommand(
|
CliPackageDownloader(
|
||||||
baseOptions =
|
baseOptions =
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
moduleCacheDir = tempDir,
|
moduleCacheDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = server.port
|
||||||
),
|
),
|
||||||
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
|
packageUris = listOf(PackageUri("package://localhost:0/birds@0.5.0")),
|
||||||
noTranstive = false
|
noTransitive = false
|
||||||
)
|
)
|
||||||
.run()
|
.run()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
||||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
assertThat(tempDir.resolve("package-2/localhost(3a)0/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.pkl.cli
|
package org.pkl.cli
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
import java.io.StringWriter
|
import java.io.StringWriter
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.nio.file.FileSystems
|
import java.nio.file.FileSystems
|
||||||
@@ -24,8 +25,11 @@ import java.util.stream.Collectors
|
|||||||
import kotlin.io.path.createDirectories
|
import kotlin.io.path.createDirectories
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.assertj.core.api.Assertions.assertThatCode
|
import org.assertj.core.api.Assertions.assertThatCode
|
||||||
|
import org.junit.jupiter.api.AfterAll
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.assertThrows
|
import org.junit.jupiter.api.assertThrows
|
||||||
|
import org.junit.jupiter.api.condition.DisabledOnOs
|
||||||
|
import org.junit.jupiter.api.condition.OS
|
||||||
import org.junit.jupiter.api.io.TempDir
|
import org.junit.jupiter.api.io.TempDir
|
||||||
import org.pkl.commons.cli.CliBaseOptions
|
import org.pkl.commons.cli.CliBaseOptions
|
||||||
import org.pkl.commons.cli.CliException
|
import org.pkl.commons.cli.CliException
|
||||||
@@ -34,9 +38,19 @@ import org.pkl.commons.readString
|
|||||||
import org.pkl.commons.test.FileTestUtils
|
import org.pkl.commons.test.FileTestUtils
|
||||||
import org.pkl.commons.test.PackageServer
|
import org.pkl.commons.test.PackageServer
|
||||||
import org.pkl.commons.writeString
|
import org.pkl.commons.writeString
|
||||||
import org.pkl.core.runtime.CertificateUtils
|
import org.pkl.core.util.IoUtils
|
||||||
|
|
||||||
class CliProjectPackagerTest {
|
class CliProjectPackagerTest {
|
||||||
|
companion object {
|
||||||
|
private val packageServer = PackageServer()
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
@JvmStatic
|
||||||
|
fun afterAll() {
|
||||||
|
packageServer.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `missing PklProject when inferring a project dir`(@TempDir tempDir: Path) {
|
fun `missing PklProject when inferring a project dir`(@TempDir tempDir: Path) {
|
||||||
val packager =
|
val packager =
|
||||||
@@ -52,7 +66,7 @@ class CliProjectPackagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `missing PklProject when explict dir is provided`(@TempDir tempDir: Path) {
|
fun `missing PklProject when explicit dir is provided`(@TempDir tempDir: Path) {
|
||||||
val packager =
|
val packager =
|
||||||
CliProjectPackager(
|
CliProjectPackager(
|
||||||
CliBaseOptions(workingDir = tempDir),
|
CliBaseOptions(workingDir = tempDir),
|
||||||
@@ -214,7 +228,7 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -227,18 +241,18 @@ class CliProjectPackagerTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "04eec465b217fb9779489525d26e9b587e5e47ff4d584c7673a450109715bc31"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,7 +336,7 @@ class CliProjectPackagerTest {
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"packageZipUrl": "https://foo.com",
|
"packageZipUrl": "https://foo.com",
|
||||||
"packageZipChecksums": {
|
"packageZipChecksums": {
|
||||||
"sha256": "7f515fbc4b229ba171fac78c7c3f2c2e68e2afebae8cfba042b12733943a2813"
|
"sha256": "e83b67722ea17ba41717ce6e99ae8ee02d66df6294bd319ce403075b1071c3e0"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"authors": []
|
"authors": []
|
||||||
@@ -334,9 +348,9 @@ class CliProjectPackagerTest {
|
|||||||
assertThat(expectedArchive.zipFilePaths())
|
assertThat(expectedArchive.zipFilePaths())
|
||||||
.hasSameElementsAs(listOf("/", "/c", "/c/d", "/c/d/foo.txt", "/a", "/a/b", "/a/b/foo.pkl"))
|
.hasSameElementsAs(listOf("/", "/c", "/c/d", "/c/d/foo.txt", "/a", "/a/b", "/a/b/foo.pkl"))
|
||||||
assertThat(expectedMetadataChecksum)
|
assertThat(expectedMetadataChecksum)
|
||||||
.hasContent("203ef387f217a3caee7f19819ef2b50926929269241cb7b3a29d95237b2c7f4b")
|
.hasContent("72ab32b27393bde5f316b00f184faae919378e4d7643872c605f681b14b647bf")
|
||||||
assertThat(expectedArchiveChecksum)
|
assertThat(expectedArchiveChecksum)
|
||||||
.hasContent("7f515fbc4b229ba171fac78c7c3f2c2e68e2afebae8cfba042b12733943a2813")
|
.hasContent("e83b67722ea17ba41717ce6e99ae8ee02d66df6294bd319ce403075b1071c3e0")
|
||||||
FileSystems.newFileSystem(URI("jar:" + expectedArchive.toUri()), mutableMapOf<String, String>())
|
FileSystems.newFileSystem(URI("jar:" + expectedArchive.toUri()), mutableMapOf<String, String>())
|
||||||
.use { fs ->
|
.use { fs ->
|
||||||
assertThat(fs.getPath("a/b/foo.pkl")).hasSameTextualContentAs(fooPkl)
|
assertThat(fs.getPath("a/b/foo.pkl")).hasSameTextualContentAs(fooPkl)
|
||||||
@@ -354,6 +368,10 @@ class CliProjectPackagerTest {
|
|||||||
writeEmptyFile("main.test.pkl")
|
writeEmptyFile("main.test.pkl")
|
||||||
writeEmptyFile("child/main.pkl")
|
writeEmptyFile("child/main.pkl")
|
||||||
writeEmptyFile("child/main.test.pkl")
|
writeEmptyFile("child/main.test.pkl")
|
||||||
|
writeEmptyFile("examples/Workflow.pkl")
|
||||||
|
writeEmptyFile("examples/Ex1.pkl")
|
||||||
|
writeEmptyFile("tests/Test1.pkl")
|
||||||
|
writeEmptyFile("tests/integration/TestIng1.pkl")
|
||||||
}
|
}
|
||||||
|
|
||||||
tempDir.writeFile(
|
tempDir.writeFile(
|
||||||
@@ -370,6 +388,8 @@ class CliProjectPackagerTest {
|
|||||||
"*.bin"
|
"*.bin"
|
||||||
"child/main.pkl"
|
"child/main.pkl"
|
||||||
"*.test.pkl"
|
"*.test.pkl"
|
||||||
|
"examples/Ex1.pkl"
|
||||||
|
"tests/**"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -389,14 +409,12 @@ class CliProjectPackagerTest {
|
|||||||
.hasSameElementsAs(
|
.hasSameElementsAs(
|
||||||
listOf(
|
listOf(
|
||||||
"/",
|
"/",
|
||||||
"/a",
|
"/examples",
|
||||||
"/a/b",
|
"/examples/Workflow.pkl",
|
||||||
"/a/b/c",
|
|
||||||
"/child",
|
|
||||||
"/input",
|
"/input",
|
||||||
"/input/foo",
|
"/input/foo",
|
||||||
"/input/foo/bar.txt",
|
"/input/foo/bar.txt",
|
||||||
"/main.pkl",
|
"/main.pkl"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -419,7 +437,7 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
["project2"] = import("../project2/PklProject")
|
["project2"] = import("../project2/PklProject")
|
||||||
}
|
}
|
||||||
@@ -432,16 +450,16 @@ class CliProjectPackagerTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/project2@5": {
|
"package://localhost:0/project2@5": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"uri": "projectpackage://localhost:12110/project2@5.0.0",
|
"uri": "projectpackage://localhost:0/project2@5.0.0",
|
||||||
"path": "../project2"
|
"path": "../project2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,7 +475,7 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
package {
|
package {
|
||||||
name = "project2"
|
name = "project2"
|
||||||
baseUri = "package://localhost:12110/project2"
|
baseUri = "package://localhost:0/project2"
|
||||||
version = "5.0.0"
|
version = "5.0.0"
|
||||||
packageZipUrl = "https://foo.com/project2.zip"
|
packageZipUrl = "https://foo.com/project2.zip"
|
||||||
}
|
}
|
||||||
@@ -495,19 +513,19 @@ class CliProjectPackagerTest {
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"packageZipUrl": "https://foo.com",
|
"packageZipUrl": "https://foo.com",
|
||||||
"packageZipChecksums": {
|
"packageZipChecksums": {
|
||||||
"sha256": "7d08a65078e0bfc382c16fe1bb94546ab9a11e6f551087f362a4515ca98102fc"
|
"sha256": "8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"birds": {
|
"birds": {
|
||||||
"uri": "package://localhost:12110/birds@0.5.0",
|
"uri": "package://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"project2": {
|
"project2": {
|
||||||
"uri": "package://localhost:12110/project2@5.0.0",
|
"uri": "package://localhost:0/project2@5.0.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "ddebb806e5b218ebb1a2baa14ad206b46e7a0c1585fa9863a486c75592bc8b16"
|
"sha256": "981787869571330b2f609a94a5912466990ce00e3fa94e7f290c2f99a6d5e5ed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -523,11 +541,11 @@ class CliProjectPackagerTest {
|
|||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"name": "project2",
|
"name": "project2",
|
||||||
"packageUri": "package://localhost:12110/project2@5.0.0",
|
"packageUri": "package://localhost:0/project2@5.0.0",
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"packageZipUrl": "https://foo.com/project2.zip",
|
"packageZipUrl": "https://foo.com/project2.zip",
|
||||||
"packageZipChecksums": {
|
"packageZipChecksums": {
|
||||||
"sha256": "7d08a65078e0bfc382c16fe1bb94546ab9a11e6f551087f362a4515ca98102fc"
|
"sha256": "8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"authors": []
|
"authors": []
|
||||||
@@ -557,7 +575,7 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
["project2"] = import("../project2/PklProject")
|
["project2"] = import("../project2/PklProject")
|
||||||
}
|
}
|
||||||
@@ -570,16 +588,16 @@ class CliProjectPackagerTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/project2@5": {
|
"package://localhost:0/project2@5": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"uri": "projectpackage://localhost:12110/project2@5.0.0",
|
"uri": "projectpackage://localhost:0/project2@5.0.0",
|
||||||
"path": "../project2"
|
"path": "../project2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -595,7 +613,7 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
package {
|
package {
|
||||||
name = "project2"
|
name = "project2"
|
||||||
baseUri = "package://localhost:12110/project2"
|
baseUri = "package://localhost:0/project2"
|
||||||
version = "5.0.0"
|
version = "5.0.0"
|
||||||
packageZipUrl = "https://foo.com/project2.zip"
|
packageZipUrl = "https://foo.com/project2.zip"
|
||||||
}
|
}
|
||||||
@@ -676,7 +694,11 @@ class CliProjectPackagerTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Absolute path imports on Windows must use an absolute URI (e.g. file:///C:/Foo/Bar), because
|
||||||
|
// they must contain drive letters, which conflict with schemes.
|
||||||
|
// We skip validation for absolute URIs, so effectively we skip this check on Windows.
|
||||||
@Test
|
@Test
|
||||||
|
@DisabledOnOs(OS.WINDOWS)
|
||||||
fun `import path verification -- absolute import from root dir`(@TempDir tempDir: Path) {
|
fun `import path verification -- absolute import from root dir`(@TempDir tempDir: Path) {
|
||||||
tempDir.writeFile(
|
tempDir.writeFile(
|
||||||
"main.pkl",
|
"main.pkl",
|
||||||
@@ -724,6 +746,7 @@ class CliProjectPackagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@DisabledOnOs(OS.WINDOWS)
|
||||||
fun `import path verification -- absolute read from root dir`(@TempDir tempDir: Path) {
|
fun `import path verification -- absolute read from root dir`(@TempDir tempDir: Path) {
|
||||||
tempDir.writeFile(
|
tempDir.writeFile(
|
||||||
"main.pkl",
|
"main.pkl",
|
||||||
@@ -844,17 +867,18 @@ class CliProjectPackagerTest {
|
|||||||
consoleWriter = out
|
consoleWriter = out
|
||||||
)
|
)
|
||||||
.run()
|
.run()
|
||||||
|
val sep = File.separatorChar
|
||||||
assertThat(out.toString())
|
assertThat(out.toString())
|
||||||
.isEqualTo(
|
.isEqualToNormalizingNewlines(
|
||||||
"""
|
"""
|
||||||
.out/project1@1.0.0/project1@1.0.0.zip
|
.out${sep}project1@1.0.0${sep}project1@1.0.0.zip
|
||||||
.out/project1@1.0.0/project1@1.0.0.zip.sha256
|
.out${sep}project1@1.0.0${sep}project1@1.0.0.zip.sha256
|
||||||
.out/project1@1.0.0/project1@1.0.0
|
.out${sep}project1@1.0.0${sep}project1@1.0.0
|
||||||
.out/project1@1.0.0/project1@1.0.0.sha256
|
.out${sep}project1@1.0.0${sep}project1@1.0.0.sha256
|
||||||
.out/project2@2.0.0/project2@2.0.0.zip
|
.out${sep}project2@2.0.0${sep}project2@2.0.0.zip
|
||||||
.out/project2@2.0.0/project2@2.0.0.zip.sha256
|
.out${sep}project2@2.0.0${sep}project2@2.0.0.zip.sha256
|
||||||
.out/project2@2.0.0/project2@2.0.0
|
.out${sep}project2@2.0.0${sep}project2@2.0.0
|
||||||
.out/project2@2.0.0/project2@2.0.0.sha256
|
.out${sep}project2@2.0.0${sep}project2@2.0.0.sha256
|
||||||
|
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
@@ -867,19 +891,17 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `publish checks`(@TempDir tempDir: Path) {
|
fun `publish checks`(@TempDir tempDir: Path) {
|
||||||
PackageServer.ensureStarted()
|
|
||||||
CertificateUtils.setupAllX509CertificatesGlobally(listOf(FileTestUtils.selfSignedCertificate))
|
|
||||||
tempDir.writeFile("project/main.pkl", "res = 1")
|
tempDir.writeFile("project/main.pkl", "res = 1")
|
||||||
tempDir.writeFile(
|
tempDir.writeFile(
|
||||||
"project/PklProject",
|
"project/PklProject",
|
||||||
// intentionally conflict with localhost:12110/birds@0.5.0 from our test fixtures
|
// intentionally conflict with localhost:0/birds@0.5.0 from our test fixtures
|
||||||
"""
|
"""
|
||||||
amends "pkl:Project"
|
amends "pkl:Project"
|
||||||
|
|
||||||
package {
|
package {
|
||||||
name = "birds"
|
name = "birds"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
baseUri = "package://localhost:12110/birds"
|
baseUri = "package://localhost:0/birds"
|
||||||
packageZipUrl = "https://foo.com"
|
packageZipUrl = "https://foo.com"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -888,7 +910,11 @@ class CliProjectPackagerTest {
|
|||||||
val e =
|
val e =
|
||||||
assertThrows<CliException> {
|
assertThrows<CliException> {
|
||||||
CliProjectPackager(
|
CliProjectPackager(
|
||||||
CliBaseOptions(workingDir = tempDir),
|
CliBaseOptions(
|
||||||
|
workingDir = tempDir,
|
||||||
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port
|
||||||
|
),
|
||||||
listOf(tempDir.resolve("project")),
|
listOf(tempDir.resolve("project")),
|
||||||
CliTestOptions(),
|
CliTestOptions(),
|
||||||
".out/%{name}@%{version}",
|
".out/%{name}@%{version}",
|
||||||
@@ -900,10 +926,10 @@ class CliProjectPackagerTest {
|
|||||||
assertThat(e)
|
assertThat(e)
|
||||||
.hasMessageStartingWith(
|
.hasMessageStartingWith(
|
||||||
"""
|
"""
|
||||||
Package `package://localhost:12110/birds@0.5.0` was already published with different contents.
|
Package `package://localhost:0/birds@0.5.0` was already published with different contents.
|
||||||
|
|
||||||
Computed checksum: 7324e17214b6dcda63ebfb57d5a29b077af785c13bed0dc22b5138628a3f8d8f
|
Computed checksum: aa8c883841db22e92794f4708b01dc905b5da77645b7dfb5b22a73da8c347db1
|
||||||
Published checksum: 3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118
|
Published checksum: ${PackageServer.BIRDS_SHA}
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
)
|
)
|
||||||
@@ -911,8 +937,6 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `publish check when package is not yet published`(@TempDir tempDir: Path) {
|
fun `publish check when package is not yet published`(@TempDir tempDir: Path) {
|
||||||
PackageServer.ensureStarted()
|
|
||||||
CertificateUtils.setupAllX509CertificatesGlobally(listOf(FileTestUtils.selfSignedCertificate))
|
|
||||||
tempDir.writeFile("project/main.pkl", "res = 1")
|
tempDir.writeFile("project/main.pkl", "res = 1")
|
||||||
tempDir.writeFile(
|
tempDir.writeFile(
|
||||||
"project/PklProject",
|
"project/PklProject",
|
||||||
@@ -922,7 +946,7 @@ class CliProjectPackagerTest {
|
|||||||
package {
|
package {
|
||||||
name = "mangos"
|
name = "mangos"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
baseUri = "package://localhost:12110/mangos"
|
baseUri = "package://localhost:0/mangos"
|
||||||
packageZipUrl = "https://foo.com"
|
packageZipUrl = "https://foo.com"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -930,7 +954,11 @@ class CliProjectPackagerTest {
|
|||||||
)
|
)
|
||||||
val out = StringWriter()
|
val out = StringWriter()
|
||||||
CliProjectPackager(
|
CliProjectPackager(
|
||||||
CliBaseOptions(workingDir = tempDir),
|
CliBaseOptions(
|
||||||
|
workingDir = tempDir,
|
||||||
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port
|
||||||
|
),
|
||||||
listOf(tempDir.resolve("project")),
|
listOf(tempDir.resolve("project")),
|
||||||
CliTestOptions(),
|
CliTestOptions(),
|
||||||
".out/%{name}@%{version}",
|
".out/%{name}@%{version}",
|
||||||
@@ -938,13 +966,14 @@ class CliProjectPackagerTest {
|
|||||||
consoleWriter = out
|
consoleWriter = out
|
||||||
)
|
)
|
||||||
.run()
|
.run()
|
||||||
|
val sep = File.separatorChar
|
||||||
assertThat(out.toString())
|
assertThat(out.toString())
|
||||||
.isEqualTo(
|
.isEqualToNormalizingNewlines(
|
||||||
"""
|
"""
|
||||||
.out/mangos@1.0.0/mangos@1.0.0.zip
|
.out${sep}mangos@1.0.0${sep}mangos@1.0.0.zip
|
||||||
.out/mangos@1.0.0/mangos@1.0.0.zip.sha256
|
.out${sep}mangos@1.0.0${sep}mangos@1.0.0.zip.sha256
|
||||||
.out/mangos@1.0.0/mangos@1.0.0
|
.out${sep}mangos@1.0.0${sep}mangos@1.0.0
|
||||||
.out/mangos@1.0.0/mangos@1.0.0.sha256
|
.out${sep}mangos@1.0.0${sep}mangos@1.0.0.sha256
|
||||||
|
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
@@ -953,7 +982,7 @@ class CliProjectPackagerTest {
|
|||||||
|
|
||||||
private fun Path.zipFilePaths(): List<String> {
|
private fun Path.zipFilePaths(): List<String> {
|
||||||
return FileSystems.newFileSystem(URI("jar:${toUri()}"), emptyMap<String, String>()).use { fs ->
|
return FileSystems.newFileSystem(URI("jar:${toUri()}"), emptyMap<String, String>()).use { fs ->
|
||||||
Files.walk(fs.getPath("/")).map { it.toString() }.collect(Collectors.toList())
|
Files.walk(fs.getPath("/")).map(IoUtils::toNormalizedPathString).collect(Collectors.toList())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.pkl.cli
|
package org.pkl.cli
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
import java.io.StringWriter
|
import java.io.StringWriter
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.BeforeAll
|
import org.junit.jupiter.api.AfterAll
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.assertThrows
|
import org.junit.jupiter.api.assertThrows
|
||||||
import org.junit.jupiter.api.io.TempDir
|
import org.junit.jupiter.api.io.TempDir
|
||||||
@@ -26,13 +27,16 @@ import org.pkl.commons.cli.CliBaseOptions
|
|||||||
import org.pkl.commons.cli.CliException
|
import org.pkl.commons.cli.CliException
|
||||||
import org.pkl.commons.test.FileTestUtils
|
import org.pkl.commons.test.FileTestUtils
|
||||||
import org.pkl.commons.test.PackageServer
|
import org.pkl.commons.test.PackageServer
|
||||||
|
import org.pkl.core.util.IoUtils
|
||||||
|
|
||||||
class CliProjectResolverTest {
|
class CliProjectResolverTest {
|
||||||
companion object {
|
companion object {
|
||||||
@BeforeAll
|
private val packageServer = PackageServer()
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun beforeAll() {
|
fun afterAll() {
|
||||||
PackageServer.ensureStarted()
|
packageServer.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +44,7 @@ class CliProjectResolverTest {
|
|||||||
fun `missing PklProject when inferring a project dir`(@TempDir tempDir: Path) {
|
fun `missing PklProject when inferring a project dir`(@TempDir tempDir: Path) {
|
||||||
val packager =
|
val packager =
|
||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(workingDir = tempDir),
|
CliBaseOptions(workingDir = tempDir, noCache = true),
|
||||||
emptyList(),
|
emptyList(),
|
||||||
consoleWriter = StringWriter(),
|
consoleWriter = StringWriter(),
|
||||||
errWriter = StringWriter()
|
errWriter = StringWriter()
|
||||||
@@ -50,10 +54,10 @@ class CliProjectResolverTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `missing PklProject when explict dir is provided`(@TempDir tempDir: Path) {
|
fun `missing PklProject when explicit dir is provided`(@TempDir tempDir: Path) {
|
||||||
val packager =
|
val packager =
|
||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(),
|
CliBaseOptions(noCache = true),
|
||||||
listOf(tempDir),
|
listOf(tempDir),
|
||||||
consoleWriter = StringWriter(),
|
consoleWriter = StringWriter(),
|
||||||
errWriter = StringWriter()
|
errWriter = StringWriter()
|
||||||
@@ -71,7 +75,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -80,7 +84,9 @@ class CliProjectResolverTest {
|
|||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
workingDir = tempDir,
|
workingDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port,
|
||||||
|
noCache = true
|
||||||
),
|
),
|
||||||
listOf(tempDir),
|
listOf(tempDir),
|
||||||
consoleWriter = StringWriter(),
|
consoleWriter = StringWriter(),
|
||||||
@@ -94,18 +100,18 @@ class CliProjectResolverTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,7 +130,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -133,7 +139,9 @@ class CliProjectResolverTest {
|
|||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(
|
CliBaseOptions(
|
||||||
workingDir = tempDir,
|
workingDir = tempDir,
|
||||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate)
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port,
|
||||||
|
noCache = true
|
||||||
),
|
),
|
||||||
emptyList(),
|
emptyList(),
|
||||||
consoleWriter = StringWriter(),
|
consoleWriter = StringWriter(),
|
||||||
@@ -147,18 +155,18 @@ class CliProjectResolverTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,7 +186,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
["project2"] = import("../project2/PklProject")
|
["project2"] = import("../project2/PklProject")
|
||||||
}
|
}
|
||||||
@@ -192,14 +200,14 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
package {
|
package {
|
||||||
name = "project2"
|
name = "project2"
|
||||||
baseUri = "package://localhost:12110/package2"
|
baseUri = "package://localhost:0/package2"
|
||||||
version = "5.0.0"
|
version = "5.0.0"
|
||||||
packageZipUrl = "https://foo.com/package2.zip"
|
packageZipUrl = "https://foo.com/package2.zip"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["fruit"] {
|
["fruit"] {
|
||||||
uri = "package://localhost:12110/fruit@1.0.5"
|
uri = "package://localhost:0/fruit@1.0.5"
|
||||||
}
|
}
|
||||||
["project3"] = import("../project3/PklProject")
|
["project3"] = import("../project3/PklProject")
|
||||||
}
|
}
|
||||||
@@ -214,21 +222,25 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
package {
|
package {
|
||||||
name = "project3"
|
name = "project3"
|
||||||
baseUri = "package://localhost:12110/package3"
|
baseUri = "package://localhost:0/package3"
|
||||||
version = "5.0.0"
|
version = "5.0.0"
|
||||||
packageZipUrl = "https://foo.com/package3.zip"
|
packageZipUrl = "https://foo.com/package3.zip"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["fruit"] {
|
["fruit"] {
|
||||||
uri = "package://localhost:12110/fruit@1.1.0"
|
uri = "package://localhost:0/fruit@1.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
)
|
)
|
||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(caCertificates = listOf(FileTestUtils.selfSignedCertificate)),
|
CliBaseOptions(
|
||||||
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port,
|
||||||
|
noCache = true
|
||||||
|
),
|
||||||
listOf(projectDir),
|
listOf(projectDir),
|
||||||
consoleWriter = StringWriter(),
|
consoleWriter = StringWriter(),
|
||||||
errWriter = StringWriter()
|
errWriter = StringWriter()
|
||||||
@@ -241,28 +253,28 @@ class CliProjectResolverTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "98ad9fc407a79dc3fd5595e7a29c3803ade0a6957c18ec94b8a1624360b24f01"
|
"sha256": "${PackageServer.FRUIT_1_1_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/package2@5": {
|
"package://localhost:0/package2@5": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"uri": "projectpackage://localhost:12110/package2@5.0.0",
|
"uri": "projectpackage://localhost:0/package2@5.0.0",
|
||||||
"path": "../project2"
|
"path": "../project2"
|
||||||
},
|
},
|
||||||
"package://localhost:12110/package3@5": {
|
"package://localhost:0/package3@5": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"uri": "projectpackage://localhost:12110/package3@5.0.0",
|
"uri": "projectpackage://localhost:0/package3@5.0.0",
|
||||||
"path": "../project3"
|
"path": "../project3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,7 +294,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
["fruit"] = import("../fruit/PklProject")
|
["fruit"] = import("../fruit/PklProject")
|
||||||
}
|
}
|
||||||
@@ -296,7 +308,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
package {
|
package {
|
||||||
name = "fruit"
|
name = "fruit"
|
||||||
baseUri = "package://localhost:12110/fruit"
|
baseUri = "package://localhost:0/fruit"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
packageZipUrl = "https://foo.com/fruit.zip"
|
packageZipUrl = "https://foo.com/fruit.zip"
|
||||||
}
|
}
|
||||||
@@ -306,7 +318,11 @@ class CliProjectResolverTest {
|
|||||||
val consoleOut = StringWriter()
|
val consoleOut = StringWriter()
|
||||||
val errOut = StringWriter()
|
val errOut = StringWriter()
|
||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(caCertificates = listOf(FileTestUtils.selfSignedCertificate)),
|
CliBaseOptions(
|
||||||
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port,
|
||||||
|
noCache = true
|
||||||
|
),
|
||||||
listOf(projectDir),
|
listOf(projectDir),
|
||||||
consoleWriter = consoleOut,
|
consoleWriter = consoleOut,
|
||||||
errWriter = errOut
|
errWriter = errOut
|
||||||
@@ -319,18 +335,18 @@ class CliProjectResolverTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -340,7 +356,7 @@ class CliProjectResolverTest {
|
|||||||
)
|
)
|
||||||
assertThat(errOut.toString())
|
assertThat(errOut.toString())
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
"WARN: local dependency `package://localhost:12110/fruit@1.0.0` was overridden to remote dependency `package://localhost:12110/fruit@1.0.5`.\n"
|
"WARN: local dependency `package://localhost:0/fruit@1.0.0` was overridden to remote dependency `package://localhost:0/fruit@1.0.5`.${IoUtils.getLineSeparator()}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +369,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["birds"] {
|
["birds"] {
|
||||||
uri = "package://localhost:12110/birds@0.5.0"
|
uri = "package://localhost:0/birds@0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -367,7 +383,7 @@ class CliProjectResolverTest {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
["fruit"] {
|
["fruit"] {
|
||||||
uri = "package://localhost:12110/fruit@1.1.0"
|
uri = "package://localhost:0/fruit@1.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -377,17 +393,22 @@ class CliProjectResolverTest {
|
|||||||
val consoleOut = StringWriter()
|
val consoleOut = StringWriter()
|
||||||
val errOut = StringWriter()
|
val errOut = StringWriter()
|
||||||
CliProjectResolver(
|
CliProjectResolver(
|
||||||
CliBaseOptions(caCertificates = listOf(FileTestUtils.selfSignedCertificate)),
|
CliBaseOptions(
|
||||||
|
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||||
|
testPort = packageServer.port,
|
||||||
|
noCache = true
|
||||||
|
),
|
||||||
listOf(tempDir.resolve("project1"), tempDir.resolve("project2")),
|
listOf(tempDir.resolve("project1"), tempDir.resolve("project2")),
|
||||||
consoleWriter = consoleOut,
|
consoleWriter = consoleOut,
|
||||||
errWriter = errOut
|
errWriter = errOut
|
||||||
)
|
)
|
||||||
.run()
|
.run()
|
||||||
|
val sep = File.separatorChar
|
||||||
assertThat(consoleOut.toString())
|
assertThat(consoleOut.toString())
|
||||||
.isEqualTo(
|
.isEqualToNormalizingNewlines(
|
||||||
"""
|
"""
|
||||||
$tempDir/project1/PklProject.deps.json
|
$tempDir${sep}project1${sep}PklProject.deps.json
|
||||||
$tempDir/project2/PklProject.deps.json
|
$tempDir${sep}project2${sep}PklProject.deps.json
|
||||||
|
|
||||||
"""
|
"""
|
||||||
.trimIndent()
|
.trimIndent()
|
||||||
@@ -398,18 +419,18 @@ class CliProjectResolverTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/birds@0": {
|
"package://localhost:0/birds@0": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "b4ea243de781feeab7921227591e6584db5d0673340f30fab2ffe8ad5c9f75f5"
|
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -423,11 +444,11 @@ class CliProjectResolverTest {
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"resolvedDependencies": {
|
"resolvedDependencies": {
|
||||||
"package://localhost:12110/fruit@1": {
|
"package://localhost:0/fruit@1": {
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||||
"checksums": {
|
"checksums": {
|
||||||
"sha256": "98ad9fc407a79dc3fd5595e7a29c3803ade0a6957c18ec94b8a1624360b24f01"
|
"sha256": "${PackageServer.FRUIT_1_1_SHA}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.pkl.commons.toPath
|
|||||||
import org.pkl.core.Loggers
|
import org.pkl.core.Loggers
|
||||||
import org.pkl.core.SecurityManagers
|
import org.pkl.core.SecurityManagers
|
||||||
import org.pkl.core.StackFrameTransformers
|
import org.pkl.core.StackFrameTransformers
|
||||||
|
import org.pkl.core.http.HttpClient
|
||||||
import org.pkl.core.module.ModuleKeyFactories
|
import org.pkl.core.module.ModuleKeyFactories
|
||||||
import org.pkl.core.repl.ReplRequest
|
import org.pkl.core.repl.ReplRequest
|
||||||
import org.pkl.core.repl.ReplResponse
|
import org.pkl.core.repl.ReplResponse
|
||||||
@@ -30,6 +31,7 @@ class ReplMessagesTest {
|
|||||||
private val server =
|
private val server =
|
||||||
ReplServer(
|
ReplServer(
|
||||||
SecurityManagers.defaultManager,
|
SecurityManagers.defaultManager,
|
||||||
|
HttpClient.dummyClient(),
|
||||||
Loggers.stdErr(),
|
Loggers.stdErr(),
|
||||||
listOf(ModuleKeyFactories.standardLibrary),
|
listOf(ModuleKeyFactories.standardLibrary),
|
||||||
listOf(),
|
listOf(),
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ com.github.ajalt.clikt:clikt-jvm:3.5.1=compileClasspath,default,runtimeClasspath
|
|||||||
com.github.ajalt.clikt:clikt:3.5.1=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
com.github.ajalt.clikt:clikt:3.5.1=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
com.squareup:javapoet:1.13.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
com.squareup:javapoet:1.13.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
com.tunnelvisionlabs:antlr4-runtime:4.9.0=default,runtimeClasspath,testRuntimeClasspath
|
com.tunnelvisionlabs:antlr4-runtime:4.9.0=default,runtimeClasspath,testRuntimeClasspath
|
||||||
io.leangen.geantyref:geantyref:1.3.14=testRuntimeClasspath
|
io.leangen.geantyref:geantyref:1.3.15=testRuntimeClasspath
|
||||||
net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
net.bytebuddy:byte-buddy:1.14.16=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeOnlyDependenciesMetadata
|
||||||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.assertj:assertj-core:3.26.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.graalvm.sdk:graal-sdk:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
org.graalvm.sdk:graal-sdk:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
||||||
org.graalvm.truffle:truffle-api:22.3.1=default,runtimeClasspath,testRuntimeClasspath
|
org.graalvm.truffle:truffle-api:23.0.2=default,runtimeClasspath,testRuntimeClasspath
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
@@ -27,13 +27,13 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10=apiDependenciesMetadata,compileCl
|
|||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib:1.7.10=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains:annotations:13.0=apiDependenciesMetadata,compileClasspath,default,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.jupiter:junit-jupiter-api:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-api:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.jupiter:junit-jupiter-engine:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-params:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.junit.jupiter:junit-jupiter-params:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.junit.platform:junit-platform-commons:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-commons:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.platform:junit-platform-engine:1.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit.platform:junit-platform-engine:1.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.junit:junit-bom:5.9.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.junit:junit-bom:5.10.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
|
||||||
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
org.organicdesign:Paguro:3.10.3=default,runtimeClasspath,testRuntimeClasspath
|
||||||
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
org.snakeyaml:snakeyaml-engine:2.5=default,runtimeClasspath,testRuntimeClasspath
|
||||||
empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
empty=annotationProcessor,archives,compile,compileOnly,compileOnlyDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,signatures,sourcesJar,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ plugins {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// CliJavaCodeGeneratorOptions exposes CliBaseOptions
|
// CliJavaCodeGeneratorOptions exposes CliBaseOptions
|
||||||
api(project(":pkl-commons-cli"))
|
api(projects.pklCommonsCli)
|
||||||
|
|
||||||
implementation(project(":pkl-commons"))
|
implementation(projects.pklCommons)
|
||||||
implementation(project(":pkl-core"))
|
implementation(projects.pklCore)
|
||||||
implementation(libs.javaPoet)
|
implementation(libs.javaPoet)
|
||||||
|
|
||||||
testImplementation(project(":pkl-config-java"))
|
testImplementation(projects.pklConfigJava)
|
||||||
testImplementation(project(":pkl-commons-test"))
|
testImplementation(projects.pklCommonsTest)
|
||||||
}
|
}
|
||||||
|
|
||||||
// with `org.gradle.parallel=true` and without the line below, `test` strangely runs into:
|
// with `org.gradle.parallel=true` and without the line below, `test` strangely runs into:
|
||||||
|
|||||||
+12
-2
@@ -54,7 +54,16 @@ data class CliJavaCodeGeneratorOptions(
|
|||||||
val nonNullAnnotation: String? = null,
|
val nonNullAnnotation: String? = null,
|
||||||
|
|
||||||
/** Whether to make generated classes implement [java.io.Serializable] */
|
/** Whether to make generated classes implement [java.io.Serializable] */
|
||||||
val implementSerializable: Boolean = false
|
val implementSerializable: Boolean = false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A rename mapping for class names.
|
||||||
|
*
|
||||||
|
* When you need to have Java class or package names different from the default names derived from
|
||||||
|
* Pkl module names, you can define a rename mapping, where the key is a prefix of the original
|
||||||
|
* Pkl module name, and the value is the desired replacement.
|
||||||
|
*/
|
||||||
|
val renames: Map<String, String> = emptyMap()
|
||||||
) {
|
) {
|
||||||
fun toJavaCodegenOptions() =
|
fun toJavaCodegenOptions() =
|
||||||
JavaCodegenOptions(
|
JavaCodegenOptions(
|
||||||
@@ -64,6 +73,7 @@ data class CliJavaCodeGeneratorOptions(
|
|||||||
generateSpringBootConfig,
|
generateSpringBootConfig,
|
||||||
paramsAnnotation,
|
paramsAnnotation,
|
||||||
nonNullAnnotation,
|
nonNullAnnotation,
|
||||||
implementSerializable
|
implementSerializable,
|
||||||
|
renames
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ import kotlin.apply
|
|||||||
import kotlin.let
|
import kotlin.let
|
||||||
import kotlin.takeIf
|
import kotlin.takeIf
|
||||||
import kotlin.to
|
import kotlin.to
|
||||||
|
import org.pkl.commons.NameMapper
|
||||||
import org.pkl.core.*
|
import org.pkl.core.*
|
||||||
import org.pkl.core.util.CodeGeneratorUtils
|
import org.pkl.core.util.CodeGeneratorUtils
|
||||||
|
import org.pkl.core.util.IoUtils
|
||||||
|
|
||||||
class JavaCodeGeneratorException(message: String) : RuntimeException(message)
|
class JavaCodeGeneratorException(message: String) : RuntimeException(message)
|
||||||
|
|
||||||
@@ -68,7 +70,15 @@ data class JavaCodegenOptions(
|
|||||||
val nonNullAnnotation: String? = null,
|
val nonNullAnnotation: String? = null,
|
||||||
|
|
||||||
/** Whether to make generated classes implement [java.io.Serializable] */
|
/** Whether to make generated classes implement [java.io.Serializable] */
|
||||||
val implementSerializable: Boolean = false
|
val implementSerializable: Boolean = false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mapping from Pkl module name prefixes to their replacements.
|
||||||
|
*
|
||||||
|
* Can be used when the class or package name in the generated source code should be different
|
||||||
|
* from the corresponding name derived from the Pkl module declaration .
|
||||||
|
*/
|
||||||
|
val renames: Map<String, String> = emptyMap()
|
||||||
)
|
)
|
||||||
|
|
||||||
/** Entrypoint for the Java code generator API. */
|
/** Entrypoint for the Java code generator API. */
|
||||||
@@ -123,7 +133,8 @@ class JavaCodeGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val propertyFileName: String
|
private val propertyFileName: String
|
||||||
get() = "resources/META-INF/org/pkl/config/java/mapper/classes/${schema.moduleName}.properties"
|
get() =
|
||||||
|
"resources/META-INF/org/pkl/config/java/mapper/classes/${IoUtils.encodePath(schema.moduleName)}.properties"
|
||||||
|
|
||||||
private val propertiesFile: String
|
private val propertiesFile: String
|
||||||
get() {
|
get() {
|
||||||
@@ -150,8 +161,16 @@ class JavaCodeGenerator(
|
|||||||
return AnnotationSpec.builder(className).build()
|
return AnnotationSpec.builder(className).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
val javaFileName: String
|
private val javaFileName: String
|
||||||
get() = relativeOutputPathFor(schema.moduleName)
|
get() {
|
||||||
|
val (packageName, className) = nameMapper.map(schema.moduleName)
|
||||||
|
val dirPath = packageName.replace('.', '/')
|
||||||
|
return if (dirPath.isEmpty()) {
|
||||||
|
"java/$className.java"
|
||||||
|
} else {
|
||||||
|
"java/$dirPath/$className.java"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val javaFile: String
|
val javaFile: String
|
||||||
get() {
|
get() {
|
||||||
@@ -183,9 +202,7 @@ class JavaCodeGenerator(
|
|||||||
moduleClass.addMethod(appendPropertyMethod().addModifiers(modifier).build())
|
moduleClass.addMethod(appendPropertyMethod().addModifiers(modifier).build())
|
||||||
}
|
}
|
||||||
|
|
||||||
val moduleName = schema.moduleName
|
val (packageName, _) = nameMapper.map(schema.moduleName)
|
||||||
val index = moduleName.lastIndexOf(".")
|
|
||||||
val packageName = if (index == -1) "" else moduleName.substring(0, index)
|
|
||||||
|
|
||||||
return JavaFile.builder(packageName, moduleClass.build())
|
return JavaFile.builder(packageName, moduleClass.build())
|
||||||
.indent(codegenOptions.indent)
|
.indent(codegenOptions.indent)
|
||||||
@@ -193,20 +210,7 @@ class JavaCodeGenerator(
|
|||||||
.toString()
|
.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun relativeOutputPathFor(moduleName: String): String {
|
|
||||||
val moduleNameParts = moduleName.split(".")
|
|
||||||
val dirPath = moduleNameParts.dropLast(1).joinToString("/")
|
|
||||||
val fileName = moduleNameParts.last().replaceFirstChar { it.titlecaseChar() }
|
|
||||||
return if (dirPath.isEmpty()) {
|
|
||||||
"java/$fileName.java"
|
|
||||||
} else {
|
|
||||||
"java/$dirPath/$fileName.java"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("NAME_SHADOWING")
|
|
||||||
private fun generateTypeSpec(pClass: PClass, schema: ModuleSchema): TypeSpec.Builder {
|
private fun generateTypeSpec(pClass: PClass, schema: ModuleSchema): TypeSpec.Builder {
|
||||||
|
|
||||||
val isModuleClass = pClass == schema.moduleClass
|
val isModuleClass = pClass == schema.moduleClass
|
||||||
val javaPoetClassName = pClass.toJavaPoetName()
|
val javaPoetClassName = pClass.toJavaPoetName()
|
||||||
val superclass =
|
val superclass =
|
||||||
@@ -687,9 +691,7 @@ class JavaCodeGenerator(
|
|||||||
.endControlFlow()
|
.endControlFlow()
|
||||||
|
|
||||||
private fun PClass.toJavaPoetName(): ClassName {
|
private fun PClass.toJavaPoetName(): ClassName {
|
||||||
val index = moduleName.lastIndexOf(".")
|
val (packageName, moduleClassName) = nameMapper.map(moduleName)
|
||||||
val packageName = if (index == -1) "" else moduleName.substring(0, index)
|
|
||||||
val moduleClassName = moduleName.substring(index + 1).replaceFirstChar { it.titlecaseChar() }
|
|
||||||
return if (isModuleClass) {
|
return if (isModuleClass) {
|
||||||
ClassName.get(packageName, moduleClassName)
|
ClassName.get(packageName, moduleClassName)
|
||||||
} else {
|
} else {
|
||||||
@@ -699,9 +701,7 @@ class JavaCodeGenerator(
|
|||||||
|
|
||||||
// generated type is a nested enum class
|
// generated type is a nested enum class
|
||||||
private fun TypeAlias.toJavaPoetName(): ClassName {
|
private fun TypeAlias.toJavaPoetName(): ClassName {
|
||||||
val index = moduleName.lastIndexOf(".")
|
val (packageName, moduleClassName) = nameMapper.map(moduleName)
|
||||||
val packageName = if (index == -1) "" else moduleName.substring(0, index)
|
|
||||||
val moduleClassName = moduleName.substring(index + 1).replaceFirstChar { it.titlecaseChar() }
|
|
||||||
return ClassName.get(packageName, moduleClassName, simpleName)
|
return ClassName.get(packageName, moduleClassName, simpleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -872,6 +872,8 @@ class JavaCodeGenerator(
|
|||||||
} else key
|
} else key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val nameMapper = NameMapper(codegenOptions.renames)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val javaReservedWords =
|
internal val javaReservedWords =
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.pkl.codegen.java
|
package org.pkl.codegen.java
|
||||||
|
|
||||||
|
import com.github.ajalt.clikt.parameters.options.associate
|
||||||
import com.github.ajalt.clikt.parameters.options.default
|
import com.github.ajalt.clikt.parameters.options.default
|
||||||
import com.github.ajalt.clikt.parameters.options.flag
|
import com.github.ajalt.clikt.parameters.options.flag
|
||||||
import com.github.ajalt.clikt.parameters.options.option
|
import com.github.ajalt.clikt.parameters.options.option
|
||||||
@@ -108,6 +109,21 @@ class PklJavaCodegenCommand :
|
|||||||
)
|
)
|
||||||
.flag()
|
.flag()
|
||||||
|
|
||||||
|
private val renames: Map<String, String> by
|
||||||
|
option(
|
||||||
|
names = arrayOf("--rename"),
|
||||||
|
metavar = "<old_name=new_name>",
|
||||||
|
help =
|
||||||
|
"""
|
||||||
|
Replace a prefix in the names of the generated Java classes (repeatable).
|
||||||
|
By default, the names of generated classes are derived from the Pkl module names.
|
||||||
|
With this option, you can override the modify the default names, renaming entire
|
||||||
|
classes or just their packages.
|
||||||
|
"""
|
||||||
|
.trimIndent()
|
||||||
|
)
|
||||||
|
.associate()
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val options =
|
val options =
|
||||||
CliJavaCodeGeneratorOptions(
|
CliJavaCodeGeneratorOptions(
|
||||||
@@ -119,7 +135,8 @@ class PklJavaCodegenCommand :
|
|||||||
generateSpringBootConfig = generateSpringboot,
|
generateSpringBootConfig = generateSpringboot,
|
||||||
paramsAnnotation = paramsAnnotation,
|
paramsAnnotation = paramsAnnotation,
|
||||||
nonNullAnnotation = nonNullAnnotation,
|
nonNullAnnotation = nonNullAnnotation,
|
||||||
implementSerializable = implementSerializable
|
implementSerializable = implementSerializable,
|
||||||
|
renames = renames
|
||||||
)
|
)
|
||||||
CliJavaCodeGenerator(options).run()
|
CliJavaCodeGenerator(options).run()
|
||||||
}
|
}
|
||||||
|
|||||||
+118
-10
@@ -97,22 +97,21 @@ class CliJavaCodeGeneratorTest {
|
|||||||
|
|
||||||
val module1PropertiesFile = resourcesDir.resolve("org.mod1.properties")
|
val module1PropertiesFile = resourcesDir.resolve("org.mod1.properties")
|
||||||
|
|
||||||
|
val module1PropertiesString = module1PropertiesFile.readString()
|
||||||
|
// use two assertions because java.util.Properties doesn't guarantee order
|
||||||
assertContains(
|
assertContains(
|
||||||
"""
|
"""org.pkl.config.java.mapper.org.mod1\#Person=org.Mod1${dollar}Person""",
|
||||||
org.pkl.config.java.mapper.org.mod1\#Person=org.Mod1${dollar}Person
|
module1PropertiesString
|
||||||
org.pkl.config.java.mapper.org.mod1\#ModuleClass=org.Mod1
|
)
|
||||||
"""
|
assertContains(
|
||||||
.trimIndent(),
|
"""org.pkl.config.java.mapper.org.mod1\#ModuleClass=org.Mod1""",
|
||||||
module1PropertiesFile.readString()
|
module1PropertiesString
|
||||||
)
|
)
|
||||||
|
|
||||||
val module2PropertiesFile = resourcesDir.resolve("org.mod2.properties")
|
val module2PropertiesFile = resourcesDir.resolve("org.mod2.properties")
|
||||||
|
|
||||||
assertContains(
|
assertContains(
|
||||||
"""
|
"""org.pkl.config.java.mapper.org.mod2\#ModuleClass=org.Mod2""",
|
||||||
org.pkl.config.java.mapper.org.mod2\#ModuleClass=org.Mod2
|
|
||||||
"""
|
|
||||||
.trimIndent(),
|
|
||||||
module2PropertiesFile.readString()
|
module2PropertiesFile.readString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -174,6 +173,115 @@ class CliJavaCodeGeneratorTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `custom package names`(@TempDir tempDir: Path) {
|
||||||
|
val module1 =
|
||||||
|
PklModule(
|
||||||
|
"org.foo.Module1",
|
||||||
|
"""
|
||||||
|
module org.foo.Module1
|
||||||
|
|
||||||
|
class Person {
|
||||||
|
name: String
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
val module2 =
|
||||||
|
PklModule(
|
||||||
|
"org.bar.Module2",
|
||||||
|
"""
|
||||||
|
module org.bar.Module2
|
||||||
|
|
||||||
|
import "../../org/foo/Module1.pkl"
|
||||||
|
|
||||||
|
class Group {
|
||||||
|
owner: Module1.Person
|
||||||
|
name: String
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
val module3 =
|
||||||
|
PklModule(
|
||||||
|
"org.baz.Module3",
|
||||||
|
"""
|
||||||
|
module org.baz.Module3
|
||||||
|
|
||||||
|
import "../../org/bar/Module2.pkl"
|
||||||
|
|
||||||
|
class Supergroup {
|
||||||
|
owner: Module2.Group
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
val module1PklFile = module1.writeToDisk(tempDir.resolve("org/foo/Module1.pkl"))
|
||||||
|
val module2PklFile = module2.writeToDisk(tempDir.resolve("org/bar/Module2.pkl"))
|
||||||
|
val module3PklFile = module3.writeToDisk(tempDir.resolve("org/baz/Module3.pkl"))
|
||||||
|
val outputDir = tempDir.resolve("output")
|
||||||
|
|
||||||
|
val generator =
|
||||||
|
CliJavaCodeGenerator(
|
||||||
|
CliJavaCodeGeneratorOptions(
|
||||||
|
CliBaseOptions(listOf(module1PklFile, module2PklFile, module3PklFile).map { it.toUri() }),
|
||||||
|
outputDir,
|
||||||
|
renames = mapOf("org.foo" to "com.foo.x", "org.baz" to "com.baz.a.b")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
generator.run()
|
||||||
|
|
||||||
|
val module1JavaFile = outputDir.resolve("java/com/foo/x/Module1.java")
|
||||||
|
module1JavaFile.readString().let {
|
||||||
|
assertContains("package com.foo.x;", it)
|
||||||
|
|
||||||
|
assertContains("public final class Module1 {", it)
|
||||||
|
|
||||||
|
assertContains(
|
||||||
|
"""
|
||||||
|
| public static final class Person {
|
||||||
|
| public final @NonNull String name;
|
||||||
|
""",
|
||||||
|
it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val module2JavaFile = outputDir.resolve("java/org/bar/Module2.java")
|
||||||
|
module2JavaFile.readString().let {
|
||||||
|
assertContains("package org.bar;", it)
|
||||||
|
|
||||||
|
assertContains("import com.foo.x.Module1;", it)
|
||||||
|
|
||||||
|
assertContains("public final class Module2 {", it)
|
||||||
|
|
||||||
|
assertContains(
|
||||||
|
"""
|
||||||
|
| public static final class Group {
|
||||||
|
| public final Module1. @NonNull Person owner;
|
||||||
|
""",
|
||||||
|
it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val module3JavaFile = outputDir.resolve("java/com/baz/a/b/Module3.java")
|
||||||
|
module3JavaFile.readString().let {
|
||||||
|
assertContains("package com.baz.a.b;", it)
|
||||||
|
|
||||||
|
assertContains("import org.bar.Module2;", it)
|
||||||
|
|
||||||
|
assertContains("public final class Module3 {", it)
|
||||||
|
|
||||||
|
assertContains(
|
||||||
|
"""
|
||||||
|
| public static final class Supergroup {
|
||||||
|
| public final Module2. @NonNull Group owner;
|
||||||
|
""",
|
||||||
|
it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun assertContains(part: String, code: String) {
|
private fun assertContains(part: String, code: String) {
|
||||||
val trimmedPart = part.trim().trimMargin()
|
val trimmedPart = part.trim().trimMargin()
|
||||||
if (!code.contains(trimmedPart)) {
|
if (!code.contains(trimmedPart)) {
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ object InMemoryJavaCompiler {
|
|||||||
val fileManager =
|
val fileManager =
|
||||||
InMemoryFileManager(compiler.getStandardFileManager(diagnosticsCollector, null, null))
|
InMemoryFileManager(compiler.getStandardFileManager(diagnosticsCollector, null, null))
|
||||||
val sourceObjects =
|
val sourceObjects =
|
||||||
sourceFiles.map { (filename, contents) -> ReadableSourceFileObject(filename, contents) }
|
sourceFiles
|
||||||
|
.filter { (filename, _) -> filename.endsWith(".java") }
|
||||||
|
.map { (filename, contents) -> ReadableSourceFileObject(filename, contents) }
|
||||||
val task = compiler.getTask(null, fileManager, diagnosticsCollector, null, null, sourceObjects)
|
val task = compiler.getTask(null, fileManager, diagnosticsCollector, null, null, sourceObjects)
|
||||||
val result = task.call()
|
val result = task.call()
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user