Updated Kotlin dependencies

Kotlin extension to version 1.0.0-SNAPSHOT
Dokka extension to version 1.0.0-SNAPSHOT
This commit is contained in:
Erik C. Thauvin 2024-07-15 14:44:18 -07:00
parent 7720a93d0a
commit 4fa2b549ad
Signed by: erik
GPG key ID: 776702A6A2DA330E
9 changed files with 125 additions and 86 deletions

View file

@ -1,4 +1,8 @@
version: 2
version: 2.1
orbs:
sdkman: joshdholtz/sdkman@0.2.0
defaults: &defaults
working_directory: ~/repo
environment:
@ -6,18 +10,31 @@ defaults: &defaults
TERM: dumb
CI_NAME: "CircleCI"
defaults_bld: &defaults_bld
steps:
- checkout
- run:
name: Download the bld dependencies
command: ./bld download
- run:
name: Compile source with bld
command: ./bld compile
- run:
name: Run tests with bld
command: ./bld test
commands:
build_and_test:
parameters:
reports-dir:
type: string
default: "build/reports/test_results"
steps:
- checkout
- sdkman/setup-sdkman
- sdkman/sdkman-install:
candidate: kotlin
version: 2.0.0
- run:
name: Download dependencies
command: ./bld download
- run:
name: Compile source
command: ./bld compile
- run:
name: Run tests
command: ./bld jacoco -reports-dir=<< parameters.reports-dir >>
- store_test_results:
path: << parameters.reports-dir >>
- store_artifacts:
path: build/reports/jacoco/test/html
jobs:
bld_jdk17:
@ -26,7 +43,8 @@ jobs:
docker:
- image: cimg/openjdk:17.0
<<: *defaults_bld
steps:
- build_and_test
bld_jdk20:
<<: *defaults
@ -34,10 +52,10 @@ jobs:
docker:
- image: cimg/openjdk:20.0
<<: *defaults_bld
steps:
- build_and_test
workflows:
version: 2
bld:
jobs:
- bld_jdk17

View file

@ -7,11 +7,14 @@ jobs:
runs-on: ubuntu-latest
env:
COVERAGE_SDK: "17"
COVERAGE_JDK: "21"
COVERAGE_KOTLIN: "2.0.0"
KOTLIN_HOME: /usr/share/kotlinc
strategy:
matrix:
java-version: [17, 21, 22]
kotlin-version: [1.9.24, 2.0.0]
steps:
- name: Checkout source repository
@ -19,34 +22,30 @@ jobs:
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
- name: Set up JDK ${{ matrix.java-version }} with Kotlin ${{ matrix.kotlin-version }}
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Grant bld execute permission
run: chmod +x bld
- name: Download the bld dependencies
- name: Download dependencies
run: ./bld download
- name: Compile source with bld
- name: Compile source
run: ./bld compile
- name: Run tests with bld
- name: Run tests
env:
AKISMET_BLOG: ${{ secrets.AKISMET_BLOG }}
AKISMET_API_KEY: ${{ secrets.AKISMET_API_KEY }}
run: ./bld jacoco
- name: Remove pom.xml
if: success() && matrix.java-version == env.COVERAGE_SDK
run: rm -rf pom.xml
- name: SonarCloud Scan
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
uses: sonarsource/sonarcloud-github-action@master
if: success() && matrix.java-version == env.COVERAGE_SDK
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View file

@ -1,11 +1,24 @@
image: openjdk:17
image: fedora:latest
variables:
CI_NAME: "GitLab CI"
stages:
- test
before_script:
- dnf -qy update && dnf -y install 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
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"
test:
stage: test
script:
- ./bld download
- ./bld compile
- ./bld test
- ./bld download
- ./bld compile
- ./bld test

View file

@ -1,10 +1,20 @@
image: openjdk:17
image: ubuntu:latest
pipelines:
default:
- step:
name: Test with bld
script:
# Install latest 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
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"
# Download, compile and test with bld
- ./bld download
- ./bld compile
- ./bld test

View file

@ -1,7 +1,6 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.0-SNAPSHOT
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=

Binary file not shown.

View file

@ -2,7 +2,7 @@ bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.4
#bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.0-SNAPSHOT
bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.0-SNAPSHOT
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

View file

