mirror of
https://github.com/apple/pkl.git
synced 2026-06-12 00:24:37 +02:00
Add support for Windows (#492)
This adds support for Windows. The in-language path separator is still `/`, to ensure Pkl programs are cross-platform. Log lines are written using CRLF endings on Windows. Modules that are combined with `--module-output-separator` uses LF endings to ensure consistent rendering across platforms. `jpkl` does not work on Windows as a direct executable. However, it can work with `java -jar jpkl`. Additional details: * Adjust git settings for Windows * Add native executable for pkl cli * Add jdk17 windows Gradle check in CI * Adjust CI test reports to be staged within Gradle rather than by shell script. * Fix: encode more characters that are not safe Windows paths * Skip running tests involving symbolic links on Windows (these require administrator privileges to run). * Introduce custom implementation of `IoUtils.relativize` * Allow Gradle to initialize ExecutableJar `Property` values * Add Gradle flag to enable remote JVM debugging Co-authored-by: Philip K.F. Hölzenspies <holzensp@gmail.com>
This commit is contained in:
+11
-1
@@ -14,7 +14,7 @@
|
||||
// limitations under the License.
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 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/GradleCheckJob.pkl"
|
||||
@@ -96,6 +96,11 @@ local buildNativeJobs: Mapping<String, BuildNativeJob> = new {
|
||||
musl = true
|
||||
isRelease = _dist == "release"
|
||||
}
|
||||
["pkl-cli-windows-amd64-\(_dist)"] {
|
||||
arch = "amd64"
|
||||
os = "windows"
|
||||
isRelease = _dist == "release"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +113,11 @@ local gradleCheckJobs: Mapping<String, GradleCheckJob> = new {
|
||||
javaVersion = "21.0"
|
||||
isRelease = false
|
||||
}
|
||||
["gradle-check-jdk17-windows"] {
|
||||
javaVersion = "17.0"
|
||||
isRelease = false
|
||||
os = "windows"
|
||||
}
|
||||
}
|
||||
|
||||
jobs {
|
||||
|
||||
+92
-112
@@ -12,18 +12,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -94,18 +88,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -120,18 +108,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -186,18 +168,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -269,18 +245,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -289,6 +259,26 @@ jobs:
|
||||
resource_class: xlarge
|
||||
docker:
|
||||
- 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
|
||||
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:
|
||||
steps:
|
||||
- checkout
|
||||
@@ -298,18 +288,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -380,18 +364,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -406,18 +384,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -472,18 +444,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -555,18 +521,12 @@ jobs:
|
||||
- run:
|
||||
command: |-
|
||||
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
|
||||
name: gradle buildNative
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -575,18 +535,32 @@ jobs:
|
||||
resource_class: xlarge
|
||||
docker:
|
||||
- image: oraclelinux:8-slim
|
||||
pkl-cli-windows-amd64-snapshot:
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |-
|
||||
export PATH=~/staticdeps/bin:$PATH
|
||||
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results pkl-cli:windowsExecutableAmd64 pkl-core: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
|
||||
gradle-check-jdk17:
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: ./gradlew --info --stacktrace check
|
||||
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -597,32 +571,33 @@ jobs:
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: ./gradlew --info --stacktrace check
|
||||
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
LANG: en_US.UTF-8
|
||||
docker:
|
||||
- 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 bench:jmh
|
||||
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results bench:jmh
|
||||
name: bench:jmh
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -634,16 +609,10 @@ jobs:
|
||||
- checkout
|
||||
- run:
|
||||
command: |-
|
||||
./gradlew --info --stacktrace :pkl-gradle:build \
|
||||
./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results :pkl-gradle:build \
|
||||
:pkl-gradle:compatibilityTestReleases \
|
||||
:pkl-gradle:compatibilityTestCandidate
|
||||
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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -656,17 +625,11 @@ jobs:
|
||||
- attach_workspace:
|
||||
at: '.'
|
||||
- run:
|
||||
command: ./gradlew --info --stacktrace publishToSonatype
|
||||
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results publishToSonatype
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -679,17 +642,11 @@ jobs:
|
||||
- attach_workspace:
|
||||
at: '.'
|
||||
- run:
|
||||
command: ./gradlew --info --stacktrace -DreleaseBuild=true publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||
command: ./gradlew --info --stacktrace -DtestReportsDir=${HOME}/test-results -DreleaseBuild=true publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||
- persist_to_workspace:
|
||||
root: '.'
|
||||
paths:
|
||||
- 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:
|
||||
path: ~/test-results
|
||||
environment:
|
||||
@@ -753,6 +710,9 @@ workflows:
|
||||
- gradle-check-jdk21:
|
||||
requires:
|
||||
- hold
|
||||
- gradle-check-jdk17-windows:
|
||||
requires:
|
||||
- hold
|
||||
when:
|
||||
matches:
|
||||
value: << pipeline.git.branch >>
|
||||
@@ -761,6 +721,7 @@ workflows:
|
||||
jobs:
|
||||
- gradle-check-jdk17
|
||||
- gradle-check-jdk21
|
||||
- gradle-check-jdk17-windows
|
||||
- bench
|
||||
- gradle-compatibility
|
||||
- pkl-cli-macOS-amd64-snapshot
|
||||
@@ -768,10 +729,12 @@ workflows:
|
||||
- pkl-cli-macOS-aarch64-snapshot
|
||||
- pkl-cli-linux-aarch64-snapshot
|
||||
- pkl-cli-linux-alpine-amd64-snapshot
|
||||
- pkl-cli-windows-amd64-snapshot
|
||||
- deploy-snapshot:
|
||||
requires:
|
||||
- gradle-check-jdk17
|
||||
- gradle-check-jdk21
|
||||
- gradle-check-jdk17-windows
|
||||
- bench
|
||||
- gradle-compatibility
|
||||
- pkl-cli-macOS-amd64-snapshot
|
||||
@@ -779,6 +742,7 @@ workflows:
|
||||
- pkl-cli-macOS-aarch64-snapshot
|
||||
- pkl-cli-linux-aarch64-snapshot
|
||||
- pkl-cli-linux-alpine-amd64-snapshot
|
||||
- pkl-cli-windows-amd64-snapshot
|
||||
context: pkl-maven-release
|
||||
- trigger-docsite-build:
|
||||
requires:
|
||||
@@ -803,6 +767,12 @@ workflows:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v?\d+\.\d+\.\d+$/
|
||||
- gradle-check-jdk17-windows:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v?\d+\.\d+\.\d+$/
|
||||
- bench:
|
||||
filters:
|
||||
branches:
|
||||
@@ -845,10 +815,17 @@ workflows:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v?\d+\.\d+\.\d+$/
|
||||
- pkl-cli-windows-amd64-release:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v?\d+\.\d+\.\d+$/
|
||||
- github-release:
|
||||
requires:
|
||||
- gradle-check-jdk17
|
||||
- gradle-check-jdk21
|
||||
- gradle-check-jdk17-windows
|
||||
- bench
|
||||
- gradle-compatibility
|
||||
- pkl-cli-macOS-amd64-release
|
||||
@@ -856,6 +833,7 @@ workflows:
|
||||
- pkl-cli-macOS-aarch64-release
|
||||
- pkl-cli-linux-aarch64-release
|
||||
- pkl-cli-linux-alpine-amd64-release
|
||||
- pkl-cli-windows-amd64-release
|
||||
context: pkl-github-release
|
||||
filters:
|
||||
branches:
|
||||
@@ -885,6 +863,7 @@ workflows:
|
||||
jobs:
|
||||
- gradle-check-jdk17
|
||||
- gradle-check-jdk21
|
||||
- gradle-check-jdk17-windows
|
||||
- bench
|
||||
- gradle-compatibility
|
||||
- pkl-cli-macOS-amd64-release
|
||||
@@ -892,6 +871,7 @@ workflows:
|
||||
- pkl-cli-macOS-aarch64-release
|
||||
- pkl-cli-linux-aarch64-release
|
||||
- pkl-cli-linux-alpine-amd64-release
|
||||
- pkl-cli-windows-amd64-release
|
||||
when:
|
||||
matches:
|
||||
value: << pipeline.git.branch >>
|
||||
|
||||
@@ -16,12 +16,9 @@
|
||||
/// Builds the native `pkl` CLI
|
||||
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"
|
||||
|
||||
/// The OS to run on
|
||||
os: "macOS"|"linux"
|
||||
|
||||
/// The architecture to use
|
||||
arch: "amd64"|"aarch64"
|
||||
|
||||
@@ -119,10 +116,14 @@ steps {
|
||||
new Config.RunStep {
|
||||
name = "gradle buildNative"
|
||||
local _os =
|
||||
if (os == "macOS") "mac"
|
||||
if (module.os == "macOS") "mac"
|
||||
else if (musl) "alpine"
|
||||
else if (module.os == "windows") "windows"
|
||||
else "linux"
|
||||
local jobName = "\(_os)Executable\(arch.capitalize())"
|
||||
when (module.os == "windows") {
|
||||
shell = "bash.exe"
|
||||
}
|
||||
command = #"""
|
||||
export PATH=~/staticdeps/bin:$PATH
|
||||
./gradlew \#(module.gradleArgs) pkl-cli:\#(jobName) pkl-core:test\#(jobName.capitalize())
|
||||
@@ -142,7 +143,8 @@ job {
|
||||
xcode = "15.3.0"
|
||||
}
|
||||
resource_class = "macos.m1.large.gen1"
|
||||
} else {
|
||||
}
|
||||
when (os == "linux") {
|
||||
docker {
|
||||
new {
|
||||
image = if (arch == "aarch64") "arm64v8/oraclelinux:8-slim" else "oraclelinux:8-slim"
|
||||
@@ -153,4 +155,10 @@ job {
|
||||
}
|
||||
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"
|
||||
|
||||
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
|
||||
|
||||
@@ -27,6 +27,8 @@ job {
|
||||
}
|
||||
}
|
||||
|
||||
os = "linux"
|
||||
|
||||
steps {
|
||||
new Config.AttachWorkspaceStep { at = "." }
|
||||
new Config.RunStep {
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
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"|"21.0"
|
||||
javaVersion: "17.0"|"21.0"
|
||||
|
||||
os = "linux"
|
||||
|
||||
steps {
|
||||
new Config.RunStep {
|
||||
@@ -27,9 +29,17 @@ steps {
|
||||
}
|
||||
|
||||
job {
|
||||
docker {
|
||||
new {
|
||||
image = "cimg/openjdk:\(javaVersion)"
|
||||
when (os == "linux") {
|
||||
docker {
|
||||
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
|
||||
|
||||
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.
|
||||
isRelease: Boolean = false
|
||||
|
||||
/// The OS to run on
|
||||
os: "macOS"|"linux"|"windows"
|
||||
|
||||
fixed gradleArgs = new Listing {
|
||||
"--info"
|
||||
"--stacktrace"
|
||||
"-DtestReportsDir=${HOME}/test-results"
|
||||
when (isRelease) {
|
||||
"-DreleaseBuild=true"
|
||||
}
|
||||
@@ -37,15 +41,6 @@ job: Config.Job = new {
|
||||
steps {
|
||||
"checkout"
|
||||
...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 {
|
||||
path = "~/test-results"
|
||||
}
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
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
|
||||
|
||||
command: String
|
||||
|
||||
os = "linux"
|
||||
|
||||
steps {
|
||||
new Config.RunStep {
|
||||
name = module.name
|
||||
|
||||
Reference in New Issue
Block a user