Compare commits
5 commits
d39542478f
...
7df1c20e82
Author | SHA1 | Date | |
---|---|---|---|
7df1c20e82 | |||
f737077b1d | |||
40568463dd | |||
b2163c7ee7 | |||
7ba1b0ecf6 |
5 changed files with 12 additions and 7 deletions
2
.github/workflows/bld.yml
vendored
2
.github/workflows/bld.yml
vendored
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://kotlinlang.org/)
|
||||
[](https://kotlinlang.org/)
|
||||
[](https://rife2.com/bld)
|
||||
[](https://github.com/ethauvin/jokeapi/releases/latest)
|
||||
[](https://central.sonatype.com/artifact/net.thauvin.erik/jokeapi)
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.thauvin.erik</groupId>
|
||||
<artifactId>jokeapi</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<name>jokeapi</name>
|
||||
<description>Retrieve jokes from Sv443's JokeAPI</description>
|
||||
<url>https://github.com/ethauvin/jokeapi</url>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>2.1.10</version>
|
||||
<version>2.1.20</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -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;
|
||||
|
@ -60,14 +61,14 @@ public class JokeApiBuild extends Project {
|
|||
public JokeApiBuild() {
|
||||
pkg = "net.thauvin.erik";
|
||||
name = "jokeapi";
|
||||
version = version(1, 0, 0);
|
||||
version = version(1, 0, 1, "SNAPSHOT");
|
||||
|
||||
javaRelease = 11;
|
||||
downloadSources = true;
|
||||
autoDownloadPurge = true;
|
||||
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("org.json", "json", "20250107"))
|
||||
|
@ -121,8 +122,11 @@ public class JokeApiBuild 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();
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import net.thauvin.erik.jokeapi.models.*
|
|||
import org.json.JSONObject
|
||||
import java.io.IOException
|
||||
import java.net.HttpURLConnection
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
import java.util.logging.Level
|
||||
|
||||
|
@ -50,7 +51,7 @@ internal fun fetchUrl(url: String, auth: String = ""): JokeResponse {
|
|||
JokeApi.logger.fine(url)
|
||||
}
|
||||
|
||||
val connection = URL(url).openConnection() as HttpURLConnection
|
||||
val connection = URI(url).toURL().openConnection() as HttpURLConnection
|
||||
try {
|
||||
connection.setRequestProperty(
|
||||
"User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue