Skip to content

Commit 1ae11b4

Browse files
authored
Update JDK to 21.0 (#813)
* Update JDK to 21.0 * Update wordpress.Dockerfile's JDK version to 21
1 parent 8abd219 commit 1ae11b4

File tree

7 files changed

+19
-9
lines changed

7 files changed

+19
-9
lines changed

native/kotlin/.java-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17.0
1+
21.0

native/kotlin/api/android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
java {
99
toolchain {
10-
languageVersion.set(JavaLanguageVersion.of(17))
10+
languageVersion.set(JavaLanguageVersion.of(21))
1111
}
1212
}
1313

native/kotlin/api/kotlin/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ java {
1111
withJavadocJar()
1212
withSourcesJar()
1313

14-
sourceCompatibility = JavaVersion.VERSION_17
15-
targetCompatibility = JavaVersion.VERSION_17
14+
sourceCompatibility = JavaVersion.VERSION_21
15+
targetCompatibility = JavaVersion.VERSION_21
1616
toolchain {
17-
languageVersion.set(JavaLanguageVersion.of(17))
17+
languageVersion.set(JavaLanguageVersion.of(21))
1818
}
1919
}
2020

native/kotlin/api/kotlin/src/integrationTest/kotlin/ApiUrlDiscoveryTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,5 @@ private fun FetchAndParseApiRootFailure.getRequestExecutionErrorReason(): Reques
342342
private fun RequestExecutionException.reason(): RequestExecutionErrorReason? {
343343
return when (this) {
344344
is RequestExecutionException.RequestExecutionFailed -> this.reason
345-
else -> null
346345
}
347346
}

native/kotlin/api/kotlin/src/integrationTest/kotlin/TestCredentials.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import kotlinx.serialization.SerialName
44
import kotlinx.serialization.Serializable
55
import kotlinx.serialization.json.Json
66
import java.io.File
7+
import java.net.URI
78
import java.net.URL
89
import java.text.SimpleDateFormat
910
import java.util.TimeZone
@@ -66,5 +67,5 @@ data class TestCredentials(
6667
}
6768
}
6869

69-
val apiRootUrl by lazy { URL("$siteUrl/wp-json") }
70+
val apiRootUrl by lazy { URI("$siteUrl/wp-json").toURL() }
7071
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package rs.wordpress.api.kotlin
22

33
import uniffi.wp_api.ParsedUrl
4+
import java.net.URI
45
import java.net.URL
56

67
operator fun ParsedUrl.Companion.invoke(url: URL) = parse(url.toString())
78

8-
fun ParsedUrl.toURL(): URL = URL(this.url())
9+
fun ParsedUrl.toURL(): URL = URI(this.url()).toURL()

wordpress.Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
FROM public.ecr.aws/docker/library/wordpress:${WORDPRESS_VERSION:-latest}
22

33
RUN apt-get update \
4-
&& apt-get install -y openjdk-17-jdk-headless android-sdk wget default-mysql-client less libssl-dev jo \
4+
&& apt-get install -y wget gpg
5+
6+
# https://docs.aws.amazon.com/corretto/latest/corretto-21-ug/generic-linux-install.html
7+
# To use the Corretto Apt repositories on Debian-based systems, such as Ubuntu, import the \
8+
# Corretto public key and then add the repository to the system list by using the following commands:
9+
RUN wget -O - https://apt.corretto.aws/corretto.key | gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg && \
10+
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | tee /etc/apt/sources.list.d/corretto.list
11+
12+
RUN apt-get update \
13+
&& apt-get install -y java-21-amazon-corretto-jdk android-sdk wget default-mysql-client less libssl-dev jo \
514
&& apt-get -y autoclean
615

716
# Install wp-cli

0 commit comments

Comments
 (0)