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

View file

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

View file

@ -1,8 +1,21 @@
image: openjdk:17 image: fedora:latest
variables:
CI_NAME: "GitLab CI"
stages: stages:
- test - 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: test:
stage: test stage: test
script: script:

View file

@ -1,10 +1,20 @@
image: openjdk:17 image: ubuntu:latest
pipelines: pipelines:
default: default:
- step: - step:
name: Test with bld name: Test with bld
script: 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 download
- ./bld compile - ./bld compile
- ./bld test - ./bld test

View file

@ -1,7 +1,6 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= 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.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.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=

Binary file not shown.

View file

@ -2,7 +2,7 @@ bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.4 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-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-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.6
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT 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.BuildCommand;
import rife.bld.Project; import rife.bld.Project;
import rife.bld.extension.CompileKotlinOperation; import rife.bld.extension.*;
import rife.bld.extension.DetektOperation; import rife.bld.extension.dokka.LoggingLevel;
import rife.bld.extension.GeneratedVersionOperation; import rife.bld.extension.dokka.OutputFormat;
import rife.bld.extension.JacocoReportOperation; import rife.bld.extension.dokka.SourceSet;
import rife.bld.extension.kotlin.CompilerPlugin; import rife.bld.extension.kotlin.CompilerPlugin;
import rife.bld.operations.exceptions.ExitStatusException; import rife.bld.operations.exceptions.ExitStatusException;
import rife.bld.publish.PomBuilder; import rife.bld.publish.PomBuilder;
@ -164,30 +164,30 @@ public class AkismetBuild extends Project {
.execute(); .execute();
} }
// @BuildCommand(summary = "Generates documentation in HTML format") @BuildCommand(summary = "Generates documentation in HTML format")
// public void docs() throws ExitStatusException, IOException, InterruptedException { public void docs() throws ExitStatusException, IOException, InterruptedException {
// new DokkaOperation() new DokkaOperation()
// .fromProject(this) .fromProject(this)
// .loggingLevel(LoggingLevel.INFO) .loggingLevel(LoggingLevel.INFO)
// .moduleName("Akismet Kotlin") .moduleName("Akismet Kotlin")
// .moduleVersion(version.toString()) .moduleVersion(version.toString())
// .outputDir("docs") .outputDir("docs")
// .outputFormat(OutputFormat.HTML) .outputFormat(OutputFormat.HTML)
// .sourceSet( .sourceSet(
// new SourceSet() new SourceSet()
// .src(srcMainKotlin) .src(srcMainKotlin)
// .classpath(compileClasspathJars()) .classpath(compileClasspathJars())
// .classpath(providedClasspathJars()) .classpath(providedClasspathJars())
// .srcLink(srcMainKotlin, "https://github.com/ethauvin/" + name .srcLink(srcMainKotlin, "https://github.com/ethauvin/" + name
// + "/tree/master/src/main/kotlin/", "#L") + "/tree/master/src/main/kotlin/", "#L")
// .includes("config/dokka/packages.md") .includes("config/dokka/packages.md")
// .jdkVersion(javaRelease) .jdkVersion(javaRelease)
// .externalDocumentationLinks("https://jakarta.ee/specifications/platform/9/apidocs/", .externalDocumentationLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
// "https://jakarta.ee/specifications/platform/9/apidocs/package-list") "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
//
// ) )
// .execute(); .execute();
// } }
@BuildCommand(summary = "Generates version class") @BuildCommand(summary = "Generates version class")
public void genver() throws Exception { public void genver() throws Exception {
@ -209,24 +209,18 @@ public class AkismetBuild extends Project {
.execute(); .execute();
} }
// @Override @Override
// public void javadoc() throws ExitStatusException, IOException, InterruptedException { public void javadoc() throws ExitStatusException, IOException, InterruptedException {
// new DokkaOperation() new DokkaOperation()
// .fromProject(this) .fromProject(this)
// .loggingLevel(LoggingLevel.INFO) .loggingLevel(LoggingLevel.INFO)
// .moduleName("Bitly Shorten") .moduleName("Bitly Shorten")
// .moduleVersion(version.toString()) .moduleVersion(version.toString())
// .outputDir(new File(buildDirectory(), "javadoc")) .outputDir(new File(buildDirectory(), "javadoc"))
// .outputFormat(OutputFormat.JAVADOC) .outputFormat(OutputFormat.JAVADOC)
// .globalLinks("https://jakarta.ee/specifications/platform/9/apidocs/", .globalLinks("https://jakarta.ee/specifications/platform/9/apidocs/",
// "https://jakarta.ee/specifications/platform/9/apidocs/package-list") "https://jakarta.ee/specifications/platform/9/apidocs/package-list")
// .execute(); .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 @Override
@ -234,4 +228,10 @@ public class AkismetBuild extends Project {
super.publish(); super.publish();
pomRoot(); 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,4 +1,4 @@
/* /**
* This file is automatically generated. * This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED! * Do not modify! -- ALL CHANGES WILL BE ERASED!
*/ */