JDK version bump cleaups, bump minimum Gradle version to 8.1 (#454)

* Bump JDK when running simple gradle CI jobs
* Bump minimum Gradle version to 8.1
* Fix docs, and fix minimum version checker
This commit is contained in:
Daniel Chao
2024-04-26 10:42:39 -04:00
committed by GitHub
parent a7c7e51180
commit e28d747418
17 changed files with 21 additions and 25 deletions
+2 -2
View File
@@ -628,7 +628,7 @@ jobs:
environment: environment:
LANG: en_US.UTF-8 LANG: en_US.UTF-8
docker: docker:
- image: cimg/openjdk:11.0 - image: cimg/openjdk:17.0
gradle-compatibility: gradle-compatibility:
steps: steps:
- checkout - checkout
@@ -649,7 +649,7 @@ jobs:
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
+1 -1
View File
@@ -32,6 +32,6 @@ steps {
job { job {
docker { docker {
new { image = "cimg/openjdk:11.0" } new { image = "cimg/openjdk:17.0" }
} }
} }
+2 -2
View File
@@ -2,11 +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
. (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
+1 -1
View File
@@ -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}`.
@@ -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
@@ -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
@@ -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
+3 -3
View File
@@ -37,7 +37,7 @@ 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, may work on other platforms) * Java executable (tested with Java 17/21 on macOS and Oracle Linux, may work on other platforms)
On macOS and Linux, we recommend using the native executables. On macOS and Linux, 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.
@@ -50,7 +50,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.
@@ -190,7 +190,7 @@ 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)
---- ----
=== Windows support === Windows support
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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}`.
+1 -1
View File
@@ -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[]
+1 -1
View File
@@ -321,7 +321,7 @@ publishing {
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())
} }
} }
@@ -1201,8 +1201,7 @@ result = someLib.x
val err = val err =
assertThrows<CliException> { evalModuleThatImportsPackage(builtInCerts, packageServer.port) } assertThrows<CliException> { evalModuleThatImportsPackage(builtInCerts, packageServer.port) }
assertThat(err) assertThat(err)
// on some JDK11's this doesn't cause SSLHandshakeException but some other SSLException .hasMessageContaining("Error during SSL handshake with host `localhost`:")
// .hasMessageContaining("Error during SSL handshake with host `localhost`:")
.hasMessageContaining("unable to find valid certification path to requested target") .hasMessageContaining("unable to find valid certification path to requested target")
.hasMessageNotContainingAny("java.", "sun.") // class names have been filtered out .hasMessageNotContainingAny("java.", "sun.") // class names have been filtered out
} }
@@ -101,9 +101,6 @@ final class JdkHttpClient implements HttpClient {
"errorSslHandshake", request.uri().getHost(), Exceptions.getRootReason(e))); "errorSslHandshake", request.uri().getHost(), Exceptions.getRootReason(e)));
} catch (SSLException e) { } catch (SSLException e) {
throw new SSLException(Exceptions.getRootReason(e)); throw new SSLException(Exceptions.getRootReason(e));
} catch (IOException e) {
// JDK 11 throws IOException instead of SSLHandshakeException
throw new IOException(Exceptions.getRootReason(e));
} catch (InterruptedException e) { } catch (InterruptedException e) {
// next best thing after letting (checked) InterruptedException bubble up // next best thing after letting (checked) InterruptedException bubble up
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
+1 -1
View File
@@ -65,7 +65,7 @@ gradlePlugin {
gradlePluginTests { gradlePluginTests {
// keep in sync with `PklPlugin.MIN_GRADLE_VERSION` // keep in sync with `PklPlugin.MIN_GRADLE_VERSION`
minGradleVersion = GradleVersion.version("7.2") minGradleVersion = GradleVersion.version("8.1")
maxGradleVersion = GradleVersion.version("8.99") maxGradleVersion = GradleVersion.version("8.99")
skippedGradleVersions = listOf() skippedGradleVersions = listOf()
} }
@@ -62,7 +62,7 @@ import org.pkl.gradle.task.TestTask;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class PklPlugin implements Plugin<Project> { public class PklPlugin implements Plugin<Project> {
private static final String MIN_GRADLE_VERSION = "7.2"; private static final String MIN_GRADLE_VERSION = "8.1";
@LateInit private Project project; @LateInit private Project project;
+2 -2
View File
@@ -35,8 +35,8 @@ dependencyResolutionManagement {
} }
val javaVersion = JavaVersion.current() val javaVersion = JavaVersion.current()
require(javaVersion.isJava11Compatible) { require(javaVersion.isCompatibleWith(JavaVersion.VERSION_17)) {
"Project requires Java 11 or higher, but found ${javaVersion.majorVersion}." "Project requires Java 17 or higher, but found ${javaVersion.majorVersion}."
} }
if (gradle.startParameter.taskNames.contains("updateDependencyLocks") || if (gradle.startParameter.taskNames.contains("updateDependencyLocks") ||