Compare commits

...

31 commits

Author SHA1 Message Date
c31189d64d
Bump Gradle to version 8.14 2025-04-25 09:34:28 -07:00
7528d0c562
Bump JUnit to version 5.12.2 2025-04-13 13:33:56 -07:00
b8414295ac
Bump JaCoCo Report extension to version 0.9.10 2025-04-13 13:33:36 -07:00
5aeb195a17
Fix typo 2025-03-26 12:39:16 -07:00
41b01a235b
Add extensions logging 2025-03-26 11:13:38 -07:00
ca817dbafd
Cleaned up compile options 2025-03-26 11:07:00 -07:00
5565b5bc82
Updated extensions to latest snapshots 2025-03-26 11:01:39 -07:00
7e152bea7c
Fix Kotlin coverage version 2025-03-26 10:58:15 -07:00
05cf2cb214
Fix Kotlin extension version 2025-03-26 10:24:49 -07:00
74d1e572e9
Updated extensions
Bump JaCoCo Report extension to version 0.9.10-SNAPSHOT
Bump Kotlin extension to version 1.1.10-SNAPSHOT
2025-03-26 10:23:12 -07:00
1c78c96180
Use 1.1.1-SNAPSHOT in examples 2025-03-26 10:15:17 -07:00
9192cfd175
Add OS matrix for Ubuntu, Windows and macOS 2025-03-26 10:13:27 -07:00
d3418fb51b
Combine Kotlin compile options 2025-03-20 20:40:52 -07:00
0a004926de
Add Kotlin compile options for JDK 24 2025-03-20 09:28:46 -07:00
931533e2f1
Add Kotlin compile options for JDK 24 2025-03-20 09:26:16 -07:00
9565170590
1.1.1-SNAPSHOT 2025-03-20 09:25:29 -07:00
beac37ee57
Bump Kotlin to version 2.1.20 2025-03-20 09:25:09 -07:00
1692096ff7
JDK 24 2025-03-18 23:50:26 -07:00
3eb192fde4
Add Junit Platform Launcher dependency 2025-03-18 04:26:20 -07:00
abb1d3d12d
Minor cleanup 2025-03-17 12:07:04 -07:00
111c47daec
Add kotlinc to IDEA project 2025-03-16 23:09:21 -07:00
5caab7adb7
Version 1.1.0 2025-03-16 23:07:44 -07:00
fb7f7b3c3a
Version 1.0.2 2025-03-16 23:07:43 -07:00
b91c2756db
Update copyright 2025-03-16 23:07:43 -07:00
0a843c06ec
Make sure the connection is always disconnected 2025-03-16 23:07:43 -07:00
29a5448391
Bump JUnit to version 5.12.1 2025-03-16 23:07:42 -07:00
b80e1b2d85
Bump UrlEncoder to version 1.6.0 2025-03-16 23:07:42 -07:00
2c6f8ce777
Update extension dependencies
Bump Detekt to version 0.9.9
Bump Dokka to version 1.0.3
Bump Jacoco Report to version 0.9.9
2025-03-16 23:07:41 -07:00
2ebc62b899
Bump Kotlin to version 2.1.10 2025-03-16 23:07:41 -07:00
d7cbcb5a07
Bump Gradle to version 8.13 2025-03-16 23:07:40 -07:00
94196e3dc4
Bump bld to version 2.2.1 2025-03-16 23:07:30 -07:00
26 changed files with 119 additions and 67 deletions

View file

@ -21,7 +21,7 @@ commands:
- sdkman/setup-sdkman - sdkman/setup-sdkman
- sdkman/sdkman-install: - sdkman/sdkman-install:
candidate: kotlin candidate: kotlin
version: 2.0.20 version: 2.1.10
- run: - run:
name: Download dependencies name: Download dependencies
command: ./bld download command: ./bld download
@ -46,11 +46,11 @@ jobs:
steps: steps:
- build_and_test - build_and_test
bld_jdk20: bld_jdk21:
<<: *defaults <<: *defaults
docker: docker:
- image: cimg/openjdk:20.0 - image: cimg/openjdk:21.0
steps: steps:
- build_and_test - build_and_test
@ -59,4 +59,4 @@ workflows:
bld: bld:
jobs: jobs:
- bld_jdk17 - bld_jdk17
- bld_jdk20 - bld_jdk21

View file

