diff --git a/.circleci/config.yml b/.circleci/config.yml index c781fdc..e6c4f38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,62 +1,55 @@ -version: 2.1 - -orbs: - sdkman: joshdholtz/sdkman@0.2.0 - +version: 2 defaults: &defaults working_directory: ~/repo environment: JVM_OPTS: -Xmx3200m TERM: dumb - CI_NAME: "CircleCI" + CI: true -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.1.10 - - 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 +defaults_gradle: &defaults_gradle + steps: + - checkout + - restore_cache: + keys: + - gradle-dependencies-{{ checksum "build.gradle.kts" }} + # fallback to using the latest cache if no exact match is found + - gradle-dependencies- + - run: + name: Gradle Dependencies + command: ./gradlew dependencies + - save_cache: + paths: ~/.m2 + key: gradle-dependencies-{{ checksum "build.gradle.kts" }} + - run: + name: Run All Checks + command: ./gradlew check + - store_artifacts: + path: build/reports/ + destination: reports + - store_test_results: + path: build/reports/ jobs: - bld_jdk17: + build_gradle_jdk18: <<: *defaults docker: - - image: cimg/openjdk:17.0 + - image: cimg/openjdk:18.0 - steps: - - build_and_test + <<: *defaults_gradle - bld_jdk21: + build_gradle_jdk11: <<: *defaults docker: - - image: cimg/openjdk:21.0 + - image: cimg/openjdk:11.0 - steps: - - build_and_test + <<: *defaults_gradle workflows: - bld: - jobs: - - bld_jdk17 - - bld_jdk21 + version: 2 + gradle: + jobs: + - build_gradle_jdk11 + - build_gradle_jdk18 + diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml deleted file mode 100644 index 4ee117f..0000000 --- a/.github/workflows/bld.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: bld-ci - -on: [ push, pull_request, workflow_dispatch ] - -env: - BITLY_ACCESS_TOKEN: ${{ secrets.BITLY_ACCESS_TOKEN }} - COVERAGE_JDK: "21" - COVERAGE_KOTLIN: "2.0.21" - -jobs: - build-bld-project: - strategy: - matrix: - java-version: [ 17, 21, 24 ] - kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ] - os: [ ubuntu-latest, windows-latest, macos-latest ] - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout source repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - 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: Download dependencies [bld example] - working-directory: examples/bld - run: ./bld download - - - name: Compile and run examples [bld examples] - working-directory: examples/bld - run: | - ./bld compile - ./bld run --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA' - ./bld run-retrieve - ./bld run-java --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA' - - - name: Run examples [gradle examples] - working-directory: examples/gradle - if: matrix.java-version != '24' - run: | - ./gradlew run --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA' - ./gradlew runRetrieve - ./gradlew runJava --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA' - - - name: Download dependencies - run: ./bld download - - - name: Compile source - run: ./bld compile - - - name: Run tests - run: ./bld jacoco - - - name: Remove pom.xml - if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN - && matrix.os == 'ubuntu-latest' - run: rm -rf pom.xml - - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN - && matrix.os == 'ubuntu-latest' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..e4e5126 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,51 @@ +name: gradle-ci + +on: [ push, pull_request, workflow_dispatch ] + +jobs: + build: + runs-on: ubuntu-latest + + env: + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" + SONAR_JDK: "17" + + strategy: + matrix: + java-version: [ 11, 17, 20 ] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java-version }} + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Cache SonarCloud packages + if: matrix.java-version == env.SONAR_JDK + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Test with Gradle + uses: gradle/gradle-build-action@v2 + env: + BITLY_ACCESS_TOKEN: ${{ secrets.BITLY_ACCESS_TOKEN }} + with: + arguments: build check --stacktrace --scan + + - name: SonarCloud + if: success() && matrix.java-version == env.SONAR_JDK + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew sonar --info diff --git a/.gitignore b/.gitignore index 1808834..0742f86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,61 +1,84 @@ -.gradle +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/settings.json +!.vscode/tasks.json +*.class +*.code-workspace +*.ctxt +*.iws +*.log +*.nar +*.rar +*.sublime-* +*.tar.gz +*.zip .DS_Store -build -lib/bld/** -!lib/bld/bld-wrapper.jar -!lib/bld/bld-wrapper.properties -lib/compile/ -lib/runtime/ -lib/standalone/ -lib/test/ - -# IDEA ignores - -# User-specific -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin +.classpath +.gradle +.history +.kobalt +.mtj.tmp/ +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.nb-gradle +.project +.scannerwork +.settings +.vscode/* +/**/.idea/$CACHE_FILE$ +/**/.idea/$PRODUCT_WORKSPACE_FILE$ +/**/.idea/**/caches/build_file_checksums.ser +/**/.idea/**/contentModel.xml +/**/.idea/**/dataSources.ids +/**/.idea/**/dataSources.local.xml +/**/.idea/**/dataSources/ +/**/.idea/**/dbnavigator.xml +/**/.idea/**/dictionaries +/**/.idea/**/dynamic.xml +/**/.idea/**/gradle.xml +/**/.idea/**/httpRequests +/**/.idea/**/libraries +/**/.idea/**/mongoSettings.xml +/**/.idea/**/replstate.xml +/**/.idea/**/shelf +/**/.idea/**/shelf/ +/**/.idea/**/sqlDataSources.xml +/**/.idea/**/tasks.xml +/**/.idea/**/uiDesigner.xml +/**/.idea/**/usage.statistics.xml +/**/.idea/**/workspace.xml +/**/.idea/sonarlint* +/**/.idea_modules/ +Thumbs.db +__pycache__ atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Editor-based Rest Client -.idea/httpRequests - -bin -deploy -target +bin/ +build/ +cmake-build-*/ +com_crashlytics_export_strings.xml +crashlytics-build.properties +crashlytics.properties +dependency-reduced-pom.xml +deploy/ +dist/ +ehthumbs.db +fabric.properties +gen/ +hs_err_pid* +kobaltBuild +kobaltw*-test +lib/kotlin* +libs/ local.properties - +out/ +pom.xml.asc +pom.xml.next +pom.xml.releaseBackup +pom.xml.tag +pom.xml.versionsBackup +proguard-project.txt +project.properties +release.properties +target/ +test-output +venv diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10b9b0f..1601b0b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,24 +1,31 @@ -image: fedora:latest +image: gradle:8-jdk11 variables: - CI_NAME: "GitLab CI" - -stages: - - test + GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" 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" + - export GRADLE_USER_HOME=`pwd`/.gradle + +stages: + - build + - test + +build: + stage: build + script: gradle --build-cache assemble + cache: + key: "$CI_COMMIT_REF_NAME" + policy: push + paths: + - build + - .gradle test: stage: test - script: - - ./bld download - - ./bld compile - - ./bld test + script: gradle check + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull + paths: + - build + - .gradle diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/app.iml b/.idea/app.iml deleted file mode 100644 index 2c1fe21..0000000 --- a/.idea/app.iml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/bld.iml b/.idea/bld.iml deleted file mode 100644 index e63e11e..0000000 --- a/.idea/bld.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..21a0f73 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..15cfaa5 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..23f4bb5 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/examples/gradle/.idea/compiler.xml b/.idea/compiler.xml similarity index 100% rename from examples/gradle/.idea/compiler.xml rename to .idea/compiler.xml diff --git a/.idea/copyright/BSD_3.xml b/.idea/copyright/Erik_s_Copyright_Notice.xml similarity index 96% rename from .idea/copyright/BSD_3.xml rename to .idea/copyright/Erik_s_Copyright_Notice.xml index dcac8a6..3889459 100644 --- a/.idea/copyright/BSD_3.xml +++ b/.idea/copyright/Erik_s_Copyright_Notice.xml @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index 3203074..1419e40 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/.idea/bld.xml b/.idea/encodings.xml similarity index 54% rename from .idea/bld.xml rename to .idea/encodings.xml index 6600cee..97626ba 100644 --- a/.idea/bld.xml +++ b/.idea/encodings.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 94f28ea..8ff795e 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,9 +1,53 @@ \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..dc2dcae --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/examples/gradle/.idea/jarRepositories.xml b/.idea/jarRepositories.xml similarity index 53% rename from examples/gradle/.idea/jarRepositories.xml rename to .idea/jarRepositories.xml index 4e9cedf..37ad52e 100644 --- a/examples/gradle/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -11,20 +11,45 @@