Compare commits

..

No commits in common. "7df1c20e821bd45f9bd8a12ae9c2dc13ae5cc660" and "d39542478fc23314b37a6d4a04bc1925ac917324" have entirely different histories.

5 changed files with 7 additions and 12 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.20] kotlin-version: [1.9.25, 2.1.10]
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.20-7f52ff)](https://kotlinlang.org/) [![Kotlin](https://img.shields.io/badge/kotlin-2.1.10-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/jokeapi.svg)](https://github.com/ethauvin/jokeapi/releases/latest) [![Release](https://img.shields.io/github/release/ethauvin/jokeapi.svg)](https://github.com/ethauvin/jokeapi/releases/latest)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/jokeapi?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/jokeapi) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/jokeapi?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/jokeapi)

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>jokeapi</artifactId> <artifactId>jokeapi</artifactId>
<version>1.0.1-SNAPSHOT</version> <version>1.0.0</version>
<name>jokeapi</name> <name>jokeapi</name>
<description>Retrieve jokes from Sv443&apos;s JokeAPI</description> <description>Retrieve jokes from Sv443&apos;s JokeAPI</description>
<url>https://github.com/ethauvin/jokeapi</url> <url>https://github.com/ethauvin/jokeapi</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.20</version> <version>2.1.10</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -39,7 +39,6 @@ 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;
@ -61,14 +60,14 @@ public class JokeApiBuild extends Project {
public JokeApiBuild() { public JokeApiBuild() {
pkg = "net.thauvin.erik"; pkg = "net.thauvin.erik";
name = "jokeapi"; name = "jokeapi";
version = version(1, 0, 1, "SNAPSHOT"); version = version(1, 0, 0);
javaRelease = 11; javaRelease = 11;
downloadSources = true; downloadSources = true;
autoDownloadPurge = true; autoDownloadPurge = true;
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
final var kotlin = version(2, 1, 20); final var kotlin = version(2, 1, 10);
scope(compile) scope(compile)
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
.include(dependency("org.json", "json", "20250107")) .include(dependency("org.json", "json", "20250107"))
@ -122,11 +121,8 @@ public class JokeApiBuild 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

@ -39,7 +39,6 @@ import net.thauvin.erik.jokeapi.models.*
import org.json.JSONObject import org.json.JSONObject
import java.io.IOException import java.io.IOException
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.URI
import java.net.URL import java.net.URL
import java.util.logging.Level import java.util.logging.Level
@ -51,7 +50,7 @@ internal fun fetchUrl(url: String, auth: String = ""): JokeResponse {
JokeApi.logger.fine(url) JokeApi.logger.fine(url)
} }
val connection = URI(url).toURL().openConnection() as HttpURLConnection val connection = URL(url).openConnection() as HttpURLConnection
try { try {
connection.setRequestProperty( connection.setRequestProperty(
"User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0" "User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0"