diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1b19e22..5697c0d 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,45 +1,42 @@
-defaults: &defaults
- working_directory: ~/repo
- docker:
- - image: circleci/openjdk:8-jdk
- environment:
- JVM_OPTS: -Xmx3200m
- TERM: dumb
-
-version: 2.0
-
-jobs:
- build_gradle:
- <<: *defaults
+version: 2.1
+commands:
+ build_and_test:
+ parameters:
+ reports-dir:
+ type: string
+ default: "build/reports/test_results"
steps:
- checkout
- - restore_cache:
- keys:
- - gradle-dependencies-{{ checksum "build.gradle" }}
- # 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" }}
-
+ name: Download dependencies
+ command: ./bld download
- run:
- name: Run All Checks
- command: ./gradlew check
-
- - store_artifacts:
- path: build/reports/
- destination: reports
+ name: Compile source
+ command: ./bld compile
+ - run:
+ name: Run tests
+ command: ./bld jacoco -reports-dir=<< parameters.reports-dir >>
- store_test_results:
- path: build/reports/
+ path: << parameters.reports-dir >>
+ - store_artifacts:
+ path: build/reports/jacoco/test/html
+
+jobs:
+ bld_jdk17:
+ docker:
+ - image: cimg/openjdk:17.0
+ steps:
+ - build_and_test
+
+ bld_jdk21:
+ docker:
+ - image: cimg/openjdk:21.0
+ steps:
+ - build_and_test
workflows:
- version: 2
- build_gradle_jdk8:
+ bld:
jobs:
- - build_gradle
+ - bld_jdk17
+ - bld_jdk21
diff --git a/.editorconfig b/.editorconfig
index a6971e1..1f808de 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,2 +1,2 @@
[*]
-insert_final_newline=true
+insert_final_newline = true
diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml
new file mode 100644
index 0000000..64007ef
--- /dev/null
+++ b/.github/workflows/bld.yml
@@ -0,0 +1,76 @@
+name: bld-ci
+
+on: [push, pull_request, workflow_dispatch]
+
+jobs:
+ build-bld-project:
+ env:
+ COVERAGE_JDK: "17"
+
+ strategy:
+ matrix:
+ java-version: [17, 21, 24]
+ 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 }}
+ uses: actions/setup-java@v4
+ with:
+ distribution: "zulu"
+ java-version: ${{ matrix.java-version }}
+
+ - name: Download dependencies [bld example]
+ working-directory: examples/java/bld
+ run: ./bld download
+
+ - name: Compile and run [bld example]
+ working-directory: examples/java/bld
+ run: |
+ ./bld compile
+ ./bld run
+ ./bld run-example
+
+ - name: Run example [gradle java examples]
+ working-directory: examples/java/gradle
+ run: |
+ ./gradlew run
+ ./gradlew runExample
+
+ - name: Run example [gradle kotlin examples]
+ working-directory: examples/kotlin
+ run: |
+ ./gradlew run
+ ./gradlew runExample
+
+ - 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.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.os == 'ubuntu-latest'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v3
+ if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.os == 'ubuntu-latest'
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github_changelog_generator b/.github_changelog_generator
new file mode 100644
index 0000000..13dd68d
--- /dev/null
+++ b/.github_changelog_generator
@@ -0,0 +1 @@
+future-release=1.2.1
diff --git a/.gitignore b/.gitignore
index e439b59..dd3e0b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,83 +1,58 @@
-!.vscode/extensions.json
-!.vscode/launch.json
-!.vscode/settings.json
-!.vscode/tasks.json
-!gradle-wrapper.jar
-.classpath
-.DS_Store
.gradle
-.history
-.idea_modules/
+.DS_Store
+build
+lib/bld/**
+!lib/bld/bld-wrapper.properties
+!lib/bld/bld-wrapper.jar
+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/**/dataSources/
-.idea/**/dbnavigator.xml
-.idea/**/dictionaries
-.idea/**/dynamic.xml
-.idea/**/gradle.xml
-.idea/**/libraries
-.idea/**/mongoSettings.xml
-.idea/**/shelf
.idea/**/sqlDataSources.xml
-.idea/**/tasks.xml
+.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
-.idea/**/usage.statistics.xml
-.idea/**/workspace.xml
-.idea/caches/build_file_checksums.ser
-.idea/httpRequests
-.idea/replstate.xml
-.kobalt
-.mtj.tmp/
-.mvn/timing.properties
-.mvn/wrapper/maven-wrapper.jar
-.nb-gradle
-.project
-.scannerwork
-.settings
-.vscode/*
-*.class
-*.code-workspace
-*.ctxt
-*.ear
-*.iws
-*.jar
-*.log
-*.nar
-*.rar
-*.sublime-*
-*.tar.gz
-*.war
-*.zip
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
atlassian-ide-plugin.xml
-bin/
-build/
-buildNumber.properties
-cmake-build-*/
-com_crashlytics_export_strings.xml
-crashlytics-build.properties
-crashlytics.properties
-dependency-reduced-pom.xml
-deploy/
-dist/
-ehthumbs.db
-fabric.properties
-gen/
-gradle.properties
-hs_err_pid*
-kobaltBuild
-kobaltw*-test
-lib/kotlin*
-libs/
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+
+# Editor-based Rest Client
+.idea/httpRequests
+
local.properties
-out/
-pom.xml.next
-pom.xml.releaseBackup
-pom.xml.tag
-pom.xml.versionsBackup
-proguard-project.txt
-project.properties
-release.properties
-target/
-test-output
-Thumbs.db
+target
diff --git a/.idea/app.iml b/.idea/app.iml
new file mode 100644
index 0000000..6c0f6d7
--- /dev/null
+++ b/.idea/app.iml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/bld.iml b/.idea/bld.iml
new file mode 100644
index 0000000..e63e11e
--- /dev/null
+++ b/.idea/bld.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/java/.idea/encodings.xml b/.idea/bld.xml
similarity index 54%
rename from examples/java/.idea/encodings.xml
rename to .idea/bld.xml
index 97626ba..6600cee 100644
--- a/examples/java/.idea/encodings.xml
+++ b/.idea/bld.xml
@@ -1,6 +1,6 @@
-
-
+
+
\ No newline at end of file
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
deleted file mode 100644
index 17101f8..0000000
--- a/.idea/checkstyle-idea.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/checkstyleidea-libs/readme.txt b/.idea/checkstyleidea-libs/readme.txt
deleted file mode 100644
index 71cc7ff..0000000
--- a/.idea/checkstyleidea-libs/readme.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-This folder contains libraries copied from the "semver" project.
-It is managed by the CheckStyle-IDEA IDE plugin.
-Do not modify this folder while the IDE is running.
-When the IDE is stopped, you may delete this folder at any time. It will be recreated as needed.
-In order to prevent the CheckStyle-IDEA IDE plugin from creating this folder,
-uncheck the "Copy libraries from project directory" option in the CheckStyle-IDEA settings dialog.
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index d91f848..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index 6d140d3..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/copyright/Erik_s_Copyright_Notice.xml b/.idea/copyright/BSD_3_Clause.xml
similarity index 96%
rename from .idea/copyright/Erik_s_Copyright_Notice.xml
rename to .idea/copyright/BSD_3_Clause.xml
index ef51a2d..025a880 100644
--- a/.idea/copyright/Erik_s_Copyright_Notice.xml
+++ b/.idea/copyright/BSD_3_Clause.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 69bc70d..8b4ad55 100644
--- a/.idea/copyright/profiles_settings.xml
+++ b/.idea/copyright/profiles_settings.xml
@@ -1,7 +1,3 @@
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..1e01b48
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
deleted file mode 100644
index dc2dcae..0000000
--- a/.idea/inspectionProfiles/profiles_settings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/intellij-javadocs-4.0.1.xml b/.idea/intellij-javadocs-4.0.1.xml
new file mode 100644
index 0000000..fbb9478
--- /dev/null
+++ b/.idea/intellij-javadocs-4.0.1.xml
@@ -0,0 +1,204 @@
+
+
+
+
+ UPDATE
+ false
+ true
+
+ FIELD
+ TYPE
+ METHOD
+
+
+ DEFAULT
+ PUBLIC
+ PROTECTED
+
+
+
+
+
+ ^.*(public|protected|private)*.+interface\s+\w+.*
+ /**\n
+ * The interface ${name}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+ */
+
+
+ ^.*(public|protected|private)*.+enum\s+\w+.*
+ /**\n
+ * The enum ${name}.\n
+ */
+
+
+ ^.*(public|protected|private)*.+class\s+\w+.*
+ /**\n
+ * The type ${name}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+ */
+
+
+ .+
+ /**\n
+ * The type ${name}.\n
+ */
+
+
+
+
+ .+
+ /**\n
+ * Instantiates a new ${name}.\n
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+
+
+ ^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+
+ /**\n
+ * Gets ${partName}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if isNotVoid>
+ *\n
+ * @return the ${partName}\n
+</#if>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+ ^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+
+ /**\n
+ * Sets ${partName}.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if isNotVoid>
+ *\n
+ * @return the ${partName}\n
+</#if>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+ ^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+
+ /**\n
+ * The entry point of application.\n
+
+ <#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+ * @param ${element.parameterList.parameters[0].name} the input arguments\n
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+ .+
+ /**\n
+ * ${name}<#if isNotVoid> ${return}</#if>.\n
+<#if element.typeParameters?has_content> * \n
+</#if>
+<#list element.typeParameters as typeParameter>
+ * @param <${typeParameter.name}> the type parameter\n
+</#list>
+<#if element.parameterList.parameters?has_content>
+ *\n
+</#if>
+<#list element.parameterList.parameters as parameter>
+ * @param ${parameter.name} the ${paramNames[parameter.name]}\n
+</#list>
+<#if isNotVoid>
+ *\n
+ * @return the ${return}\n
+</#if>
+<#if element.throwsList.referenceElements?has_content>
+ *\n
+</#if>
+<#list element.throwsList.referenceElements as exception>
+ * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
+</#list>
+ */
+
+
+
+
+ ^.*(public|protected|private)*.+static.*(\w\s\w)+.+
+ /**\n
+ * The constant ${element.getName()}.\n
+ */
+
+
+ ^.*(public|protected|private)*.*(\w\s\w)+.+
+ /**\n
+ <#if element.parent.isInterface()>
+ * The constant ${element.getName()}.\n
+<#else>
+ * The ${name}.\n
+</#if> */
+
+
+ .+
+ /**\n
+ <#if element.parent.isEnum()>
+ *${name} ${typeName}.\n
+<#else>
+ * The ${name}.\n
+</#if>*/
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
deleted file mode 100644
index 5806fb3..0000000
--- a/.idea/kotlinc.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml
new file mode 100644
index 0000000..a203de8
--- /dev/null
+++ b/.idea/libraries/bld.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml
new file mode 100644
index 0000000..5316b95
--- /dev/null
+++ b/.idea/libraries/compile.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml
new file mode 100644
index 0000000..d4069f2
--- /dev/null
+++ b/.idea/libraries/runtime.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml
new file mode 100644
index 0000000..05f52ce
--- /dev/null
+++ b/.idea/libraries/test.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 361f8c9..61cdf16 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,23 +1,16 @@
-
-
-
+
+
+
+
+
+
-
-
-
-
+
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..55adcb9
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/examples-kotlin_main.iml b/.idea/modules/examples-kotlin_main.iml
deleted file mode 100644
index 487e0be..0000000
--- a/.idea/modules/examples-kotlin_main.iml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/examples-kotlin_test.iml b/.idea/modules/examples-kotlin_test.iml
deleted file mode 100644
index 23b6a6d..0000000
--- a/.idea/modules/examples-kotlin_test.iml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Run Tests.xml b/.idea/runConfigurations/Run Tests.xml
new file mode 100644
index 0000000..5c0ca65
--- /dev/null
+++ b/.idea/runConfigurations/Run Tests.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/scopes/Copyright.xml b/.idea/scopes/Copyright.xml
deleted file mode 100644
index 7fb840b..0000000
--- a/.idea/scopes/Copyright.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/semver.iml b/.idea/semver.iml
deleted file mode 100644
index 78b2cc5..0000000
--- a/.idea/semver.iml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index f2a55d1..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: java
-
-jdk:
- - oraclejdk8
-
-addons:
- sonarcloud:
- organization: "ethauvin-github"
-
-before_install:
- - chmod +x gradlew
-
-after_success:
- - |
- if [ "${TRAVIS_TEST_RESULT}" == 0 ]; then
- ./gradlew sonarqube
- fi
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a22e047..f1d1e89 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,48 +1,79 @@
-# Change Log
+# Changelog
-## [Unreleased](https://github.com/ethauvin/semver/tree/HEAD)
+## [1.2.1](https://github.com/ethauvin/semver/tree/1.2.1) (2023-10-01)
-[Full Changelog](https://github.com/ethauvin/semver/compare/1.1.1...HEAD)
+[Full Changelog](https://github.com/ethauvin/semver/compare/1.2.0...1.2.1)
**Implemented enhancements:**
+- Move from Gradle to bld [\#7](https://github.com/ethauvin/semver/issues/7)
+
+**Fixed bugs:**
+
+- NPE with Java 12 and Kotlin 1.3.30 [\#1](https://github.com/ethauvin/semver/issues/1)
+
+**Closed issues:**
+
+- Under Java 12 and Gradle 5.4.1 the properties file is not found. [\#6](https://github.com/ethauvin/semver/issues/6)
+
+## [1.2.0](https://github.com/ethauvin/semver/tree/1.2.0) (2019-05-25)
+
+[Full Changelog](https://github.com/ethauvin/semver/compare/1.1.1...1.2.0)
+
+**Implemented enhancements:**
+
+- Calculate the version internally. [\#4](https://github.com/ethauvin/semver/issues/4)
+- Attempt to compile non-existent Java source in Gradle project using Kapt [\#3](https://github.com/ethauvin/semver/issues/3)
- kapt and Kotlin 1.3.30 require kapt.use.worker.api=true [\#2](https://github.com/ethauvin/semver/issues/2)
**Fixed bugs:**
-- kapt and Kotlin 1.3.30 require kapt.use.worker.api=true [\#2](https://github.com/ethauvin/semver/issues/2)
+- Default template is not found in 1.1.1 [\#5](https://github.com/ethauvin/semver/issues/5)
## [1.1.1](https://github.com/ethauvin/semver/tree/1.1.1) (2019-03-31)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/1.1.0-beta...1.1.1)
## [1.1.0-beta](https://github.com/ethauvin/semver/tree/1.1.0-beta) (2018-11-04)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/1.0.1...1.1.0-beta)
## [1.0.1](https://github.com/ethauvin/semver/tree/1.0.1) (2017-05-30)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/1.0.0...1.0.1)
## [1.0.0](https://github.com/ethauvin/semver/tree/1.0.0) (2017-05-10)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.6-beta...1.0.0)
## [0.9.6-beta](https://github.com/ethauvin/semver/tree/0.9.6-beta) (2016-07-15)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.5-beta...0.9.6-beta)
## [0.9.5-beta](https://github.com/ethauvin/semver/tree/0.9.5-beta) (2016-02-03)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.4-beta...0.9.5-beta)
## [0.9.4-beta](https://github.com/ethauvin/semver/tree/0.9.4-beta) (2016-01-29)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.3-beta...0.9.4-beta)
## [0.9.3-beta](https://github.com/ethauvin/semver/tree/0.9.3-beta) (2016-01-28)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.2-beta...0.9.3-beta)
## [0.9.2-beta](https://github.com/ethauvin/semver/tree/0.9.2-beta) (2016-01-25)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.1-beta...0.9.2-beta)
## [0.9.1-beta](https://github.com/ethauvin/semver/tree/0.9.1-beta) (2016-01-25)
+
[Full Changelog](https://github.com/ethauvin/semver/compare/0.9.0-beta...0.9.1-beta)
## [0.9.0-beta](https://github.com/ethauvin/semver/tree/0.9.0-beta) (2016-01-24)
+[Full Changelog](https://github.com/ethauvin/semver/compare/aeee81544c6d2881ccf02458fcef1f6ba1c9c169...0.9.0-beta)
-\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
+
+
+\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
diff --git a/LICENSE.txt b/LICENSE.txt
index 623a991..ae2f49e 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2016-2019, Erik C. Thauvin (erik@thauvin.net)
+Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/README.md b/README.md
index 7def683..cada04f 100644
--- a/README.md
+++ b/README.md
@@ -1,48 +1,62 @@
-# Semantic Version Annotation Processor
+# Semantic Version Annotation Processor
-[](http://opensource.org/licenses/BSD-3-Clause) [](https://github.com/ethauvin/semver/releases/latest) [](https://maven-badges.herokuapp.com/maven-central/net.thauvin.erik/semver) [  ](https://bintray.com/ethauvin/maven/SemVer/_latestVersion)
-[](https://snyk.io/test/github/ethauvin/semver?targetFile=build.gradle) [](https://sonarcloud.io/dashboard?id=ethauvin_semver) [](https://travis-ci.org/ethauvin/semver) [](https://ci.appveyor.com/project/ethauvin/semver) [](https://circleci.com/gh/ethauvin/semver/tree/master)
+[](https://opensource.org/licenses/BSD-3-Clause)
+[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
+[](https://rife2.com/bld)
+[](https://github.com/ethauvin/semver/releases/latest)
+[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)
+[](https://central.sonatype.com/artifact/net.thauvin.erik/semver)
-An [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html) that automatically generates a `GeneratedVersion` class based on a [Mustache](https://mustache.github.io/) template and containing the [semantic version](http://semver.org/) (major, minor, patch, etc.) that is read from a `Properties` file or defined in the [annotation](https://docs.oracle.com/javase/tutorial/java/annotations/basics.html).
+[](https://sonarcloud.io/dashboard?id=ethauvin_semver)
+[](https://github.com/ethauvin/semver/actions/workflows/bld.yml)
+[](https://ci.appveyor.com/project/ethauvin/semver)
+[](https://circleci.com/gh/ethauvin/semver/tree/master)
+
+An [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html) that automatically generates a `GeneratedVersion` class based on a [Mustache](https://mustache.github.io/) template and containing the [semantic version](https://semver.org/) (major, minor, patch, etc.) that is read from a [Properties](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) file or defined in the [annotation](https://docs.oracle.com/javase/tutorial/java/annotations/basics.html).
This processor was inspired by Cédric Beust's [version-processor](https://github.com/cbeust/version-processor) and works well in conjunction with the [__Semantic Version Plugin for Gradle__](https://github.com/ethauvin/semver-gradle).
## Table of Contents
-- [Examples](#examples)
-- [Template](#template)
- - [Default Template](#default-template)
- - [Custom Template](#custom-template)
-- [Elements & Properties](#elements--properties)
-- [Usage with Maven, Gradle, Kotlin and Kobalt](#usage-with-maven-gradle-kotlin-and-kobalt)
+
+- [Semantic Version Annotation Processor](#semantic-version-annotation-processor)
+ - [Table of Contents](#table-of-contents)
+ - [Examples](#examples)
+ - [Template](#template)
+ - [Default Template](#default-template)
+ - [Custom Template](#custom-template)
+ - [Elements \& Properties](#elements--properties)
- [Maven](#maven)
+ - [bld](#bld)
- [Gradle](#gradle)
- [Class Generation](#class-generation)
- - [Class & Source Generation](#class--source-generation)
+ - [Class \& Source Generation](#class--source-generation)
- [Kotlin](#kotlin)
- - [Kotlin & Gradle](#kotlin--gradle)
- - [Kobalt](#kobalt)
-- [Auto-Increment](#auto-increment)
-
+ - [Kotlin \& Gradle](#kotlin--gradle)
+ - [Auto-Increment](#auto-increment)
+ - [Contributing](#contributing)
+
## Examples
-* Using annotation elements:
+- Using annotation elements:
```java
import net.thauvin.erik.semver.Version;
-@Version(major = 1, minor = 0, patch = 0, preRelease = "beta")
+@Version(major = 2, minor = 1, patch = 1, preRelease = "beta")
public class A {
-// ...
+ // ...
+}
```
-* Or using a [properties](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) file:
+- Or using a [properties](hhttps://github.com/ethauvin/semver/blob/master/examples/java/version.properties) file:
```java
import net.thauvin.erik.semver.Version;
@Version(properties = "version.properties")
public class A {
-// ...
+ // ...
+}
```
```ini
@@ -53,11 +67,11 @@ version.patch=0
version.prerelease=beta
```
-[View Example](https://github.com/ethauvin/semver/tree/master/examples)
+[View Examples](https://github.com/ethauvin/semver/tree/master/examples)
## Template
-Upon running the annotation processor, a source file [`GeneratedVersion.java`](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) is automatically generated with static methods to access the semantic version data. The source is based on a fully customizable [Mustache](https://mustache.github.io/) template.
+Upon running the annotation processor, a source file [GeneratedVersion.java](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) is automatically generated with static methods to access the semantic version data. The source is based on a fully customizable Mustache [template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver.mustache).
To use your own template, simply create a `version.mustache` file in the project's root directory. The processor will automatically look for it.
@@ -66,26 +80,27 @@ To specify your own template name, use:
```java
@Version(template = "version.mustache")
public class A {
-// ...
+ // ...
+}
```
### Default Template
-The [default template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver.mustache ) implements the following static variables:
+The [default template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver.mustache) implements the following static variables:
-Field | Description | Example
-:------------------|:---------------------------------|:-----------------
-`PROJECT` | The project name, if any. | `MyProject`
-`BUILDDATE` | The build date. | [`java.util.Date`](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html)
-`VERSION` | The full version string. | `1.2.3-alpha+001`
-`MAJOR` | The major version. | `1`
-`MINOR` | The minor version. | `2`
-`PATCH` | The patch version. | `3`
-`PRERELEASE` | The pre-release version, if any. | `alpha`
-`PRERELASE_PREFIX` | The pre-release prefix | `-`
-`BUILDMETA` | The build metadata, if any. | `001`
-`BUILDMETA_PREFIX` | The metadata prefix. | `+`
-`SEPARATOR` | The version separator. | `.`
+| Field | Description | Example |
+|:-------------------|:---------------------------------|:----------------------------------------------------------------------------------|
+| `PROJECT` | The project name, if any. | `MyProject` |
+| `BUILDDATE` | The build date. | [`java.util.Date`](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html) |
+| `VERSION` | The full version string. | `1.2.3-alpha+001` |
+| `MAJOR` | The major version. | `1` |
+| `MINOR` | The minor version. | `2` |
+| `PATCH` | The patch version. | `3` |
+| `PRERELEASE` | The pre-release version, if any. | `alpha` |
+| `PRERELASE_PREFIX` | The pre-release prefix | `-` |
+| `BUILDMETA` | The build metadata, if any. | `001` |
+| `BUILDMETA_PREFIX` | The metadata prefix. | `+` |
+| `SEPARATOR` | The version separator. | `.` |
### Custom Template
@@ -106,52 +121,50 @@ public final class {{className}} {
The mustache variables automatically filled in by the processor are:
-Variable | Description | Type
-:-----------------------------|:----------------------------|:--------
-`{{packageName}}` | The package name. | `String`
-`{{className}}` | The class name. | `String`
-`{{project}}` | The project name. | `String`
-`{{epoch}}` | The build epoch/unix time. | `long`
-`{{major}}` | The major version. | `int`
-`{{minor}}` | The minor version. | `int`
-`{{patch}}` | The patch version. | `int`
-`{{preRelease}}` | The pre-release version. | `String`
-`{{preReleasePrefix}}` | The pre-release prefix. | `String`
-`{{buildMeta}}` | The build metadata version. | `String`
-`{{buildMetaPrefix}}` | The metadata prefix. | `String`
-`{{separator}}` | The version separator. | `String`
-`{{semver}}` or `{{version}}` | The full semantic version. | `String`
-
-Please also look at this [example](https://github.com/ethauvin/mobibot/blob/master/version.mustache) using [`java.time`](https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html)
+| Variable | Description | Type |
+|:------------------------------|:----------------------------|:---------|
+| `{{packageName}}` | The package name. | `String` |
+| `{{className}}` | The class name. | `String` |
+| `{{project}}` | The project name. | `String` |
+| `{{epoch}}` | The build epoch/unix time. | `long` |
+| `{{major}}` | The major version. | `int` |
+| `{{minor}}` | The minor version. | `int` |
+| `{{patch}}` | The patch version. | `int` |
+| `{{preRelease}}` | The pre-release version. | `String` |
+| `{{preReleasePrefix}}` | The pre-release prefix. | `String` |
+| `{{buildMeta}}` | The build metadata version. | `String` |
+| `{{buildMetaPrefix}}` | The metadata prefix. | `String` |
+| `{{separator}}` | The version separator. | `String` |
+| `{{semver}}` or `{{version}}` | The full semantic version. | `String` |
## Elements & Properties
The following annotation elements and properties are available:
-Element | Property | Description | Default
-:------------------|:----------------------------|:----------------------------------|:-------------------------
-`project` | `version.project` | The project name. |
-`major` | `version.major` | The major version number. | `1`
-`minor` | `version.major` | The minor version number. | `0`
-`patch` | `version.patch` | The patch version number. | `0`
-`preRelease` | `version.prerelease` | The pre-release version. |
-`preReleasePrefix` | `version.prerelease.prefix` | The pre-release prefix. | `-`
-`buildMeta` | `version.buildmeta` | The build metadata version. |
-`buildMetaPrefix` | `version.buildmeta.prefix` | The metadata prefix. | `+`
-`separator` | `version.separator` | The version separator. | `.`
-`packageName` | | The package name. | _Same as annotated class_
-`className` | | The name of the generated class. | `GeneratedVersion`
-`properties` | | The properties file. |
-`template` | | The template file. | `version.mustache`
-`type` | | Either `java` or `kt` for Kotlin. | `java`
-`keysPrefix` | | The prefix for all property keys. | `version.`
+| Element | Property | Description | Default |
+|:-------------------|:----------------------------|:----------------------------------|:--------------------------|
+| `project` | `version.project` | The project name. | |
+| `major` | `version.major` | The major version number. | `1` |
+| `minor` | `version.major` | The minor version number. | `0` |
+| `patch` | `version.patch` | The patch version number. | `0` |
+| `preRelease` | `version.prerelease` | The pre-release version. | |
+| `preReleasePrefix` | `version.prerelease.prefix` | The pre-release prefix. | `-` |
+| `buildMeta` | `version.buildmeta` | The build metadata version. | |
+| `buildMetaPrefix` | `version.buildmeta.prefix` | The metadata prefix. | `+` |
+| `separator` | `version.separator` | The version separator. | `.` |
+| `packageName` | | The package name. | _Same as annotated class_ |
+| `className` | | The name of the generated class. | `GeneratedVersion` |
+| `properties` | | The properties file. | |
+| `template` | | The template file. | `version.mustache` |
+| `type` | | Either `java` or `kt` for Kotlin. | `java` |
+| `keysPrefix` | | The prefix for all property keys. | `version.` |
In order to easily incorporate with existing projects, the property keys may be assigned custom values:
```java
@Version(
properties = "example.properties",
- keysPrefix = "example."
+ keysPrefix = "example.",
majorKey = "maj",
minorKey = "min",
patchKey = "build",
@@ -160,7 +173,8 @@ In order to easily incorporate with existing projects, the property keys may be
projectKey = "project"
)
public class Example {
-// ...
+ // ...
+}
```
```ini
@@ -174,12 +188,10 @@ example.meta=
# ...
```
-> :warning: `keysPrefix` is a new element staring in `1.1.0` and may break older versions when using custom property keys.
+> :warning: `keysPrefix` is a new element staring in `1.1.0` and may break older versions when using custom property keys.\
> :zap: A quick fix is to include `keysPrefix=""` in the annotation to remove the default `version.` prefix.
-## Usage with Maven, Gradle, Kotlin and Kobalt
-
-### Maven
+## Maven
To install and run from [Maven](https://maven.apache.org/), configure an artifact as follows:
@@ -187,44 +199,75 @@ To install and run from [Maven](https://maven.apache.org/), configure an artifac
net.thauvin.eriksemver
- 1.2.0
+ 1.2.1
```
-Please look at [pom.xml](https://github.com/ethauvin/semver/blob/master/examples/java/pom.xml) in the [Java example](https://github.com/ethauvin/semver/tree/master/examples/java) directory for a sample:
-
-```bash
+```console
mvn verify
```
-### Gradle
+Please look at [pom.xml](https://github.com/ethauvin/semver/blob/master/examples/java/gradle/pom.xml) in the [examples/java/gradle](https://github.com/ethauvin/semver/tree/master/examples/java/gradle) directory for a sample:
-#### Class Generation
-To install and run from [Gradle](https://gradle.org/), add the following to `build.gradle`:
+## bld
-```gradle
-dependencies {
- annotationProcessor 'net.thauvin.erik:semver:1.2.0'
- implementation 'net.thauvin.erik:semver:1.2.0'
+To install and run from [bld](https://rife2.com/bld), just add the dependency to your build file:
+
+```java
+public class ExampleBuild extends Project {
+ public ExampleBuild() {
+ // ...
+ scope(compile)
+ .include(dependency("net.thauvin.erik", "semver", version(1, 2, 1)));
+ }
}
```
-The `GeneratedVersion` class will be automatically created in the `build/generated` directory upon compiling.
+Please look at [ExampleBuild](https://github.com/ethauvin/semver/blob/master/examples/java/bld/src/bld/java/com/example/ExampleBuild.java) in the [examples/java/bld](https://github.com/ethauvin/semver/tree/master/examples/java/bld) directory for a sample. It also shows how to incorporate the generated code into the `source tree`, more information is also available [here](https://forum.uwyn.com/post/36).
-#### Class & Source Generation
+bld also has a [Generated Version](https://github.com/rife2/bld-generated-version) extension which provides similar functionalities.
-In order to also incorporate the generated source code into the `source tree`, add the following to the very top of `build.gradle`:
+## Gradle
+
+### Class Generation
+
+To install and run from [Gradle](https://gradle.org/), add the following to [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/gradle/build.gradle):
```gradle
-compileJava.options.annotationProcessorGeneratedSourcesDirectory = file("${projectDir}/src/generated/java")
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ annotationProcessor 'net.thauvin.erik:semver:1.2.1'
+ compileOnly 'net.thauvin.erik:semver:1.2.1'
+}
+
+tasks.withType(JavaCompile).configureEach {
+ options.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
+}
```
-The `GeneratedVersion.java` file will now be located in `src/generated`.
+The directory containing the configuration files (`version.properties`, `version.mustache`) must be specified using the `semver.project.dir` processor argument.
-Please look at [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle) in the [Java example](https://github.com/ethauvin/semver/tree/master/examples/java) directory for a sample.
+The [`GeneratedVersion.java`](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) class will be automatically created in the `build/generated` directory upon compiling.
-### Kotlin
+Please look at [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/gradle/build.gradle) in the [examples/java/gradle](https://github.com/ethauvin/semver/tree/master/examples/java/gradle) directory for a sample.
+
+### Class & Source Generation
+
+In order to also incorporate the generated source code into the `source tree`, add the following to [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle):
+
+```gradle
+tasks.withType(JavaCompile).configureEach {
+ options.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
+}
+```
+
+The [`GeneratedVersion.java`](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) file will now be located in `src/generated`.
+
+## Kotlin
The annotation processor also supports [Kotlin](https://kotlinlang.org/).
@@ -235,55 +278,56 @@ import net.thauvin.erik.semver.Version
@Version(properties = "version.properties", type="kt")
open class Main {
-// ...
+ // ...
+}
```
+
The [Kotlin default template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver-kt.mustache) implements the same static fields and functions as the [Java template](#default-template).
-#### Kotlin & Gradle
+Please look at the [examples/kotlin](https://github.com/ethauvin/semver/tree/master/examples/kotlin) project for a [build.gradle.kts](https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts) sample.
-To install and run from [Gradle](https://gradle.org/), add the following to `build.gradle.kts`:
+### Kotlin & Gradle
+
+To install and run from [Gradle](https://gradle.org/), add the following to [build.gradle.kts](https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts):
```kotlin
-var semverProcessor = "net.thauvin.erik:semver:1.2.0"
+var semverProcessor = "net.thauvin.erik:semver:1.2.1"
dependencies {
kapt(semverProcessor)
- implementation (semverProcessor)
+ compileOnly(semverProcessor)
}
kapt {
arguments {
- arg("semver.project.dir", projectDir)
+ arg("semver.project.dir", projectDir.absolutePath)
}
}
```
-The arguments block is not required if `kapt` is configured to use the Gradle Worker API in `gradle.properties`:
-
-```ini
-kapt.use.worker.api=true
-```
-
-This option will likely be enabled by default in the future, but is currently not working under Java 10+ see [KT-26203](https://youtrack.jetbrains.net/issue/KT-26203).
-
-Please look at the [Kotlin example](https://github.com/ethauvin/semver/tree/master/examples/kotlin) project for a [build.gradle.kts](https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts) sample.
-
-### Kobalt
-
-To install and run from [Kobalt](https://beust.com/kobalt/), add the following to `Build.kt`:
-
-```gradle
-dependencies {
- apt("net.thauvin.erik:semver:1.2.0")
- compileOnly("net.thauvin.erik:semver:1.2.0")
-}
-```
-
-Please look at [Build.kt](https://github.com/ethauvin/semver/blob/master/examples/java/kobalt/src/Build.kt) in the [Java example](https://github.com/ethauvin/semver/tree/master/examples/java) directory for a sample.
-
+The directory containing the configuration files (`version.properties`, `version.mustache`) must be specified using the `semver.project.dir` processor argument.
## Auto-Increment
Incrementing the version is best left to your favorite build system. For a solution using Gradle, please have a look at the [__Semver Version Plugin for Gradle__](https://github.com/ethauvin/semver-gradle).
There are also full [examples](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor) in both [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/java) and [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/kotlin) showing how to use both the plugin and annotation processor concurrently.
+
+## Contributing
+
+If you want to contribute to this project, all you have to do is clone the GitHub
+repository:
+
+```console
+git clone git@github.com:ethauvin/semver.git
+```
+
+Then use [bld](https://rife2.com/bld) to build:
+
+```console
+cd semver
+./bld compile
+```
+
+The project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all
+the dependencies were downloaded and peruse the code.
diff --git a/appveyor.yml b/appveyor.yml
index 0ee7361..05e9258 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,26 +1,18 @@
-version: "{branch} {build}"
-skip_tags: true
+version: build-{build}.{branch}
+clone_depth: 3
-build:
- verbosity: detailed
+platform: x64
+image: Visual Studio 2019
+
+before_build:
+ - set "JAVA_HOME=C:\Program Files\Java\jdk17"
+ - set "PATH=C:\Program Files\Java\jdk17\bin;%PATH%"
build_script:
- - gradlew.bat assemble --info --no-daemon
+ - bld.bat download compile
test_script:
- - gradlew.bat check --info --no-daemon
-
-branches:
- only:
- - master
+ - bld.bat test
cache:
- - C:\Users\appveyor\.gradle
-
-environment:
- matrix:
- - JAVA_HOME: C:\Program Files\Java\jdk1.8.0
- - JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
-
-matrix:
- fast_finish: true
+ - C:\Users\appveyor\.m2
diff --git a/bin/main/META-INF/services/javax.annotation.processing.Processor b/bin/main/META-INF/services/javax.annotation.processing.Processor
new file mode 100644
index 0000000..5ae1016
--- /dev/null
+++ b/bin/main/META-INF/services/javax.annotation.processing.Processor
@@ -0,0 +1,33 @@
+#
+# javax.annotation.processing.Processor
+#
+# Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# Neither the name of this project nor the names of its contributors may be
+# used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+net.thauvin.erik.semver.VersionProcessor
diff --git a/bin/main/net/thauvin/erik/semver/Constants.class b/bin/main/net/thauvin/erik/semver/Constants.class
new file mode 100644
index 0000000..b299307
Binary files /dev/null and b/bin/main/net/thauvin/erik/semver/Constants.class differ
diff --git a/bin/main/net/thauvin/erik/semver/Version.class b/bin/main/net/thauvin/erik/semver/Version.class
new file mode 100644
index 0000000..239b8a2
Binary files /dev/null and b/bin/main/net/thauvin/erik/semver/Version.class differ
diff --git a/bin/main/net/thauvin/erik/semver/VersionInfo.class b/bin/main/net/thauvin/erik/semver/VersionInfo.class
new file mode 100644
index 0000000..8351bcf
Binary files /dev/null and b/bin/main/net/thauvin/erik/semver/VersionInfo.class differ
diff --git a/bin/main/net/thauvin/erik/semver/VersionProcessor.class b/bin/main/net/thauvin/erik/semver/VersionProcessor.class
new file mode 100644
index 0000000..38b5676
Binary files /dev/null and b/bin/main/net/thauvin/erik/semver/VersionProcessor.class differ
diff --git a/bin/main/net/thauvin/erik/semver/package.html b/bin/main/net/thauvin/erik/semver/package.html
new file mode 100644
index 0000000..1b1b126
--- /dev/null
+++ b/bin/main/net/thauvin/erik/semver/package.html
@@ -0,0 +1,12 @@
+
+
+
An annotation processor that automatically generates a GeneratedVersion class based on a Mustache template and containing the semantic version (major, minor, patch, etc.) that is read from a Properties file or defined in the annotation.
Upon running the annotation processor, a source file GeneratedVersion.java is automatically generated with static methods to access the semantic version data. The source is based on a fully customizable Mustache template.
-
To use your own template, simply create a version.mustache file in the project's root directory. The processor will automatically look for it.
+
Upon running the annotation processor, a source file GeneratedVersion.java
+is automatically generated with static methods to access the semantic
+version data. The source is based on a fully customizable Mustache template.
+
To use your own template, simply create a
+version.mustache file in the project's root directory. The
+processor will automatically look for it.
⚠️keysPrefix is a new element staring in 1.1.0 and may break older versions when using custom property keys.
-⚡ A quick fix is to include keysPrefix="" in the annotation to remove the default version. prefix.
+
⚠️
+keysPrefix is a new element staring in 1.1.0
+and may break older versions when using custom property keys.
+⚡ A quick fix is to include
+keysPrefix="" in the annotation to remove the default
+version. prefix.
-
Usage with Maven, Gradle, Kotlin and Kobalt
-
Maven
-
To install and run from Maven, configure an artifact as follows:
Please look at ExampleBuild
+in the examples/java/bld
+directory for a sample. It also shows how to incorporate the generated
+code into the source tree, more information is also
+available here.
+
bld also has a Generated
+Version extension which provides similar functionalities.
The directory containing the configuration files
+(version.properties, version.mustache) must be
+specified using the semver.project.dir processor
+argument.
+
The GeneratedVersion.java
+class will be automatically created in the build/generated
+directory upon compiling.
The directory containing the configuration files
+(version.properties, version.mustache) must be
+specified using the semver.project.dir processor
+argument.
Auto-Increment
-
Incrementing the version is best left to your favorite build system. For a solution using Gradle, please have a look at the Semver Version Plugin for Gradle.
-
There are also full examples in both Java and Kotlin showing how to use both the plugin and annotation processor concurrently.
+
Incrementing the version is best left to your favorite build system.
+For a solution using Gradle, please have a look at the Semver Version
+Plugin for Gradle.
+
There are also full examples
+in both Java
+and Kotlin
+showing how to use both the plugin and annotation processor
+concurrently.
+
Contributing
+
If you want to contribute to this project, all you have to do is
+clone the GitHub repository: