diff --git a/.circleci/config.yml b/.circleci/config.yml index 09d8896..c5e20a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,14 @@ defaults: &defaults defaults_bld: &defaults_bld steps: - checkout + - run: + name: Install Kotlin via SDKMAN! + command: | + curl -s "https://get.sdkman.io" | bash + echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config + echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config + source "$HOME/.sdkman/bin/sdkman-init.sh" + sdk install kotlin 2.0.0 - run: name: Download the bld dependencies command: ./bld download diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 28175b0..21c09a8 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -8,10 +8,12 @@ jobs: env: COVERAGE_SDK: "17" + COVERAGE_KOTLIN: "2.0.0" strategy: matrix: java-version: [17, 21, 22] + kotlin-version: [1.9.24, 2.0.0] steps: - name: Checkout source repository @@ -48,12 +50,11 @@ jobs: run: ./bld jacoco - name: Remove pom.xml - if: success() && matrix.java-version == env.COVERAGE_SDK run: rm -rf pom.xml - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master - if: success() && matrix.java-version == env.COVERAGE_SDK + if: success() && matrix.java-version == env.COVERAGE_SDK && matrix.kotlin-version == env.COVERAGE_KOTLIN env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2398bba..14646f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: openjdk:17 +image: ubuntu:latest variables: CI_NAME: "GitLab CI" @@ -6,9 +6,19 @@ variables: stages: - test +before_script: + - apt-get update -qq && apt-get install -y curl zip + - curl -s "https://get.sdkman.io" | bash + - echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config + - echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config + - source "$HOME/.sdkman/bin/sdkman-init.sh" + - sdk install java 17.0.11-tem + - sdk install kotlin 2.0.0 + - source "$HOME/.sdkman/bin/sdkman-init.sh" + test: stage: test script: - - ./bld download - - ./bld compile - - ./bld test + - ./bld download + - ./bld compile + - ./bld test diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 7c85194..5951f4b 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,10 +1,20 @@ -image: openjdk:17 +image: ubuntu:latest pipelines: default: - step: name: Test with bld script: + # Install Java & Kotlin via SDKMAN! + - apt-get update -qq && apt-get install -y curl zip + - curl -s "https://get.sdkman.io" | bash + - echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config + - echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config + - source "$HOME/.sdkman/bin/sdkman-init.sh" + - sdk install java 17.0.11-tem + - sdk install kotlin 2.0.0 + - source "$HOME/.sdkman/bin/sdkman-init.sh" + # Download, compile and test with bld - ./bld download - ./bld compile - ./bld test diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 1695c0b..0aa69b0 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,10 +1,10 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5 -bld.extensions=com.uwyn.rife2:bld-generated-version:0.9.6 -bld.extensions-kotlin=com.uwyn.rife2:bld-kotlin:0.9.8 -bld.extensions-detekt=com.uwyn.rife2:bld-detekt:0.9.4 -bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= +bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.4 +bld.extension-gv=com.uwyn.rife2:bld-generated-version:0.9.8-SNAPSHOT +bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.6 +bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT +bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.sourceDirectories= bld.version=1.9.1 diff --git a/pom.xml b/pom.xml index 3ef1964..8fa40d6 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ commons-net commons-net - 3.10.0 + 3.11.1 compile @@ -48,13 +48,13 @@ com.google.guava guava - 33.2.0-jre + 33.2.1-jre compile com.google.cloud google-cloud-vertexai - 1.4.0 + 1.6.0 compile @@ -150,7 +150,7 @@ org.jsoup jsoup - 1.17.2 + 1.18.1 compile diff --git a/src/bld/java/net/thauvin/erik/MobibotBuild.java b/src/bld/java/net/thauvin/erik/MobibotBuild.java index 8a7265e..e9343c5 100644 --- a/src/bld/java/net/thauvin/erik/MobibotBuild.java +++ b/src/bld/java/net/thauvin/erik/MobibotBuild.java @@ -86,11 +86,11 @@ public class MobibotBuild extends Project { .include(dependency("org.apache.commons", "commons-lang3", "3.14.0")) .include(dependency("org.apache.commons", "commons-text", "1.12.0")) .include(dependency("commons-codec", "commons-codec", "1.17.0")) - .include(dependency("commons-net", "commons-net", "3.10.0")) + .include(dependency("commons-net", "commons-net", "3.11.1")) // Google .include(dependency("com.google.code.gson", "gson", "2.11.0")) - .include(dependency("com.google.guava", "guava", "33.2.0-jre")) - .include(dependency("com.google.cloud", "google-cloud-vertexai", "1.4.0")) + .include(dependency("com.google.guava", "guava", "33.2.1-jre")) + .include(dependency("com.google.cloud", "google-cloud-vertexai", "1.6.0")) // Kotlin .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-common", kotlin)) @@ -109,7 +109,7 @@ public class MobibotBuild extends Project { .include(dependency("net.aksingh", "owm-japis", "2.5.3.0")) .include(dependency("net.objecthunter", "exp4j", "0.4.8")) .include(dependency("org.json", "json", "20240303")) - .include(dependency("org.jsoup", "jsoup", "1.17.2")) + .include(dependency("org.jsoup", "jsoup", "1.18.1")) // Thauvin .include(dependency("net.thauvin.erik", "cryptoprice", "1.0.3-SNAPSHOT")) .include(dependency("net.thauvin.erik", "jokeapi", "0.9.2-SNAPSHOT")) @@ -118,8 +118,8 @@ public class MobibotBuild extends Project { scope(test) .include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1))) .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin)) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2))); + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3))); List jars = new ArrayList<>(); runtimeClasspathJars().forEach(f -> jars.add("./lib/" + f.getName())); @@ -189,7 +189,7 @@ public class MobibotBuild extends Project { } @BuildCommand(summary = "Generates JaCoCo Reports") - public void jacoco() throws IOException { + public void jacoco() throws Exception { new JacocoReportOperation() .fromProject(this) .sourceFiles(srcMainKotlin) @@ -197,7 +197,7 @@ public class MobibotBuild extends Project { } @BuildCommand(value = "release-info", summary = "Generates the ReleaseInfo class") - public void releaseInfo() { + public void releaseInfo() throws Exception { new GeneratedVersionOperation() .fromProject(this) .classTemplate(new File(workDirectory(), "release-info.txt")) diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/ReleaseInfo.kt b/src/main/kotlin/net/thauvin/erik/mobibot/ReleaseInfo.kt index c892cf0..3abf162 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/ReleaseInfo.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/ReleaseInfo.kt @@ -14,12 +14,12 @@ import java.time.ZoneId */ object ReleaseInfo { const val PROJECT = "mobibot" - const val VERSION = "0.8.0-rc+20240509074831" + const val VERSION = "0.8.0-rc+20240712110931" @JvmField @Suppress("MagicNumber") val BUILD_DATE: LocalDateTime = LocalDateTime.ofInstant( - Instant.ofEpochMilli(1715266111851L), ZoneId.systemDefault() + Instant.ofEpochMilli(1720807771484L), ZoneId.systemDefault() ) const val WEBSITE = "https://mobitopia.org/mobibot/"