Compare commits

...

4 commits

6 changed files with 13 additions and 9 deletions

View file

@ -14,7 +14,7 @@ jobs:
strategy: strategy:
matrix: matrix:
java-version: [17, 21, 24] java-version: [17, 21, 24]
kotlin-version: [1.9.25, 2.1.10] kotlin-version: [1.9.25, 2.1.20]
steps: steps:
- name: Checkout source repository - name: Checkout source repository

View file

@ -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) [![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) [![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) [![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) [![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)

View file

@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("application") id("application")
id("com.github.ben-manes.versions") version "0.51.0" id("com.github.ben-manes.versions") version "0.51.0"
kotlin("jvm") version "2.1.10" kotlin("jvm") version "2.1.20"
} }
repositories { repositories {

View file

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.thauvin.erik</groupId> <groupId>net.thauvin.erik</groupId>
<artifactId>isgd-shorten</artifactId> <artifactId>isgd-shorten</artifactId>
<version>1.1.0</version> <version>1.1.1-SNAPSHOT</version>
<name>isgd-shorten</name> <name>isgd-shorten</name>
<description>A simple implementation of the is.gd URL shortening and lookup APIs</description> <description>A simple implementation of the is.gd URL shortening and lookup APIs</description>
<url>https://github.com/ethauvin/isgd-shorten</url> <url>https://github.com/ethauvin/isgd-shorten</url>
@ -18,7 +18,7 @@
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId> <artifactId>kotlin-stdlib</artifactId>
<version>2.1.10</version> <version>2.1.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -39,6 +39,7 @@ import rife.bld.extension.DokkaOperation;
import rife.bld.extension.JacocoReportOperation; import rife.bld.extension.JacocoReportOperation;
import rife.bld.extension.dokka.LoggingLevel; import rife.bld.extension.dokka.LoggingLevel;
import rife.bld.extension.dokka.OutputFormat; import rife.bld.extension.dokka.OutputFormat;
import rife.bld.extension.kotlin.CompileOptions;
import rife.bld.operations.exceptions.ExitStatusException; import rife.bld.operations.exceptions.ExitStatusException;
import rife.bld.publish.PomBuilder; import rife.bld.publish.PomBuilder;
import rife.bld.publish.PublishDeveloper; import rife.bld.publish.PublishDeveloper;
@ -60,7 +61,7 @@ public class IsgdShortenBuild extends Project {
public IsgdShortenBuild() { public IsgdShortenBuild() {
pkg = "net.thauvin.erik"; pkg = "net.thauvin.erik";
name = "isgd-shorten"; name = "isgd-shorten";
version = version(1, 1, 0); version = version(1, 1, 1, "SNAPSHOT");
javaRelease = 11; javaRelease = 11;
downloadSources = true; downloadSources = true;
@ -68,7 +69,7 @@ public class IsgdShortenBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
final var kotlin = version(2, 1, 10); final var kotlin = version(2, 1, 20);
scope(compile) scope(compile)
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
.include(dependency("net.thauvin.erik.urlencoder", "urlencoder-lib-jvm", version(1, 6, 0))); .include(dependency("net.thauvin.erik.urlencoder", "urlencoder-lib-jvm", version(1, 6, 0)));
@ -118,8 +119,11 @@ public class IsgdShortenBuild extends Project {
@BuildCommand(summary = "Compiles the Kotlin project") @BuildCommand(summary = "Compiles the Kotlin project")
@Override @Override
public void compile() throws Exception { public void compile() throws Exception {
final var options = new CompileOptions();
options.jvmOptions().add("--enable-native-access=ALL-UNNAMED");
new CompileKotlinOperation() new CompileKotlinOperation()
.fromProject(this) .fromProject(this)
.compileOptions(options)
.execute(); .execute();
} }

View file

@ -33,7 +33,7 @@ package net.thauvin.erik.isgd
import net.thauvin.erik.urlencoder.UrlEncoderUtil import net.thauvin.erik.urlencoder.UrlEncoderUtil
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.URL import java.net.URI
/** /**
* See the [is.gd API](https://is.gd/apishorteningreference.php). * 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() { class Isgd private constructor() {
companion object { companion object {
private fun callApi(url: String): String { private fun callApi(url: String): String {
val connection = URL(url).openConnection() as HttpURLConnection val connection = URI(url).toURL().openConnection() as HttpURLConnection
try { try {
connection.setRequestProperty( connection.setRequestProperty(
"User-Agent", "User-Agent",