@ -4,17 +4,17 @@ on: [push, pull_request, workflow_dispatch]
env: env:
COVERAGE_JDK: "21" COVERAGE_JDK: "21"
COVERAGE_KOTLIN: "2.0.0" COVERAGE_KOTLIN: "2.0.21"
KOTLIN_HOME: /usr/share/kotlinc
jobs: jobs:
build-bld-project: build-bld-project:
runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
java-version: [17, 21, 22] java-version: [17, 21, 24]
kotlin-version: [1.19.24, 2.0.20] kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout source repository - name: Checkout source repository
@ -28,6 +28,23 @@ jobs:
distribution: "zulu" distribution: "zulu"
java-version: ${{ matrix.java-version }} java-version: ${{ matrix.java-version }}
- name: Download dependencies [bld example]
working-directory: examples/bld
run: ./bld download
- name: Compile and run examples [bld example]
working-directory: examples/bld
run: |
./bld compile
./bld run --args='https://www.example.com https://is.gd/Pt2sET'
./bld run-java --args='https://www.example.com https://is.gd/Pt2sET'
- name: Run examples [gradle example]
working-directory: examples/gradle
run: |
./gradlew run --args='https://www.example.com https://is.gd/Pt2sET'
./gradlew runJava --args='https://www.example.com https://is.gd/Pt2sET'
- name: Download dependencies - name: Download dependencies
run: ./bld download run: ./bld download
@ -39,11 +56,13 @@ jobs:
- name: Remove pom.xml - name: Remove pom.xml
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
&& matrix.os == 'ubuntu-latest'
run: rm -rf pom.xml run: rm -rf pom.xml
- name: SonarCloud Scan - name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master uses: sonarsource/sonarcloud-github-action@master
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
&& matrix.os == 'ubuntu-latest'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View file

@ -4,5 +4,6 @@
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="created" /> <option name="ADDITIONAL_TAGS" value="created" />
</inspection_tool> </inspection_tool>
<inspection_tool class="UsePropertyAccessSyntax" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
</profile> </profile>
</component> </component>

13
.idea/kotlinc.xml generated Normal file
View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JsCompilerArguments">
<option name="moduleKind" value="plain" />
</component>
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="1.8" />
</component>
<component name="KotlinCommonCompilerArguments">
<option name="apiVersion" value="2.0" />
<option name="languageVersion" value="2.0" />
</component>
</project>

View file

@ -2,12 +2,12 @@
<library name="bld"> <library name="bld">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" /> <root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -1,4 +1,4 @@
Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:

View file

@ -1,6 +1,6 @@
[![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.0.20-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.1.0-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)
[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/isgd-shorten?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/isgd-shorten/) [![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/isgd-shorten?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/isgd-shorten/)
@ -19,7 +19,7 @@ A simple implementation of the [is.gd](https://is.gd/) URL shortening and lookup
```kotlin ```kotlin
import net.thauvin.erik.isgd.Isgd import net.thauvin.erik.isgd.Isgd
... // ...
Isgd.shorten("https://www.example.com/") // returns https://is.gd/Pt2sET Isgd.shorten("https://www.example.com/") // returns https://is.gd/Pt2sET
Isgd.lookup("https://is.gd/Pt2sET") // returns https://www.example.com Isgd.lookup("https://is.gd/Pt2sET") // returns https://www.example.com
@ -69,10 +69,10 @@ To use with [bld](https://rife2.com/bld), include the following dependency in yo
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY); repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
scope(compile) scope(compile)
.include("net.thauvin.erik:isgd-shorten:1.0.`"); .include("net.thauvin.erik:isgd-shorten:1.1.0");
``` ```
## Gradle ## Gradle, Maven, etc...
To use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/isgd-shorten/blob/master/examples/gradle/build.gradle.kts) file: To use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/isgd-shorten/blob/master/examples/gradle/build.gradle.kts) file:
@ -83,7 +83,7 @@ repositories {
} }
dependencies { dependencies {
implementation("net.thauvin.erik:isgd-shorten:1.0.1") implementation("net.thauvin.erik:isgd-shorten:1.1.0")
} }
``` ```

View file

@ -2,12 +2,12 @@
<library name="bld"> <library name="bld">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" /> <root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -9,7 +9,7 @@
], ],
"java.configuration.updateBuildConfiguration": "automatic", "java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [ "java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.1.0.jar", "${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar" "lib/**/*.jar"
] ]
} }

Binary file not shown.

View file

@ -1,8 +1,8 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8 bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2 bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories= bld.sourceDirectories=
bld.version=2.1.0 bld.version=2.2.1

View file

