From beac37ee57149cf8250d2238222eace57f28140f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 20 Mar 2025 09:25:09 -0700 Subject: [PATCH 1/4] Bump Kotlin to version 2.1.20 --- .github/workflows/bld.yml | 2 +- README.md | 2 +- examples/gradle/build.gradle.kts | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 36e3f2b..64fbb4d 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: java-version: [17, 21, 24] - kotlin-version: [1.9.25, 2.1.10] + kotlin-version: [1.9.25, 2.1.20] steps: - name: Checkout source repository diff --git a/README.md b/README.md index a1047e0..7bff2fb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause) -[![Kotlin](https://img.shields.io/badge/kotlin-2.1.10-7f52ff)](https://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin-2.1.20-7f52ff)](https://kotlinlang.org/) [![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![release](https://img.shields.io/github/release/ethauvin/isgd-shorten.svg)](https://github.com/ethauvin/isgd-shorten/releases/latest) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/isgd-shorten.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/isgd-shorten) diff --git a/examples/gradle/build.gradle.kts b/examples/gradle/build.gradle.kts index fcdbf8b..4154822 100644 --- a/examples/gradle/build.gradle.kts +++ b/examples/gradle/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("application") id("com.github.ben-manes.versions") version "0.51.0" - kotlin("jvm") version "2.1.10" + kotlin("jvm") version "2.1.20" } repositories { diff --git a/pom.xml b/pom.xml index 88cfd2e..927d3ed 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ org.jetbrains.kotlin kotlin-stdlib - 2.1.10 + 2.1.20 compile From 9565170590b5ba9df7c6353a899c0a792cf21086 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 20 Mar 2025 09:25:29 -0700 Subject: [PATCH 2/4] 1.1.1-SNAPSHOT --- pom.xml | 2 +- src/bld/java/net/thauvin/erik/IsgdShortenBuild.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 927d3ed..33a16b9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 net.thauvin.erik isgd-shorten - 1.1.0 + 1.1.1-SNAPSHOT isgd-shorten A simple implementation of the is.gd URL shortening and lookup APIs https://github.com/ethauvin/isgd-shorten diff --git a/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java b/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java index dfe576a..c40fc80 100644 --- a/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java +++ b/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java @@ -60,7 +60,7 @@ public class IsgdShortenBuild extends Project { public IsgdShortenBuild() { pkg = "net.thauvin.erik"; name = "isgd-shorten"; - version = version(1, 1, 0); + version = version(1, 1, 1, "SNAPSHOT"); javaRelease = 11; downloadSources = true; @@ -68,7 +68,7 @@ public class IsgdShortenBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); - final var kotlin = version(2, 1, 10); + final var kotlin = version(2, 1, 20); scope(compile) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("net.thauvin.erik.urlencoder", "urlencoder-lib-jvm", version(1, 6, 0))); From 931533e2f1ab392bfa3b435a04db652eef282c2c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 20 Mar 2025 09:26:16 -0700 Subject: [PATCH 3/4] Add Kotlin compile options for JDK 24 --- src/bld/java/net/thauvin/erik/IsgdShortenBuild.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java b/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java index c40fc80..e7f33fc 100644 --- a/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java +++ b/src/bld/java/net/thauvin/erik/IsgdShortenBuild.java @@ -39,6 +39,7 @@ import rife.bld.extension.DokkaOperation; import rife.bld.extension.JacocoReportOperation; import rife.bld.extension.dokka.LoggingLevel; import rife.bld.extension.dokka.OutputFormat; +import rife.bld.extension.kotlin.CompileOptions; import rife.bld.operations.exceptions.ExitStatusException; import rife.bld.publish.PomBuilder; import rife.bld.publish.PublishDeveloper; @@ -118,8 +119,11 @@ public class IsgdShortenBuild extends Project { @BuildCommand(summary = "Compiles the Kotlin project") @Override public void compile() throws Exception { + final var options = new CompileOptions(); + options.jvmOptions().add("--enable-native-access=ALL-UNNAMED"); new CompileKotlinOperation() .fromProject(this) + .compileOptions(options) .execute(); } From 0a004926ded16a6caa5ae46599a8811996a5ec6c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 20 Mar 2025 09:28:46 -0700 Subject: [PATCH 4/4] Add Kotlin compile options for JDK 24 --- src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt b/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt index c48609c..9157567 100644 --- a/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt +++ b/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt @@ -33,7 +33,7 @@ package net.thauvin.erik.isgd import net.thauvin.erik.urlencoder.UrlEncoderUtil import java.net.HttpURLConnection -import java.net.URL +import java.net.URI /** * See the [is.gd API](https://is.gd/apishorteningreference.php). @@ -50,7 +50,7 @@ fun String.encode(): String = UrlEncoderUtil.encode(this) class Isgd private constructor() { companion object { private fun callApi(url: String): String { - val connection = URL(url).openConnection() as HttpURLConnection + val connection = URI(url).toURL().openConnection() as HttpURLConnection try { connection.setRequestProperty( "User-Agent",