@ -33,10 +33,10 @@ package net.thauvin.erik;
import rife.bld.BuildCommand;
import rife.bld.Project;
import rife.bld.extension.CompileKotlinOperation;
import rife.bld.extension.DetektOperation;
import rife.bld.extension.GeneratedVersionOperation;
import rife.bld.extension.JacocoReportOperation;
import rife.bld.extension.*;
import rife.bld.extension.dokka.LoggingLevel;
import rife.bld.extension.dokka.OutputFormat;
import rife.bld.extension.dokka.SourceSet;
import rife.bld.extension.kotlin.CompilerPlugin;
import rife.bld.operations.exceptions.ExitStatusException;
import rife.bld.publish.PomBuilder;
@ -164,30 +164,30 @@ public class AkismetBuild extends Project {
.execute();
}
// @BuildCommand(summary = "Generates documentation in HTML format")
// public void docs() throws ExitStatusException, IOException, InterruptedException {
// new DokkaOperation()
// .fromProject(this)
// .loggingLevel(LoggingLevel.INFO)
// .moduleName("Akismet Kotlin")
// .moduleVersion(version.toString())
// .outputDir("docs")
// .outputFormat(OutputFormat.HTML)
// .sourceSet(
// new SourceSet()
// .src(srcMainKotlin)
// .classpath(compileClasspathJars())
// .classpath(providedClasspathJars())
// .srcLink(srcMainKotlin, "https://github.com/ethauvin/" + name
// + "/tree/master/src/main/kotlin/", "#L")
// .includes("config/dokka/packages.md")
// .jdkVersion(javaRelease)
// .externalDocumentationLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
// "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
//
// )
// .execute();
// }
@BuildCommand(summary = "Generates documentation in HTML format")
public void docs() throws ExitStatusException, IOException, InterruptedException {
new DokkaOperation()
.fromProject(this)
.loggingLevel(LoggingLevel.INFO)
.moduleName("Akismet Kotlin")
.moduleVersion(version.toString())
.outputDir("docs")
.outputFormat(OutputFormat.HTML)
.sourceSet(
new SourceSet()
.src(srcMainKotlin)
.classpath(compileClasspathJars())
.classpath(providedClasspathJars())
.srcLink(srcMainKotlin, "https://github.com/ethauvin/" + name
+ "/tree/master/src/main/kotlin/", "#L")
.includes("config/dokka/packages.md")
.jdkVersion(javaRelease)
.externalDocumentationLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
"https://jakarta.ee/specifications/platform/9/apidocs/package-list")
)
.execute();
}
@BuildCommand(summary = "Generates version class")
public void genver() throws Exception {
@ -209,24 +209,18 @@ public class AkismetBuild extends Project {
.execute();
}
// @Override
// public void javadoc() throws ExitStatusException, IOException, InterruptedException {
// new DokkaOperation()
// .fromProject(this)
// .loggingLevel(LoggingLevel.INFO)
// .moduleName("Bitly Shorten")
// .moduleVersion(version.toString())
// .outputDir(new File(buildDirectory(), "javadoc"))
// .outputFormat(OutputFormat.JAVADOC)
// .globalLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
// "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
// .execute();
// }
@BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
public void pomRoot() throws FileUtilsErrorException {
PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
new File(workDirectory, "pom.xml"));
@Override
public void javadoc() throws ExitStatusException, IOException, InterruptedException {
new DokkaOperation()
.fromProject(this)
.loggingLevel(LoggingLevel.INFO)
.moduleName("Bitly Shorten")
.moduleVersion(version.toString())
.outputDir(new File(buildDirectory(), "javadoc"))
.outputFormat(OutputFormat.JAVADOC)
.globalLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
"https://jakarta.ee/specifications/platform/9/apidocs/package-list")
.execute();
}
@Override
@ -234,4 +228,10 @@ public class AkismetBuild extends Project {
super.publish();
pomRoot();
}
@BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
public void pomRoot() throws FileUtilsErrorException {
PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
new File(workDirectory, "pom.xml"));
}
}

View file

@ -1,14 +1,14 @@
/*
* This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED!
*/
/**
* This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED!
*/
package {{v packageName/}}
/**
* Provides semantic version information.
*/
internal object {{v className/}} {
* Provides semantic version information.
*/
internal object {{v className/}} {
const val PROJECT = "{{v project/}}"
const val VERSION = "{{v version/}}"
}