@ -24,7 +24,7 @@ public class ExampleBuild extends BaseProject {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
scope(compile) scope(compile)
.include(dependency("net.thauvin.erik:isgd-shorten:1.0.2-SNAPSHOT")); .include(dependency("net.thauvin.erik:isgd-shorten:1.1.1-SNAPSHOT"));
} }
public static void main(String[] args) { public static void main(String[] args) {

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.0.20" kotlin("jvm") version "2.1.20"
} }
repositories { repositories {
@ -13,7 +13,7 @@ repositories {
} }
dependencies { dependencies {
implementation("net.thauvin.erik:isgd-shorten:1.0.2-SNAPSHOT") implementation("net.thauvin.erik:isgd-shorten:1.1.1-SNAPSHOT")
} }
java { java {

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -115,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped. # and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line. # treated as '${Hostname}' itself on the command line.
@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.

View file

@ -70,11 +70,11 @@ goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

Binary file not shown.

View file

@ -1,10 +1,10 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.7 bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT
bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.1 bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.4-SNAPSHOT
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8 bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2 bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories= bld.sourceDirectories=
bld.version=2.1.0 bld.version=2.2.1

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.0.2-SNAPSHOT</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,13 +18,13 @@
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId> <artifactId>kotlin-stdlib</artifactId>
<version>2.0.20</version> <version>2.1.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.thauvin.erik.urlencoder</groupId> <groupId>net.thauvin.erik.urlencoder</groupId>
<artifactId>urlencoder-lib-jvm</artifactId> <artifactId>urlencoder-lib-jvm</artifactId>
<version>1.5.0</version> <version>1.6.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -1,7 +1,7 @@
/* /*
* IsgdShortenBuild.java * IsgdShortenBuild.java
* *
* Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) * Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -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;
@ -49,6 +50,9 @@ import rife.tools.exceptions.FileUtilsErrorException;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import static rife.bld.dependencies.Repository.*; import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile; import static rife.bld.dependencies.Scope.compile;
@ -60,7 +64,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, 0, 2, "SNAPSHOT"); version = version(1, 1, 1, "SNAPSHOT");
javaRelease = 11; javaRelease = 11;
downloadSources = true; downloadSources = true;
@ -68,14 +72,15 @@ public class IsgdShortenBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
final var kotlin = version(2, 0, 20); 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, 5, 0))); .include(dependency("net.thauvin.erik.urlencoder", "urlencoder-lib-jvm", version(1, 6, 0)));
scope(test) scope(test)
.include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 2)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 2)))
.include(dependency("org.junit.platform", "junit-platform-launcher", version(1, 12, 2)))
.include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1))); .include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1)));
publishOperation() publishOperation()
@ -111,6 +116,16 @@ public class IsgdShortenBuild extends Project {
} }
public static void main(String[] args) { public static void main(String[] args) {
// Enable detailed logging for the extensions
var level = Level.ALL;
var logger = Logger.getLogger("rife.bld.extension");
var consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(level);
logger.addHandler(consoleHandler);
logger.setLevel(level);
logger.setUseParentHandlers(false);
new IsgdShortenBuild().start(args); new IsgdShortenBuild().start(args);
} }
@ -119,6 +134,7 @@ public class IsgdShortenBuild extends Project {
public void compile() throws Exception { public void compile() throws Exception {
new CompileKotlinOperation() new CompileKotlinOperation()
.fromProject(this) .fromProject(this)
.compileOptions(new CompileOptions().verbose(true))
.execute(); .execute();
} }

View file

@ -1,7 +1,7 @@
/* /*
* Isgd.kt * Isgd.kt
* *
* Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) * Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -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,8 @@ 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 {
connection.setRequestProperty( connection.setRequestProperty(
"User-Agent", "User-Agent",
"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
@ -62,6 +63,9 @@ class Isgd private constructor() {
connection.responseCode, connection.responseCode,
connection.errorStream.bufferedReader().use { it.readText() }) connection.errorStream.bufferedReader().use { it.readText() })
} }
} finally {
connection.disconnect()
}
} }
private fun getHost(isVgd: Boolean = false): String { private fun getHost(isVgd: Boolean = false): String {

View file

@ -1,7 +1,7 @@
/* /*
* IsgdException.kt * IsgdException.kt
* *
* Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) * Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:

View file

@ -1,7 +1,7 @@
/* /*
* LookupConfig.kt * LookupConfig.kt
* *
* Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) * Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:

View file

@ -1,7 +1,7 @@
/* /*
* ShortenConfig.kt * ShortenConfig.kt
* *
* Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) * Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:

View file

@ -1,7 +1,7 @@
/* /*
* IsgdTest.kt * IsgdTest.kt
* *
* Copyright 2020-2024 Erik C. Thauvin (erik@thauvin.net) * Copyright 2020-2025 Erik C. Thauvin (erik@thauvin.net)
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met: