Compare commits
54 commits
Author | SHA1 | Date | |
---|---|---|---|
78a35dea31 | |||
03c749de68 | |||
5fa475a726 | |||
a2f08edcbe | |||
7028182522 | |||
5c2373ff8b | |||
2a7cacc945 | |||
2770d4a75e | |||
8ecb70758b | |||
90e584c0f1 | |||
c904f4a7a2 | |||
a82c416af5 | |||
4596e71a55 | |||
ed7a6ff9da | |||
fc785581ba | |||
8274798be5 | |||
3a767ddcb2 | |||
4961829fcd | |||
da20cf6fa1 | |||
14d38fa0da | |||
0857cb00a6 | |||
1694e6f665 | |||
028e173274 | |||
f8d708ffc8 | |||
c9d9e4695c | |||
b235ad4240 | |||
5b5bd56077 | |||
050fd5d3a6 | |||
e6316c70a2 | |||
7f2141044f | |||
8ee5ac7867 | |||
9d67f126b0 | |||
3b18ff1612 | |||
94254cd590 | |||
6f738cee9e | |||
bf75fb0faa | |||
c918b9ffa1 | |||
0c10b9aeba | |||
47ffb6e12b | |||
d11420dae3 | |||
6e4307cb61 | |||
02ee7eaf8b | |||
01f543ba8d | |||
1b153851fc | |||
b84ab29602 | |||
f71bc5c8ba | |||
81d415fb8a | |||
d62f8b591c | |||
86c0dff26e | |||
119818193d | |||
fd5746f007 | |||
1f9664cb7f | |||
4a6fa98d46 | |||
65d2eb0c7c |
93 changed files with 1050 additions and 643 deletions
|
@ -1,41 +1,42 @@
|
||||||
inversion: 2
|
version: 2.1
|
||||||
defaults: &defaults
|
|
||||||
working_directory: ~/repo
|
|
||||||
environment:
|
|
||||||
JVM_OPTS: -Xmx3200m
|
|
||||||
TERM: dumb
|
|
||||||
CI_NAME: "CircleCI"
|
|
||||||
|
|
||||||
defaults_gradle: &defaults_bld
|
commands:
|
||||||
|
build_and_test:
|
||||||
|
parameters:
|
||||||
|
reports-dir:
|
||||||
|
type: string
|
||||||
|
default: "build/reports/test_results"
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
name: Download the dependencies
|
name: Download dependencies
|
||||||
command: ./bld download
|
command: ./bld download
|
||||||
- run:
|
- run:
|
||||||
name: Run tests with bld
|
name: Compile source
|
||||||
command: ./bld compile test
|
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:
|
jobs:
|
||||||
bld_jdk20:
|
|
||||||
<<: *defaults
|
|
||||||
|
|
||||||
docker:
|
|
||||||
- image: cimg/openjdk:20.0
|
|
||||||
|
|
||||||
<<: *defaults_bld
|
|
||||||
|
|
||||||
bld_jdk17:
|
bld_jdk17:
|
||||||
<<: *defaults
|
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:17.0
|
- image: cimg/openjdk:17.0
|
||||||
|
steps:
|
||||||
|
- build_and_test
|
||||||
|
|
||||||
<<: *defaults_bld
|
bld_jdk21:
|
||||||
|
docker:
|
||||||
|
- image: cimg/openjdk:21.0
|
||||||
|
steps:
|
||||||
|
- build_and_test
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
|
||||||
bld:
|
bld:
|
||||||
jobs:
|
jobs:
|
||||||
- bld_jdk17
|
- bld_jdk17
|
||||||
- bld_jdk20
|
- bld_jdk21
|
||||||
|
|
57
.github/workflows/bld.yml
vendored
57
.github/workflows/bld.yml
vendored
|
@ -4,50 +4,73 @@ on: [ push, pull_request, workflow_dispatch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-bld-project:
|
build-bld-project:
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
COVERAGE_SDK: "17"
|
COVERAGE_JDK: "17"
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java-version: [ 17, 20 ]
|
java-version: [17, 21, 24]
|
||||||
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source repository
|
- name: Checkout source repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK ${{ matrix.java-version }}
|
- name: Set up JDK ${{ matrix.java-version }}
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: "zulu"
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
|
|
||||||
- name: Grant execute permission for bld
|
- name: Download dependencies [bld example]
|
||||||
run: chmod +x bld
|
working-directory: examples/java/bld
|
||||||
|
|
||||||
- name: Download the dependencies
|
|
||||||
run: ./bld download
|
run: ./bld download
|
||||||
|
|
||||||
- name: Run tests with bld
|
- name: Compile and run [bld example]
|
||||||
run: ./bld compile jacoco
|
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
|
- name: Remove pom.xml
|
||||||
if: success() && matrix.java-version == env.COVERAGE_SDK
|
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.os == 'ubuntu-latest'
|
||||||
run: rm -rf pom.xml
|
run: rm -rf pom.xml
|
||||||
|
|
||||||
- name: SonarCloud Scan
|
- name: SonarCloud Scan
|
||||||
uses: sonarsource/sonarcloud-github-action@master
|
uses: sonarsource/sonarcloud-github-action@master
|
||||||
if: success() && matrix.java-version == env.COVERAGE_SDK
|
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.os == 'ubuntu-latest'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
if: success() && matrix.java-version == env.COVERAGE_SDK
|
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.os == 'ubuntu-latest'
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -55,3 +55,4 @@ atlassian-ide-plugin.xml
|
||||||
.idea/httpRequests
|
.idea/httpRequests
|
||||||
|
|
||||||
local.properties
|
local.properties
|
||||||
|
target
|
||||||
|
|
3
.idea/app.iml
generated
3
.idea/app.iml
generated
|
@ -6,10 +6,9 @@
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" relativeOutputPath="resources" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/src/main/resources/templates" />
|
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|
6
.idea/bld.xml
generated
Normal file
6
.idea/bld.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="BldConfiguration">
|
||||||
|
<events />
|
||||||
|
</component>
|
||||||
|
</project>
|
16
.idea/compiler.xml
generated
16
.idea/compiler.xml
generated
|
@ -1,16 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile name="Gradle Imported" enabled="true">
|
|
||||||
<outputRelativeToContentRoot value="true" />
|
|
||||||
<option name="semver.project.dir" value="$PROJECT_DIR$/examples/java/gradle" />
|
|
||||||
<processorPath useClasspath="false">
|
|
||||||
<entry name="$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.2.1-SNAPSHOT/semver-1.2.1-SNAPSHOT.jar" />
|
|
||||||
<entry name="$MAVEN_REPOSITORY$/com/github/spullara/mustache/java/compiler/0.9.10/compiler-0.9.10.jar" />
|
|
||||||
</processorPath>
|
|
||||||
<module name="examples-java.main" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
6
.idea/copyright/profiles_settings.xml
generated
6
.idea/copyright/profiles_settings.xml
generated
|
@ -1,7 +1,3 @@
|
||||||
<component name="CopyrightManager">
|
<component name="CopyrightManager">
|
||||||
<settings>
|
<settings default="BSD-3 Clause" />
|
||||||
<module2copyright>
|
|
||||||
<element module="Source Code" copyright="BSD-3 Clause" />
|
|
||||||
</module2copyright>
|
|
||||||
</settings>
|
|
||||||
</component>
|
</component>
|
3
.idea/inspectionProfiles/Project_Default.xml
generated
3
.idea/inspectionProfiles/Project_Default.xml
generated
|
@ -2,8 +2,7 @@
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
<option name="ADDITIONAL_TAGS" value="created,created.on" />
|
<option name="ADDITIONAL_TAGS" value="created" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="RedundantExplicitVariableType" enabled="true" level="INFORMATION" enabled_by_default="true" editorAttributes="INFORMATION_ATTRIBUTES" />
|
|
||||||
</profile>
|
</profile>
|
||||||
</component>
|
</component>
|
204
.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
204
.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
|
@ -0,0 +1,204 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaDocConfiguration">
|
||||||
|
<GENERAL>
|
||||||
|
<MODE>UPDATE</MODE>
|
||||||
|
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
|
||||||
|
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
|
||||||
|
<LEVELS>
|
||||||
|
<LEVEL>FIELD</LEVEL>
|
||||||
|
<LEVEL>TYPE</LEVEL>
|
||||||
|
<LEVEL>METHOD</LEVEL>
|
||||||
|
</LEVELS>
|
||||||
|
<VISIBILITIES>
|
||||||
|
<VISIBILITY>DEFAULT</VISIBILITY>
|
||||||
|
<VISIBILITY>PUBLIC</VISIBILITY>
|
||||||
|
<VISIBILITY>PROTECTED</VISIBILITY>
|
||||||
|
</VISIBILITIES>
|
||||||
|
</GENERAL>
|
||||||
|
<TEMPLATES>
|
||||||
|
<CLASSES>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The enum ${name}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The type ${name}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
</CLASSES>
|
||||||
|
<CONSTRUCTORS>
|
||||||
|
<CONSTRUCTOR>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</CONSTRUCTOR>
|
||||||
|
</CONSTRUCTORS>
|
||||||
|
<METHODS>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
</METHODS>
|
||||||
|
<FIELDS>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The constant ${element.getName()}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
<#if element.parent.isInterface()>
|
||||||
|
* The constant ${element.getName()}.\n
|
||||||
|
<#else>
|
||||||
|
* The ${name}.\n
|
||||||
|
</#if> */</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
<#if element.parent.isEnum()>
|
||||||
|
*${name} ${typeName}.\n
|
||||||
|
<#else>
|
||||||
|
* The ${name}.\n
|
||||||
|
</#if>*/</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
</FIELDS>
|
||||||
|
</TEMPLATES>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/kotlinc.xml
generated
6
.idea/kotlinc.xml
generated
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="KotlinJpsPluginSettings">
|
|
||||||
<option name="version" value="1.9.10" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
5
.idea/libraries/bld.xml
generated
5
.idea/libraries/bld.xml
generated
|
@ -2,11 +2,12 @@
|
||||||
<library name="bld">
|
<library name="bld">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||||
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2.jar!/" />
|
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2-sources.jar!/" />
|
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||||
|
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<excluded>
|
<excluded>
|
||||||
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
||||||
|
|
8
.idea/libraries/compile.xml
generated
8
.idea/libraries/compile.xml
generated
|
@ -2,12 +2,16 @@
|
||||||
<library name="compile">
|
<library name="compile">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
4
.idea/libraries/runtime.xml
generated
4
.idea/libraries/runtime.xml
generated
|
@ -8,7 +8,7 @@
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
8
.idea/libraries/test.xml
generated
8
.idea/libraries/test.xml
generated
|
@ -2,13 +2,17 @@
|
||||||
<library name="test">
|
<library name="test">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
<root url="file://$PROJECT_DIR$/src/test/resources" />
|
<root url="file://$PROJECT_DIR$/src/test/resources" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
9
.idea/misc.xml
generated
9
.idea/misc.xml
generated
|
@ -2,17 +2,12 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="EntryPointsManager">
|
<component name="EntryPointsManager">
|
||||||
<pattern value="net.thauvin.erik.semver.SemverBuild" method="jacoco" />
|
<pattern value="net.thauvin.erik.semver.SemverBuild" method="jacoco" />
|
||||||
<pattern value="net.thauvin.erik.semver.SemverBuild" method="pmd" />
|
|
||||||
<pattern value="net.thauvin.erik.semver.SemverBuild" method="pandoc" />
|
<pattern value="net.thauvin.erik.semver.SemverBuild" method="pandoc" />
|
||||||
|
<pattern value="net.thauvin.erik.semver.SemverBuild" method="pmd" />
|
||||||
|
<pattern value="net.thauvin.erik.semver.SemverBuild" method="pmdCli" />
|
||||||
<pattern value="net.thauvin.erik.semver.SemverBuild" />
|
<pattern value="net.thauvin.erik.semver.SemverBuild" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
||||||
<component name="PDMPlugin">
|
<component name="PDMPlugin">
|
||||||
<option name="customRuleSets">
|
|
||||||
<list>
|
|
||||||
<option value="$PROJECT_DIR$/../bld-exec/config/pmd.xml" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
<option name="skipTestSources" value="false" />
|
<option name="skipTestSources" value="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
|
|
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
|
@ -4,7 +4,6 @@
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/app.iml" filepath="$PROJECT_DIR$/.idea/app.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/app.iml" filepath="$PROJECT_DIR$/.idea/app.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/bld.iml" filepath="$PROJECT_DIR$/.idea/bld.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/bld.iml" filepath="$PROJECT_DIR$/.idea/bld.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java.main.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java.main.iml" />
|
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
8
.idea/modules/examples-java.main.iml
generated
8
.idea/modules/examples-java.main.iml
generated
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module version="4">
|
|
||||||
<component name="AdditionalModuleElements">
|
|
||||||
<content url="file://$MODULE_DIR$/../../examples/java/gradle/src/generated/java">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../examples/java/gradle/src/generated/java" isTestSource="false" generated="true" />
|
|
||||||
</content>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
8
.idea/runConfigurations/Run Tests.xml
generated
8
.idea/runConfigurations/Run Tests.xml
generated
|
@ -1,7 +1,11 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Run Tests" type="Application" factoryName="Application" nameIsGenerated="true">
|
<configuration default="false" name="Run Tests" type="JUnit" factoryName="JUnit">
|
||||||
<option name="MAIN_CLASS_NAME" value="net.thauvin.erik.semver.SemVerTest" />
|
|
||||||
<module name="app" />
|
<module name="app" />
|
||||||
|
<option name="PACKAGE_NAME" value="moog" />
|
||||||
|
<option name="MAIN_CLASS_NAME" value="net.thauvin.erik" />
|
||||||
|
<option name="METHOD_NAME" value="" />
|
||||||
|
<option name="TEST_OBJECT" value="directory" />
|
||||||
|
<dir value="$PROJECT_DIR$/src/test/java" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="Make" enabled="true" />
|
<option name="Make" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
|
|
3
.idea/scopes/Source_Code.xml
generated
3
.idea/scopes/Source_Code.xml
generated
|
@ -1,3 +0,0 @@
|
||||||
<component name="DependencyValidationManager">
|
|
||||||
<scope name="Source Code" pattern="*.java||file[bld]:*/||file[app]:src/main/java//*||file[app]:src/test/java//*" />
|
|
||||||
</component>
|
|
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "Run Tests",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "net.thauvin.erik.semver.SemverTest"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
15
.vscode/settings.json
vendored
15
.vscode/settings.json
vendored
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"java.project.sourcePaths": [
|
|
||||||
"src/main/java",
|
|
||||||
"src/main/resources",
|
|
||||||
"src/test/java",
|
|
||||||
"src/bld/java"
|
|
||||||
],
|
|
||||||
"java.configuration.updateBuildConfiguration": "automatic",
|
|
||||||
"java.project.referencedLibraries": [
|
|
||||||
"${HOME}bld-1.7.2.jar",
|
|
||||||
"lib/compile/*.jar",
|
|
||||||
"lib/runtime/*.jar",
|
|
||||||
"lib/test/*.jar"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|
45
README.md
45
README.md
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[](https://opensource.org/licenses/BSD-3-Clause)
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||||
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
|
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
|
||||||
[](https://rife2.com/bld)
|
[](https://rife2.com/bld)
|
||||||
[](https://github.com/ethauvin/semver/releases/latest)
|
[](https://github.com/ethauvin/semver/releases/latest)
|
||||||
[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)
|
[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)
|
||||||
[](https://central.sonatype.com/artifact/net.thauvin.erik/semver)
|
[](https://central.sonatype.com/artifact/net.thauvin.erik/semver)
|
||||||
|
|
||||||
[](https://sonarcloud.io/dashboard?id=ethauvin_semver)
|
[](https://sonarcloud.io/dashboard?id=ethauvin_semver)
|
||||||
[](https://github.com/ethauvin/semver/actions/workflows/gradle.yml)
|
[](https://github.com/ethauvin/semver/actions/workflows/bld.yml)
|
||||||
[](https://ci.appveyor.com/project/ethauvin/semver)
|
[](https://ci.appveyor.com/project/ethauvin/semver)
|
||||||
[](https://circleci.com/gh/ethauvin/semver/tree/master)
|
[](https://circleci.com/gh/ethauvin/semver/tree/master)
|
||||||
|
|
||||||
|
@ -18,19 +18,22 @@ This processor was inspired by Cédric Beust's [version-processor](https://githu
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Semantic Version Annotation Processor](#semantic-version-annotation-processor)
|
||||||
|
- [Table of Contents](#table-of-contents)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Template](#template)
|
- [Template](#template)
|
||||||
- [Default Template](#default-template)
|
- [Default Template](#default-template)
|
||||||
- [Custom Template](#custom-template)
|
- [Custom Template](#custom-template)
|
||||||
- [Elements & Properties](#elements--properties)
|
- [Elements \& Properties](#elements--properties)
|
||||||
- [Maven](#maven)
|
- [Maven](#maven)
|
||||||
- [bld](#bld)
|
- [bld](#bld)
|
||||||
- [Gradle](#gradle)
|
- [Gradle](#gradle)
|
||||||
- [Class Generation](#class-generation)
|
- [Class Generation](#class-generation)
|
||||||
- [Class & Source Generation](#class--source-generation)
|
- [Class \& Source Generation](#class--source-generation)
|
||||||
- [Kotlin](#kotlin)
|
- [Kotlin](#kotlin)
|
||||||
- [Kotlin & Gradle](#kotlin--gradle)
|
- [Kotlin \& Gradle](#kotlin--gradle)
|
||||||
- [Auto-Increment](#auto-increment)
|
- [Auto-Increment](#auto-increment)
|
||||||
|
- [Contributing](#contributing)
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@ -134,8 +137,6 @@ The mustache variables automatically filled in by the processor are:
|
||||||
| `{{separator}}` | The version separator. | `String` |
|
| `{{separator}}` | The version separator. | `String` |
|
||||||
| `{{semver}}` or `{{version}}` | The full semantic version. | `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)
|
|
||||||
|
|
||||||
## Elements & Properties
|
## Elements & Properties
|
||||||
|
|
||||||
The following annotation elements and properties are available:
|
The following annotation elements and properties are available:
|
||||||
|
@ -202,12 +203,13 @@ To install and run from [Maven](https://maven.apache.org/), configure an artifac
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
Please look at [pom.xml](https://github.com/ethauvin/semver/blob/master/examples/java/pom.xml) in the [examples/java](https://github.com/ethauvin/semver/tree/master/examples/java) directory for a sample:
|
```console
|
||||||
|
|
||||||
```bash
|
|
||||||
mvn verify
|
mvn verify
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
|
||||||
## bld
|
## bld
|
||||||
|
|
||||||
To install and run from [bld](https://rife2.com/bld), just add the dependency to your build file:
|
To install and run from [bld](https://rife2.com/bld), just add the dependency to your build file:
|
||||||
|
@ -224,6 +226,8 @@ public class ExampleBuild extends Project {
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
bld also has a [Generated Version](https://github.com/rife2/bld-generated-version) extension which provides similar functionalities.
|
||||||
|
|
||||||
## Gradle
|
## Gradle
|
||||||
|
|
||||||
### Class Generation
|
### Class Generation
|
||||||
|
@ -296,7 +300,7 @@ dependencies {
|
||||||
|
|
||||||
kapt {
|
kapt {
|
||||||
arguments {
|
arguments {
|
||||||
arg("semver.project.dir", projectDir)
|
arg("semver.project.dir", projectDir.absolutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -308,3 +312,22 @@ The directory containing the configuration files (`version.properties`, `version
|
||||||
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).
|
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.
|
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.
|
||||||
|
|
|
@ -7,8 +7,9 @@
|
||||||
<!-- BEST PRACTICES -->
|
<!-- BEST PRACTICES -->
|
||||||
<rule ref="category/java/bestpractices.xml">
|
<rule ref="category/java/bestpractices.xml">
|
||||||
<exclude name="AvoidPrintStackTrace"/>
|
<exclude name="AvoidPrintStackTrace"/>
|
||||||
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
|
<exclude name="GuardLogStatement"/>
|
||||||
<exclude name="JUnitTestContainsTooManyAsserts"/>
|
<exclude name="UnitTestContainsTooManyAsserts"/>
|
||||||
|
<exclude name="UnitTestShouldUseTestAnnotation"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="category/java/bestpractices.xml/MissingOverride">
|
<rule ref="category/java/bestpractices.xml/MissingOverride">
|
||||||
|
@ -23,17 +24,20 @@
|
||||||
<rule ref="category/java/codestyle.xml">
|
<rule ref="category/java/codestyle.xml">
|
||||||
<exclude name="AtLeastOneConstructor"/>
|
<exclude name="AtLeastOneConstructor"/>
|
||||||
<exclude name="ClassNamingConventions"/>
|
<exclude name="ClassNamingConventions"/>
|
||||||
<exclude name="ConfusingTernary"/>
|
|
||||||
<exclude name="CommentDefaultAccessModifier"/>
|
<exclude name="CommentDefaultAccessModifier"/>
|
||||||
|
<exclude name="ConfusingTernary"/>
|
||||||
<exclude name="FieldNamingConventions"/>
|
<exclude name="FieldNamingConventions"/>
|
||||||
|
<exclude name="LocalVariableCouldBeFinal"/>
|
||||||
<exclude name="LongVariable"/>
|
<exclude name="LongVariable"/>
|
||||||
|
<exclude name="MethodArgumentCouldBeFinal"/>
|
||||||
<exclude name="OnlyOneReturn"/>
|
<exclude name="OnlyOneReturn"/>
|
||||||
<exclude name="PackageCase"/>
|
<exclude name="PackageCase"/>
|
||||||
<exclude name="ShortClassName"/>
|
<exclude name="ShortClassName"/>
|
||||||
<exclude name="ShortMethodName"/>
|
<exclude name="ShortMethodName"/>
|
||||||
<exclude name="ShortVariable"/>
|
<exclude name="ShortVariable"/>
|
||||||
<exclude name="UselessParentheses"/>
|
<exclude name="UseExplicitTypes"/>
|
||||||
<exclude name="UseUnderscoresInNumericLiterals"/>
|
<exclude name="UseUnderscoresInNumericLiterals"/>
|
||||||
|
<exclude name="UselessParentheses"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="category/java/codestyle.xml/UnnecessaryImport">
|
<rule ref="category/java/codestyle.xml/UnnecessaryImport">
|
||||||
|
@ -49,8 +53,6 @@
|
||||||
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
|
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
|
||||||
<exclude name="CognitiveComplexity"/>
|
<exclude name="CognitiveComplexity"/>
|
||||||
<exclude name="CyclomaticComplexity"/>
|
<exclude name="CyclomaticComplexity"/>
|
||||||
<exclude name="ExcessiveClassLength"/>
|
|
||||||
<exclude name="ExcessiveMethodLength"/>
|
|
||||||
<exclude name="ExcessiveParameterList"/>
|
<exclude name="ExcessiveParameterList"/>
|
||||||
<exclude name="ExcessivePublicCount"/>
|
<exclude name="ExcessivePublicCount"/>
|
||||||
<exclude name="GodClass"/>
|
<exclude name="GodClass"/>
|
||||||
|
@ -77,7 +79,6 @@
|
||||||
<exclude name="AvoidFieldNameMatchingMethodName"/>
|
<exclude name="AvoidFieldNameMatchingMethodName"/>
|
||||||
<exclude name="AvoidFieldNameMatchingTypeName"/>
|
<exclude name="AvoidFieldNameMatchingTypeName"/>
|
||||||
<exclude name="AvoidLiteralsInIfCondition"/>
|
<exclude name="AvoidLiteralsInIfCondition"/>
|
||||||
<exclude name="EmptyCatchBlock"/>
|
|
||||||
<exclude name="NullAssignment"/>
|
<exclude name="NullAssignment"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
@ -93,13 +94,6 @@
|
||||||
<property name="skipAnnotations" value="true"/>
|
<property name="skipAnnotations" value="true"/>
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
|
|
||||||
<properties>
|
|
||||||
<property name="allowExceptionNameRegex">
|
|
||||||
<value>^ignore$</value>
|
|
||||||
</property>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<!-- MULTITHREADING -->
|
<!-- MULTITHREADING -->
|
||||||
<rule ref="category/java/multithreading.xml">
|
<rule ref="category/java/multithreading.xml">
|
||||||
|
|
|
@ -11,8 +11,11 @@
|
||||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||||
div.column{flex: auto; overflow-x: auto;}
|
div.column{flex: auto; overflow-x: auto;}
|
||||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||||
ul.task-list{list-style: none;}
|
/* The extra [class] is a hack that increases specificity enough to
|
||||||
|
override a similar rule in reveal.js */
|
||||||
|
ul.task-list[class]{list-style: none;}
|
||||||
ul.task-list li input[type="checkbox"] {
|
ul.task-list li input[type="checkbox"] {
|
||||||
|
font-size: inherit;
|
||||||
width: 0.8em;
|
width: 0.8em;
|
||||||
margin: 0 0.8em 0.2em -1.6em;
|
margin: 0 0.8em 0.2em -1.6em;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
@ -97,7 +100,7 @@ alt="License (3-Clause BSD)" /></a> <a
|
||||||
href="https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html"><img
|
href="https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html"><img
|
||||||
src="https://img.shields.io/badge/java-17%2B-blue" alt="Java" /></a> <a
|
src="https://img.shields.io/badge/java-17%2B-blue" alt="Java" /></a> <a
|
||||||
href="https://rife2.com/bld"><img
|
href="https://rife2.com/bld"><img
|
||||||
src="https://img.shields.io/badge/1.7.2-FA9052?label=bld&labelColor=2392FF"
|
src="https://img.shields.io/badge/1.9.0-FA9052?label=bld&labelColor=2392FF"
|
||||||
alt="bld" /></a> <a
|
alt="bld" /></a> <a
|
||||||
href="https://github.com/ethauvin/semver/releases/latest"><img
|
href="https://github.com/ethauvin/semver/releases/latest"><img
|
||||||
src="https://img.shields.io/github/release/ethauvin/semver.svg"
|
src="https://img.shields.io/github/release/ethauvin/semver.svg"
|
||||||
|
@ -157,6 +160,7 @@ Generation</a></li>
|
||||||
<li><a href="#kotlin--gradle">Kotlin & Gradle</a></li>
|
<li><a href="#kotlin--gradle">Kotlin & Gradle</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#auto-increment">Auto-Increment</a></li>
|
<li><a href="#auto-increment">Auto-Increment</a></li>
|
||||||
|
<li><a href="#contributing">Contributing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2 id="examples">Examples</h2>
|
<h2 id="examples">Examples</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -368,10 +372,6 @@ are:</p>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p>Please also look at this <a
|
|
||||||
href="https://github.com/ethauvin/mobibot/blob/master/version.mustache">example</a>
|
|
||||||
using <a
|
|
||||||
href="https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html"><code>java.time</code></a></p>
|
|
||||||
<h2 id="elements--properties">Elements & Properties</h2>
|
<h2 id="elements--properties">Elements & Properties</h2>
|
||||||
<p>The following annotation elements and properties are available:</p>
|
<p>The following annotation elements and properties are available:</p>
|
||||||
<table>
|
<table>
|
||||||
|
@ -546,6 +546,9 @@ href="https://github.com/ethauvin/semver/tree/master/examples/java/bld">examples
|
||||||
directory for a sample. It also shows how to incorporate the generated
|
directory for a sample. It also shows how to incorporate the generated
|
||||||
code into the <code>source tree</code>, more information is also
|
code into the <code>source tree</code>, more information is also
|
||||||
available <a href="https://forum.uwyn.com/post/36">here</a>.</p>
|
available <a href="https://forum.uwyn.com/post/36">here</a>.</p>
|
||||||
|
<p>bld also has a <a
|
||||||
|
href="https://github.com/rife2/bld-generated-version">Generated
|
||||||
|
Version</a> extension which provides similar functionalities.</p>
|
||||||
<h2 id="gradle">Gradle</h2>
|
<h2 id="gradle">Gradle</h2>
|
||||||
<h3 id="class-generation">Class Generation</h3>
|
<h3 id="class-generation">Class Generation</h3>
|
||||||
<p>To install and run from <a href="https://gradle.org/">Gradle</a>, add
|
<p>To install and run from <a href="https://gradle.org/">Gradle</a>, add
|
||||||
|
@ -643,5 +646,15 @@ and <a
|
||||||
href="https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/kotlin">Kotlin</a>
|
href="https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/kotlin">Kotlin</a>
|
||||||
showing how to use both the plugin and annotation processor
|
showing how to use both the plugin and annotation processor
|
||||||
concurrently.</p>
|
concurrently.</p>
|
||||||
|
<h2 id="contributing">Contributing</h2>
|
||||||
|
<p>If you want to contribute to this project, all you have to do is
|
||||||
|
clone the GitHub repository:</p>
|
||||||
|
<pre class="console"><code>git clone git@github.com:ethauvin/semver.git</code></pre>
|
||||||
|
<p>Then use <a href="https://rife2.com/bld">bld</a> to build:</p>
|
||||||
|
<pre class="console"><code>cd semver
|
||||||
|
./bld compile</code></pre>
|
||||||
|
<p>The project has an <a href="https://www.jetbrains.com/idea/">IntelliJ
|
||||||
|
IDEA</a> project structure. You can just open it after all the
|
||||||
|
dependencies were downloaded and peruse the code.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
1
examples/java/bld/.gitignore
vendored
1
examples/java/bld/.gitignore
vendored
|
@ -5,6 +5,7 @@ lib/bld/**
|
||||||
!lib/bld/bld-wrapper.jar
|
!lib/bld/bld-wrapper.jar
|
||||||
!lib/bld/bld-wrapper.properties
|
!lib/bld/bld-wrapper.properties
|
||||||
lib/compile/
|
lib/compile/
|
||||||
|
lib/provided/
|
||||||
lib/runtime/
|
lib/runtime/
|
||||||
lib/standalone/
|
lib/standalone/
|
||||||
lib/test/
|
lib/test/
|
||||||
|
|
1
examples/java/bld/.idea/.name
generated
Normal file
1
examples/java/bld/.idea/.name
generated
Normal file
|
@ -0,0 +1 @@
|
||||||
|
semver-examples-bld
|
6
examples/java/bld/.idea/bld.xml
generated
Normal file
6
examples/java/bld/.idea/bld.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="BldConfiguration">
|
||||||
|
<events />
|
||||||
|
</component>
|
||||||
|
</project>
|
204
examples/java/bld/.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
204
examples/java/bld/.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
|
@ -0,0 +1,204 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaDocConfiguration">
|
||||||
|
<GENERAL>
|
||||||
|
<MODE>UPDATE</MODE>
|
||||||
|
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
|
||||||
|
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
|
||||||
|
<LEVELS>
|
||||||
|
<LEVEL>METHOD</LEVEL>
|
||||||
|
<LEVEL>TYPE</LEVEL>
|
||||||
|
<LEVEL>FIELD</LEVEL>
|
||||||
|
</LEVELS>
|
||||||
|
<VISIBILITIES>
|
||||||
|
<VISIBILITY>PUBLIC</VISIBILITY>
|
||||||
|
<VISIBILITY>DEFAULT</VISIBILITY>
|
||||||
|
<VISIBILITY>PROTECTED</VISIBILITY>
|
||||||
|
</VISIBILITIES>
|
||||||
|
</GENERAL>
|
||||||
|
<TEMPLATES>
|
||||||
|
<CLASSES>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The enum ${name}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The type ${name}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
</CLASSES>
|
||||||
|
<CONSTRUCTORS>
|
||||||
|
<CONSTRUCTOR>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</CONSTRUCTOR>
|
||||||
|
</CONSTRUCTORS>
|
||||||
|
<METHODS>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\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>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
</METHODS>
|
||||||
|
<FIELDS>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The constant ${element.getName()}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
<#if element.parent.isInterface()>
|
||||||
|
* The constant ${element.getName()}.\n
|
||||||
|
<#else>
|
||||||
|
* The ${name}.\n
|
||||||
|
</#if> */</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
<#if element.parent.isEnum()>
|
||||||
|
*${name} ${typeName}.\n
|
||||||
|
<#else>
|
||||||
|
* The ${name}.\n
|
||||||
|
</#if>*/</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
</FIELDS>
|
||||||
|
</TEMPLATES>
|
||||||
|
</component>
|
||||||
|
</project>
|
5
examples/java/bld/.idea/libraries/bld.xml
generated
5
examples/java/bld/.idea/libraries/bld.xml
generated
|
@ -2,11 +2,12 @@
|
||||||
<library name="bld">
|
<library name="bld">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||||
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2.jar!/" />
|
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2-sources.jar!/" />
|
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||||
|
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<excluded>
|
<excluded>
|
||||||
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
||||||
|
|
8
examples/java/bld/.idea/libraries/compile.xml
generated
8
examples/java/bld/.idea/libraries/compile.xml
generated
|
@ -2,12 +2,16 @@
|
||||||
<library name="compile">
|
<library name="compile">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
4
examples/java/bld/.idea/libraries/runtime.xml
generated
4
examples/java/bld/.idea/libraries/runtime.xml
generated
|
@ -8,7 +8,7 @@
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
8
examples/java/bld/.idea/libraries/test.xml
generated
8
examples/java/bld/.idea/libraries/test.xml
generated
|
@ -2,13 +2,17 @@
|
||||||
<library name="test">
|
<library name="test">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
<root url="file://$PROJECT_DIR$/src/test/resources" />
|
<root url="file://$PROJECT_DIR$/src/test/resources" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||||
|
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
|
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
10
examples/java/bld/.vscode/settings.json
vendored
10
examples/java/bld/.vscode/settings.json
vendored
|
@ -3,13 +3,13 @@
|
||||||
"src/main/java",
|
"src/main/java",
|
||||||
"src/main/resources",
|
"src/main/resources",
|
||||||
"src/test/java",
|
"src/test/java",
|
||||||
"src/bld/java"
|
"src/test/resources",
|
||||||
|
"src/bld/java",
|
||||||
|
"src/bld/resources"
|
||||||
],
|
],
|
||||||
"java.configuration.updateBuildConfiguration": "automatic",
|
"java.configuration.updateBuildConfiguration": "automatic",
|
||||||
"java.project.referencedLibraries": [
|
"java.project.referencedLibraries": [
|
||||||
"${HOME}bld-1.7.2.jar",
|
"${HOME}/.bld/dist/bld-2.2.1.jar",
|
||||||
"lib/compile/*.jar",
|
"lib/**/*.jar"
|
||||||
"lib/runtime/*.jar",
|
|
||||||
"lib/test/*.jar"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
10
examples/java/bld/README.md
Normal file
10
examples/java/bld/README.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
To compile & run the examples:
|
||||||
|
|
||||||
|
```console
|
||||||
|
./bld compile
|
||||||
|
|
||||||
|
./bld run
|
||||||
|
./bld run-example
|
||||||
|
```
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
bld.downloadExtensionJavadoc=false
|
bld.downloadExtensionJavadoc=false
|
||||||
bld.downloadExtensionSources=true
|
bld.downloadExtensionSources=true
|
||||||
|
bld.downloadLocation=
|
||||||
bld.extensions=
|
bld.extensions=
|
||||||
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
||||||
bld.downloadLocation=
|
|
||||||
bld.sourceDirectories=
|
bld.sourceDirectories=
|
||||||
bld.version=1.7.2
|
bld.version=2.2.1
|
||||||
|
|
|
@ -2,20 +2,16 @@ package com.example;
|
||||||
|
|
||||||
import rife.bld.BuildCommand;
|
import rife.bld.BuildCommand;
|
||||||
import rife.bld.Project;
|
import rife.bld.Project;
|
||||||
|
import rife.bld.operations.JavacOptions.Processing;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static rife.bld.dependencies.Repository.*;
|
import static rife.bld.dependencies.Repository.*;
|
||||||
import static rife.bld.dependencies.Scope.compile;
|
import static rife.bld.dependencies.Scope.provided;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example build.
|
* Example build.
|
||||||
*
|
|
||||||
* <ul style="list-style-type:none">
|
|
||||||
* <li>./bld run</li>
|
|
||||||
* <li>./bld runExample</li>
|
|
||||||
* </ul>
|
|
||||||
*/
|
*/
|
||||||
public class ExampleBuild extends Project {
|
public class ExampleBuild extends Project {
|
||||||
public ExampleBuild() {
|
public ExampleBuild() {
|
||||||
|
@ -27,9 +23,9 @@ public class ExampleBuild extends Project {
|
||||||
|
|
||||||
testOperation().mainClass("com.example.ExampleTest");
|
testOperation().mainClass("com.example.ExampleTest");
|
||||||
|
|
||||||
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
|
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
|
||||||
|
|
||||||
scope(compile).include(dependency("net.thauvin.erik", "semver", version(1, 2, 1)));
|
scope(provided).include(dependency("net.thauvin.erik", "semver", version(1, 2, 2, "SNAPSHOT")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -46,11 +42,11 @@ public class ExampleBuild extends Project {
|
||||||
public void compile() throws Exception {
|
public void compile() throws Exception {
|
||||||
var generated = new File(buildDirectory(), "generated");
|
var generated = new File(buildDirectory(), "generated");
|
||||||
var ignore = generated.mkdir();
|
var ignore = generated.mkdir();
|
||||||
compileOperation().compileOptions().addAll(List.of("-s", generated.getAbsolutePath()));
|
compileOperation().compileOptions().process(Processing.FULL).sourceOutput(generated);
|
||||||
super.compile();
|
super.compile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@BuildCommand(summary = "Run the example")
|
@BuildCommand(value = "run-example", summary = "Runs the example")
|
||||||
public void runExample() throws Exception {
|
public void runExample() throws Exception {
|
||||||
runOperation().fromProject(this).mainClass("com.example.Example").execute();
|
runOperation().fromProject(this).mainClass("com.example.Example").execute();
|
||||||
}
|
}
|
||||||
|
|
2
examples/java/gradle/.idea/.name
generated
2
examples/java/gradle/.idea/.name
generated
|
@ -1 +1 @@
|
||||||
examples-java
|
semver-examples-java-gradle
|
13
examples/java/gradle/.idea/compiler.xml
generated
13
examples/java/gradle/.idea/compiler.xml
generated
|
@ -1,7 +1,18 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel>
|
<annotationProcessing>
|
||||||
|
<profile name="Gradle Imported" enabled="true">
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<option name="semver.project.dir" value="$PROJECT_DIR$" />
|
||||||
|
<processorPath useClasspath="false">
|
||||||
|
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.thauvin.erik/semver/1.2.2-SNAPSHOT/31d53f3e9fdd226343234d13a080d6fd12b58ae6/semver-1.2.2-SNAPSHOT.jar" />
|
||||||
|
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spullara.mustache.java/compiler/0.9.13/60666500a7dce7a5d3e17c09b46ea6f037192bd5/compiler-0.9.13.jar" />
|
||||||
|
</processorPath>
|
||||||
|
<module name="examples-java.main" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
<bytecodeTargetLevel target="17">
|
||||||
<module name="examples-java_main" target="1.8" />
|
<module name="examples-java_main" target="1.8" />
|
||||||
<module name="examples-java_test" target="1.8" />
|
<module name="examples-java_test" target="1.8" />
|
||||||
</bytecodeTargetLevel>
|
</bytecodeTargetLevel>
|
||||||
|
|
9
examples/java/gradle/.idea/gradle.iml
generated
Normal file
9
examples/java/gradle/.idea/gradle.iml
generated
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
9
examples/java/gradle/.idea/misc.xml
generated
9
examples/java/gradle/.idea/misc.xml
generated
|
@ -1,6 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="PDMPlugin">
|
||||||
|
<option name="skipTestSources" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/classes" />
|
<output url="file://$PROJECT_DIR$/classes" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
4
examples/java/gradle/.idea/modules.xml
generated
4
examples/java/gradle/.idea/modules.xml
generated
|
@ -2,9 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/gradle.iml" filepath="$PROJECT_DIR$/.idea/gradle.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java_main.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java_main.iml" group="examples-java" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java_test.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java_test.iml" group="examples-java" />
|
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
13
examples/java/gradle/.idea/modules/examples-java.iml
generated
13
examples/java/gradle/.idea/modules/examples-java.iml
generated
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.id="examples-java" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../..">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/../../build" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/../../out" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
8
examples/java/gradle/.idea/modules/examples-java.main.iml
generated
Normal file
8
examples/java/gradle/.idea/modules/examples-java.main.iml
generated
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="AdditionalModuleElements">
|
||||||
|
<content url="file://$MODULE_DIR$/../../src/generated/java">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/../../src/generated/java" isTestSource="false" generated="true" />
|
||||||
|
</content>
|
||||||
|
</component>
|
||||||
|
</module>
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.id="examples-java:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/../../out/production/classes" />
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../../src/generated">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/generated" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../../src/main">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.0.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.4" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.id="examples-java:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../../src/test">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module" module-name="examples-java_main" />
|
|
||||||
</component>
|
|
||||||
<component name="TestModuleProperties" production-module="examples-java_main" />
|
|
||||||
</module>
|
|
1
examples/java/gradle/.idea/vcs.xml
generated
1
examples/java/gradle/.idea/vcs.xml
generated
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
9
examples/java/gradle/README.md
Normal file
9
examples/java/gradle/README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
To run the examples:
|
||||||
|
|
||||||
|
```console
|
||||||
|
./gradlew run
|
||||||
|
./gradlew runExample
|
||||||
|
```
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'application'
|
id 'application'
|
||||||
id 'com.github.ben-manes.versions' version '0.48.0'
|
id 'com.github.ben-manes.versions' version '0.51.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
// ./gradlew run
|
|
||||||
// ./gradlew runExample
|
|
||||||
|
|
||||||
defaultTasks 'run'
|
defaultTasks 'run'
|
||||||
|
|
||||||
final def semverProcessor = 'net.thauvin.erik:semver:1.2.1'
|
final def semverProcessor = 'net.thauvin.erik:semver:1.2.2-SNAPSHOT'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
@ -28,7 +25,7 @@ java {
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClassName = 'com.example.App'
|
mainClass = 'com.example.App'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
24
examples/java/gradle/gradlew
vendored
24
examples/java/gradle/gradlew
vendored
|
@ -15,6 +15,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
|
@ -55,7 +57,7 @@
|
||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
@ -84,7 +86,7 @@ done
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
@ -112,7 +114,7 @@ case "$( uname )" in #(
|
||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
|
@ -145,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
|
@ -153,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@ -202,16 +204,16 @@ fi
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|
26
examples/java/gradle/gradlew.bat
vendored
26
examples/java/gradle/gradlew.bat
vendored
|
@ -13,6 +13,8 @@
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -27,10 +28,9 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.14.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<release>17</release>
|
||||||
<target>1.8</target>
|
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<generatedSourcesDirectory>src/generated/java</generatedSourcesDirectory>
|
<generatedSourcesDirectory>src/generated/java</generatedSourcesDirectory>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.5.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>run</id>
|
<id>run</id>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
||||||
|
|
||||||
public final class ExampleVersion {
|
public final class ExampleVersion {
|
||||||
public static final String PROJECT = "Java Example";
|
public static final String PROJECT = "Java Example";
|
||||||
public static final Date BUILDDATE = new Date(1696209996065L);
|
public static final Date BUILDDATE = new Date(1742447853077L);
|
||||||
public static final String VERSION = "8.4.97-alpha+T800";
|
public static final String VERSION = "8.4.97-alpha+T800";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Date;
|
||||||
*/
|
*/
|
||||||
public final class GeneratedVersion {
|
public final class GeneratedVersion {
|
||||||
public static final String PROJECT = "Java App";
|
public static final String PROJECT = "Java App";
|
||||||
public static final Date BUILDDATE = new Date(1696209996080L);
|
public static final Date BUILDDATE = new Date(1742447853101L);
|
||||||
public static final int MAJOR = 11;
|
public static final int MAJOR = 11;
|
||||||
public static final int MINOR = 11;
|
public static final int MINOR = 11;
|
||||||
public static final int PATCH = 20;
|
public static final int PATCH = 20;
|
||||||
|
|
2
examples/kotlin/.idea/.name
generated
2
examples/kotlin/.idea/.name
generated
|
@ -1 +1 @@
|
||||||
examples-kotlin
|
semver-examples-kotlin-gradle
|
2
examples/kotlin/.idea/compiler.xml
generated
2
examples/kotlin/.idea/compiler.xml
generated
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel>
|
<bytecodeTargetLevel target="17">
|
||||||
<module name="examples-kotlin_main" target="1.8" />
|
<module name="examples-kotlin_main" target="1.8" />
|
||||||
<module name="examples-kotlin_test" target="1.8" />
|
<module name="examples-kotlin_test" target="1.8" />
|
||||||
</bytecodeTargetLevel>
|
</bytecodeTargetLevel>
|
||||||
|
|
30
examples/kotlin/.idea/jarRepositories.xml
generated
Normal file
30
examples/kotlin/.idea/jarRepositories.xml
generated
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenLocal" />
|
||||||
|
<option name="name" value="MavenLocal" />
|
||||||
|
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenRepo" />
|
||||||
|
<option name="name" value="MavenRepo" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven" />
|
||||||
|
<option name="name" value="maven" />
|
||||||
|
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
9
examples/kotlin/.idea/kotlin.iml
generated
Normal file
9
examples/kotlin/.idea/kotlin.iml
generated
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
3
examples/kotlin/.idea/kotlinc.xml
generated
3
examples/kotlin/.idea/kotlinc.xml
generated
|
@ -4,4 +4,7 @@
|
||||||
<option name="sourceMapEmbedSources" />
|
<option name="sourceMapEmbedSources" />
|
||||||
<option name="sourceMapPrefix" />
|
<option name="sourceMapPrefix" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="KotlinJpsPluginSettings">
|
||||||
|
<option name="version" value="2.0.20" />
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
9
examples/kotlin/.idea/misc.xml
generated
9
examples/kotlin/.idea/misc.xml
generated
|
@ -1,6 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="PDMPlugin">
|
||||||
|
<option name="skipTestSources" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/classes" />
|
<output url="file://$PROJECT_DIR$/classes" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
4
examples/kotlin/.idea/modules.xml
generated
4
examples/kotlin/.idea/modules.xml
generated
|
@ -2,9 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-kotlin.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-kotlin.iml" group="examples-kotlin" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/kotlin.iml" filepath="$PROJECT_DIR$/.idea/kotlin.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-kotlin_main.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-kotlin_main.iml" group="examples-kotlin" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-kotlin_test.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-kotlin_test.iml" group="examples-kotlin" />
|
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
13
examples/kotlin/.idea/modules/examples-kotlin.iml
generated
13
examples/kotlin/.idea/modules/examples-kotlin.iml
generated
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.id="examples-kotlin" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../..">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/../../build" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/../../out" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,59 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.id="examples-kotlin:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
|
||||||
<configuration version="3" platform="JVM 1.6" useProjectSettings="false">
|
|
||||||
<compilerSettings />
|
|
||||||
<compilerArguments>
|
|
||||||
<option name="destination" value="$MODULE_DIR$/../../build/classes/kotlin/main" />
|
|
||||||
<option name="classpath" value="$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.2.0/semver-1.2.0.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.21/4bcc2012b84840e19e1e28074284cac908be0295/kotlin-stdlib-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.21/f30e4a9897913e53d778f564110bafa1fef46643/kotlin-stdlib-common-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
|
|
||||||
<option name="noStdlib" value="true" />
|
|
||||||
<option name="noReflect" value="true" />
|
|
||||||
<option name="moduleName" value="examples-kotlin" />
|
|
||||||
<option name="addCompilerBuiltIns" value="true" />
|
|
||||||
<option name="loadBuiltInsFromDependencies" value="true" />
|
|
||||||
<option name="languageVersion" value="1.3" />
|
|
||||||
<option name="apiVersion" value="1.3" />
|
|
||||||
<option name="pluginOptions">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="pluginClasspaths">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="errors">
|
|
||||||
<ArgumentParseErrors />
|
|
||||||
</option>
|
|
||||||
</compilerArguments>
|
|
||||||
</configuration>
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/../../build/classes/java/main" />
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../../build/generated/source/kapt/main">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kapt/main" isTestSource="false" generated="true" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/main">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/main" isTestSource="false" generated="true" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../../src/main">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../src/main/kotlin" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library name="Gradle: kaptGeneratedClasses">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="file://$MODULE_DIR$/../../build/tmp/kapt3/classes/main" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.3.21" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.2.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,64 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.id="examples-kotlin:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
|
||||||
<configuration version="3" platform="JVM 1.6" useProjectSettings="false">
|
|
||||||
<compilerSettings />
|
|
||||||
<compilerArguments>
|
|
||||||
<option name="destination" value="$MODULE_DIR$/../../build/classes/kotlin/test" />
|
|
||||||
<option name="classpath" value="$MODULE_DIR$/../../build/classes/java/main;K:/java/semver/examples/kotlin/build/classes/kotlin/main;K:/java/semver/examples/kotlin/build/tmp/kapt3/classes/main;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.21/4bcc2012b84840e19e1e28074284cac908be0295/kotlin-stdlib-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.21/f30e4a9897913e53d778f564110bafa1fef46643/kotlin-stdlib-common-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
|
|
||||||
<option name="noStdlib" value="true" />
|
|
||||||
<option name="noReflect" value="true" />
|
|
||||||
<option name="moduleName" value="examples-kotlin" />
|
|
||||||
<option name="addCompilerBuiltIns" value="true" />
|
|
||||||
<option name="loadBuiltInsFromDependencies" value="true" />
|
|
||||||
<option name="friendPaths">
|
|
||||||
<array>
|
|
||||||
<option value="$MODULE_DIR$/../../build/tmp/kapt3/classes/main" />
|
|
||||||
<option value="$MODULE_DIR$/../../build/classes/java/main" />
|
|
||||||
<option value="$MODULE_DIR$/../../build/classes/kotlin/main" />
|
|
||||||
</array>
|
|
||||||
</option>
|
|
||||||
<option name="languageVersion" value="1.3" />
|
|
||||||
<option name="apiVersion" value="1.3" />
|
|
||||||
<option name="pluginOptions">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="pluginClasspaths">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="errors">
|
|
||||||
<ArgumentParseErrors />
|
|
||||||
</option>
|
|
||||||
</compilerArguments>
|
|
||||||
</configuration>
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output-test url="file://$MODULE_DIR$/../../build/classes/java/test" />
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../../build/generated/source/kapt/test">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kapt/test" isTestSource="true" generated="true" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/test">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/test" isTestSource="true" generated="true" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../../src/test" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module" module-name="examples-kotlin_main" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library name="Gradle: kaptGeneratedClasses">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="file://$MODULE_DIR$/../../build/tmp/kapt3/classes/test" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.3.21" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
|
|
||||||
</component>
|
|
||||||
<component name="TestModuleProperties" production-module="examples-kotlin_main" />
|
|
||||||
</module>
|
|
11
examples/kotlin/README.md
Normal file
11
examples/kotlin/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
To run the examples:
|
||||||
|
|
||||||
|
```console
|
||||||
|
./gradlew run
|
||||||
|
./gradlew runJava
|
||||||
|
./gradlew runExample
|
||||||
|
./gradlew runJavaExample
|
||||||
|
```
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("application")
|
id("application")
|
||||||
id("com.github.ben-manes.versions") version "0.48.0"
|
id("com.github.ben-manes.versions") version "0.51.0"
|
||||||
kotlin("jvm") version "1.9.10"
|
kotlin("jvm") version "2.1.20"
|
||||||
kotlin("kapt") version "1.9.10"
|
kotlin("kapt") version "1.9.25"
|
||||||
}
|
}
|
||||||
|
|
||||||
// ./gradlew
|
|
||||||
// ./gradlew run
|
|
||||||
// ./gradlew runJava
|
|
||||||
// ./gradlew runExample
|
|
||||||
// ./gradlew runJavaExample
|
|
||||||
|
|
||||||
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
|
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
|
||||||
|
|
||||||
val semverProcessor = "net.thauvin.erik:semver:1.2.1"
|
val semverProcessor = "net.thauvin.erik:semver:1.2.2-SNAPSHOT"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
kapt(semverProcessor)
|
kapt(semverProcessor)
|
||||||
|
@ -24,7 +20,7 @@ dependencies {
|
||||||
|
|
||||||
kapt {
|
kapt {
|
||||||
arguments {
|
arguments {
|
||||||
arg("semver.project.dir", projectDir)
|
arg("semver.project.dir", projectDir.absolutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +30,17 @@ repositories {
|
||||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget.set(JvmTarget.JVM_17)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass.set("com.example.App")
|
mainClass.set("com.example.App")
|
||||||
}
|
}
|
||||||
|
|
BIN
examples/kotlin/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
examples/kotlin/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
24
examples/kotlin/gradlew
vendored
24
examples/kotlin/gradlew
vendored
|
@ -15,6 +15,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
|
@ -55,7 +57,7 @@
|
||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
@ -84,7 +86,7 @@ done
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
@ -112,7 +114,7 @@ case "$( uname )" in #(
|
||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
|
@ -145,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
|
@ -153,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@ -202,16 +204,16 @@ fi
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|
26
examples/kotlin/gradlew.bat
vendored
26
examples/kotlin/gradlew.bat
vendored
|
@ -13,6 +13,8 @@
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'application'
|
id 'application'
|
||||||
id 'com.github.ben-manes.versions' version '0.46.0'
|
id 'com.github.ben-manes.versions' version '0.51.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
// ./gradlew run
|
// ./gradlew run
|
||||||
|
@ -9,12 +9,14 @@ plugins {
|
||||||
|
|
||||||
defaultTasks 'run'
|
defaultTasks 'run'
|
||||||
|
|
||||||
final def semverProcessor = 'net.thauvin.erik:semver:1.2.0'
|
final def semverProcessor = 'net.thauvin.erik:semver:1.2.2-SNAPSHOT'
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
mainClassName = 'com.example.Example'
|
application {
|
||||||
|
mainClass = 'com.example.Example'
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
17
examples/test/gradlew
vendored
17
examples/test/gradlew
vendored
|
@ -83,7 +83,8 @@ done
|
||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
|
@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@ -201,11 +202,11 @@ fi
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
|
20
examples/test/gradlew.bat
vendored
20
examples/test/gradlew.bat
vendored
|
@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
||||||
|
|
||||||
public final class ExampleVersion {
|
public final class ExampleVersion {
|
||||||
public static final String PROJECT = "Java Example";
|
public static final String PROJECT = "Java Example";
|
||||||
public static final Date BUILDDATE = new Date(1619673811155L);
|
public static final Date BUILDDATE = new Date(1707046879260L);
|
||||||
public static final String VERSION = "8.4.97-alpha+T800";
|
public static final String VERSION = "8.4.97-alpha+T800";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
bld.downloadExtensionJavadoc=false
|
bld.downloadExtensionJavadoc=false
|
||||||
bld.downloadExtensionSources=true
|
bld.downloadExtensionSources=true
|
||||||
bld.extension-exec=com.uwyn.rife2:bld-exec:0.9.0-SNAPSHOT
|
|
||||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.1-SNAPSHOT
|
|
||||||
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.3-SNAPSHOT
|
|
||||||
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
|
||||||
bld.downloadLocation=
|
bld.downloadLocation=
|
||||||
|
bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.5
|
||||||
|
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
|
||||||
|
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.2.3
|
||||||
|
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,MAVEN_LOCAL,RIFE2_SNAPSHOTS
|
||||||
bld.sourceDirectories=
|
bld.sourceDirectories=
|
||||||
bld.version=1.7.3-SNAPSHOT
|
bld.version=2.2.1
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -4,21 +4,21 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>net.thauvin.erik</groupId>
|
<groupId>net.thauvin.erik</groupId>
|
||||||
<artifactId>semver</artifactId>
|
<artifactId>semver</artifactId>
|
||||||
<version>1.2.1</version>
|
<version>1.2.2-SNAPSHOT</version>
|
||||||
<name>SemVer</name>
|
<name>SemVer</name>
|
||||||
<description>Semantic Version Annotation Processor</description>
|
<description>Semantic Version Annotation Processor</description>
|
||||||
<url>https://github.com/ethauvin/semver</url>
|
<url>https://github.com/ethauvin/semver</url>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>The BSD 3-Clause License</name>
|
<name>The BSD 3-Clause License</name>
|
||||||
<url>http://opensource.org/licenses/BSD-3-Clause</url>
|
<url>https://opensource.org/licenses/BSD-3-Clause</url>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.spullara.mustache.java</groupId>
|
<groupId>com.github.spullara.mustache.java</groupId>
|
||||||
<artifactId>compiler</artifactId>
|
<artifactId>compiler</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>0.9.14</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* SemverBuild.java
|
* SemverBuild.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -40,8 +40,7 @@ import rife.bld.extension.PmdOperation;
|
||||||
import rife.bld.publish.*;
|
import rife.bld.publish.*;
|
||||||
import rife.tools.exceptions.FileUtilsErrorException;
|
import rife.tools.exceptions.FileUtilsErrorException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.File;
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static rife.bld.dependencies.Repository.*;
|
import static rife.bld.dependencies.Repository.*;
|
||||||
|
@ -50,10 +49,15 @@ import static rife.bld.dependencies.Scope.test;
|
||||||
import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING;
|
import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING;
|
||||||
|
|
||||||
public class SemverBuild extends Project {
|
public class SemverBuild extends Project {
|
||||||
|
final PmdOperation pmdOp = new PmdOperation()
|
||||||
|
.fromProject(this)
|
||||||
|
.failOnViolation(true)
|
||||||
|
.ruleSets("config/pmd.xml");
|
||||||
|
|
||||||
public SemverBuild() {
|
public SemverBuild() {
|
||||||
pkg = "net.thauvin.erik";
|
pkg = "net.thauvin.erik";
|
||||||
name = "SemVer";
|
name = "SemVer";
|
||||||
version = version(1, 2, 1);
|
version = version(1, 2, 2, "SNAPSHOT");
|
||||||
|
|
||||||
var description = "Semantic Version Annotation Processor";
|
var description = "Semantic Version Annotation Processor";
|
||||||
var url = "https://github.com/ethauvin/semver";
|
var url = "https://github.com/ethauvin/semver";
|
||||||
|
@ -61,26 +65,27 @@ public class SemverBuild extends Project {
|
||||||
javaRelease = 17;
|
javaRelease = 17;
|
||||||
|
|
||||||
downloadSources = true;
|
downloadSources = true;
|
||||||
|
autoDownloadPurge = true;
|
||||||
|
|
||||||
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
|
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
|
||||||
|
|
||||||
scope(compile)
|
scope(compile)
|
||||||
.include(dependency("com.github.spullara.mustache.java", "compiler",
|
.include(dependency("com.github.spullara.mustache.java", "compiler", version(0, 9, 14)));
|
||||||
version(0, 9, 10)));
|
|
||||||
scope(test)
|
scope(test)
|
||||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0)))
|
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 2)))
|
||||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0)));
|
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 2)));
|
||||||
|
|
||||||
|
|
||||||
javadocOperation().javadocOptions()
|
javadocOperation().javadocOptions()
|
||||||
.tag("created.on", "a", "Created on:")
|
|
||||||
.windowTitle(name + ' ' + version.toString() + " API")
|
.windowTitle(name + ' ' + version.toString() + " API")
|
||||||
.docLint(NO_MISSING);
|
.docLint(NO_MISSING);
|
||||||
|
|
||||||
publishOperation()
|
publishOperation()
|
||||||
.repository(version.isSnapshot() ? repository(SONATYPE_SNAPSHOTS_LEGACY.location())
|
.repository(version.isSnapshot() ? repository(SONATYPE_SNAPSHOTS_LEGACY.location())
|
||||||
.withCredentials(property("sonatype.user"), property("sonatype.password"))
|
.withCredentials(property("sonatype.user"), property("sonatype.password"))
|
||||||
: repository("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
: repository(SONATYPE_RELEASES_LEGACY.location())
|
||||||
.withCredentials(property("sonatype.user"), property("sonatype.password")))
|
.withCredentials(property("sonatype.user"), property("sonatype.password")))
|
||||||
|
.repository(repository("github"))
|
||||||
.info(new PublishInfo()
|
.info(new PublishInfo()
|
||||||
.groupId(pkg)
|
.groupId(pkg)
|
||||||
.artifactId(name.toLowerCase())
|
.artifactId(name.toLowerCase())
|
||||||
|
@ -92,14 +97,17 @@ public class SemverBuild extends Project {
|
||||||
.id("ethauvin")
|
.id("ethauvin")
|
||||||
.name("Erik C. Thauvin")
|
.name("Erik C. Thauvin")
|
||||||
.email("erik@thauvin.net")
|
.email("erik@thauvin.net")
|
||||||
.url("https://erik.thauvin.net/"))
|
.url("https://erik.thauvin.net/")
|
||||||
|
)
|
||||||
.license(new PublishLicense()
|
.license(new PublishLicense()
|
||||||
.name("The BSD 3-Clause License")
|
.name("The BSD 3-Clause License")
|
||||||
.url("http://opensource.org/licenses/BSD-3-Clause"))
|
.url("https://opensource.org/licenses/BSD-3-Clause")
|
||||||
|
)
|
||||||
.scm(new PublishScm()
|
.scm(new PublishScm()
|
||||||
.connection("scm:git:" + url + ".git")
|
.connection("scm:git:" + url + ".git")
|
||||||
.developerConnection("scm:git:git@github.com:ethauvin/" + name.toLowerCase() + ".git")
|
.developerConnection("scm:git:git@github.com:ethauvin/" + name.toLowerCase() + ".git")
|
||||||
.url(url))
|
.url(url)
|
||||||
|
)
|
||||||
.signKey(property("sign.key"))
|
.signKey(property("sign.key"))
|
||||||
.signPassphrase(property("sign.passphrase")));
|
.signPassphrase(property("sign.passphrase")));
|
||||||
}
|
}
|
||||||
|
@ -109,7 +117,7 @@ public class SemverBuild extends Project {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BuildCommand(summary = "Generates JaCoCo Reports")
|
@BuildCommand(summary = "Generates JaCoCo Reports")
|
||||||
public void jacoco() throws IOException {
|
public void jacoco() throws Exception {
|
||||||
new JacocoReportOperation().fromProject(this).execute();
|
new JacocoReportOperation().fromProject(this).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,29 +138,30 @@ public class SemverBuild extends Project {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BuildCommand(summary = "Runs PMD analysis")
|
@BuildCommand(summary = "Runs PMD analysis")
|
||||||
public void pmd() {
|
public void pmd() throws Exception {
|
||||||
new PmdOperation()
|
pmdOp.execute();
|
||||||
.fromProject(this)
|
}
|
||||||
.failOnViolation(true)
|
|
||||||
.ruleSets("config/pmd.xml")
|
@BuildCommand(value = "pmd-cli", summary = "Runs PMD analysis (CLI)")
|
||||||
.execute();
|
public void pmdCli() throws Exception {
|
||||||
|
pmdOp.includeLineNumber(false).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
|
||||||
public void publish() throws Exception {
|
public void publish() throws Exception {
|
||||||
super.publish();
|
super.publish();
|
||||||
rootPom();
|
pomRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void publishLocal() throws Exception {
|
public void publishLocal() throws Exception {
|
||||||
super.publishLocal();
|
super.publishLocal();
|
||||||
rootPom();
|
pomRoot();
|
||||||
}
|
|
||||||
|
|
||||||
@BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
|
|
||||||
public void rootPom() throws FileUtilsErrorException {
|
|
||||||
PomBuilder.generateInto(publishOperation().info(), dependencies(),
|
|
||||||
Path.of(workDirectory.getPath(), "pom.xml").toFile());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Constants.java
|
* Constants.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -36,7 +36,7 @@ package net.thauvin.erik.semver;
|
||||||
* The <code>Constants</code> class holds the constant variables used throughout this project.
|
* The <code>Constants</code> class holds the constant variables used throughout this project.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2016-01-13
|
* @created 2016-01-13
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("PMD.DataClass")
|
@SuppressWarnings("PMD.DataClass")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Version.java
|
* Version.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -41,7 +41,7 @@ import java.lang.annotation.Target;
|
||||||
* The <code>Version</code> class implements the annotation interface.
|
* The <code>Version</code> class implements the annotation interface.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2016-01-13
|
* @created 2016-01-13
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("SameReturnValue")
|
@SuppressWarnings("SameReturnValue")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* VersionInfo.java
|
* VersionInfo.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -36,7 +36,7 @@ package net.thauvin.erik.semver;
|
||||||
* The <code>VersionInfo</code> class is used to hold and retrieve the semantic version values.
|
* The <code>VersionInfo</code> class is used to hold and retrieve the semantic version values.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2016-01-16
|
* @created 2016-01-16
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("PMD.DataClass")
|
@SuppressWarnings("PMD.DataClass")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* VersionProcessor.java
|
* VersionProcessor.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -55,7 +55,7 @@ import java.util.Set;
|
||||||
* The <code>VersionProcessor</code> class implements a semantic version annotation processor.
|
* The <code>VersionProcessor</code> class implements a semantic version annotation processor.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2016-01-13
|
* @created 2016-01-13
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"PMD.GuardLogStatement", "PMD.BeanMembersShouldSerialize"})
|
@SuppressWarnings({"PMD.GuardLogStatement", "PMD.BeanMembersShouldSerialize"})
|
||||||
|
@ -78,9 +78,20 @@ public class VersionProcessor extends AbstractProcessor {
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Mustache compileTemplate(final File dir, final String template) {
|
private Mustache compileTemplate(final File dir, final String template) throws IOException {
|
||||||
final var mf = new DefaultMustacheFactory(dir);
|
if (Constants.DEFAULT_JAVA_TEMPLATE.equals(template) || Constants.DEFAULT_KOTLIN_TEMPLATE.equals(template)) {
|
||||||
return mf.compile(template);
|
try (var in = getClass().getResourceAsStream("/" + template)) {
|
||||||
|
if (in != null) {
|
||||||
|
try (var reader = new BufferedReader(new InputStreamReader(in))) {
|
||||||
|
return new DefaultMustacheFactory().compile(reader, template);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new IOException("Resource not found: " + template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return new DefaultMustacheFactory(dir).compile(template);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void error(final String s) {
|
private void error(final String s) {
|
||||||
|
@ -237,7 +248,7 @@ public class VersionProcessor extends AbstractProcessor {
|
||||||
private void writeTemplate(final String type, final VersionInfo versionInfo, final String template)
|
private void writeTemplate(final String type, final VersionInfo versionInfo, final String template)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final var dir = getLocalFile("");
|
final var dir = getLocalFile("");
|
||||||
final var mustache = compileTemplate(dir, template);
|
final Mustache mustache = compileTemplate(dir, template);
|
||||||
|
|
||||||
final var templateName = switch (mustache.getName()) {
|
final var templateName = switch (mustache.getName()) {
|
||||||
case Constants.DEFAULT_JAVA_TEMPLATE -> "default (Java)";
|
case Constants.DEFAULT_JAVA_TEMPLATE -> "default (Java)";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ConstantsTest.java
|
* ConstantsTest.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* The <code>ConstantsTest</code> class.
|
* The <code>ConstantsTest</code> class.
|
||||||
*
|
*
|
||||||
* @author <a href="https://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2019-04-14
|
* @created 2019-04-14
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
class ConstantsTest {
|
class ConstantsTest {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* VersionInfoTest.java
|
* VersionInfoTest.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -43,7 +43,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* The <code>VersionInfoTest</code> class.
|
* The <code>VersionInfoTest</code> class.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:erik@thauvin.net">Erik C. Thauvin</a>
|
* @author <a href="mailto:erik@thauvin.net">Erik C. Thauvin</a>
|
||||||
* @created.on 2016-02-03
|
* @created 2016-02-03
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
class VersionInfoTest {
|
class VersionInfoTest {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* VersionProcessorTest.java
|
* VersionProcessorTest.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -48,13 +48,37 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* The <code>VersionProcessorTest</code> class.
|
* The <code>VersionProcessorTest</code> class.
|
||||||
*
|
*
|
||||||
* @author <a href="https://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2019-04-02
|
* @created 2019-04-02
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
*/
|
*/
|
||||||
class VersionProcessorTest {
|
class VersionProcessorTest {
|
||||||
private final VersionProcessor processor = new VersionProcessor();
|
private final VersionProcessor processor = new VersionProcessor();
|
||||||
private final VersionTest version = new VersionTest();
|
private final VersionTest version = new VersionTest();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares two strings by removing all line separators and whitespace.
|
||||||
|
*
|
||||||
|
* @param text1 The first text to compare
|
||||||
|
* @param text2 The second text to compare
|
||||||
|
* @return true if the texts are equivalent when line separators are ignored, false otherwise
|
||||||
|
*/
|
||||||
|
static boolean compareTextIgnoringLineSeparators(String text1, String text2) {
|
||||||
|
// Handle null cases
|
||||||
|
if (text1 == null && text2 == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (text1 == null || text2 == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove all line separators and whitespace
|
||||||
|
var cleanedText1 = text1.replaceAll("\\r?\\n|\\r|\\s", "");
|
||||||
|
var cleanedText2 = text2.replaceAll("\\r?\\n|\\r|\\s", "");
|
||||||
|
|
||||||
|
// Compare the cleaned strings
|
||||||
|
return cleanedText1.equals(cleanedText2);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
|
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
|
||||||
@Test
|
@Test
|
||||||
void testCompileTemplate()
|
void testCompileTemplate()
|
||||||
|
@ -69,45 +93,40 @@ class VersionProcessorTest {
|
||||||
|
|
||||||
try (var writer = new StringWriter()) {
|
try (var writer = new StringWriter()) {
|
||||||
mustache.execute(writer, version).flush();
|
mustache.execute(writer, version).flush();
|
||||||
assertEquals(String.format("""
|
assertTrue(compareTextIgnoringLineSeparators(
|
||||||
/*
|
String.format("/*" +
|
||||||
* 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!" +
|
||||||
*/
|
" */" +
|
||||||
|
"package %s;" +
|
||||||
package %s;
|
"import java.util.Date;" +
|
||||||
|
"/**" +
|
||||||
import java.util.Date;
|
" * Provides semantic version information." +
|
||||||
|
" *" +
|
||||||
/**
|
" * @author <a href=\"https://github.com/ethauvin/semver\">Semantic Version Annotation Processor</a>" +
|
||||||
* Provides semantic version information.
|
" */" +
|
||||||
*
|
"public final class %s {" +
|
||||||
* @author <a href="https://github.com/ethauvin/semver">Semantic Version Annotation Processor</a>
|
" public static final String PROJECT = \"%s\";" +
|
||||||
*/
|
" public static final Date BUILDDATE = new Date(L);" +
|
||||||
public final class MyTest {
|
" public static final int MAJOR = %d;" +
|
||||||
public static final String PROJECT = "%s";
|
" public static final int MINOR = %d;" +
|
||||||
public static final Date BUILDDATE = new Date(L);
|
" public static final int PATCH = %d;" +
|
||||||
public static final int MAJOR = %d;
|
" public static final String PRERELEASE = \"%s\";" +
|
||||||
public static final int MINOR = %d;
|
" public static final String PRERELEASE_PREFIX = \"%s\";" +
|
||||||
public static final int PATCH = %d;
|
" public static final String BUILDMETA = \"%s\";" +
|
||||||
public static final String PRERELEASE = "%s";
|
" public static final String BUILDMETA_PREFIX = \"%s\";" +
|
||||||
public static final String PRERELEASE_PREFIX = "%s";
|
" public static final String SEPARATOR = \"%s\";" +
|
||||||
public static final String BUILDMETA = "%s";
|
" public static final String VERSION = \"\";" +
|
||||||
public static final String BUILDMETA_PREFIX = "%s";
|
" /**" +
|
||||||
public static final String SEPARATOR = "%s";
|
" * Disables the default constructor." +
|
||||||
public static final String VERSION = "";
|
" */" +
|
||||||
|
" private %s() {" +
|
||||||
/**
|
" throw new UnsupportedOperationException(\"Illegal constructor call.\");" +
|
||||||
* Disables the default constructor.
|
" }" +
|
||||||
*/
|
"}", version.packageName(), version.className(), version.project(), version.major(),
|
||||||
private MyTest() {
|
version.minor(), version.patch(), version.preRelease(), version.preReleasePrefix(),
|
||||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
version.buildMeta(), version.buildMetaPrefix(), version.separator(), version.className()),
|
||||||
}
|
writer.toString()));
|
||||||
}
|
|
||||||
""", version.packageName(), version.project(), version.major(), version.minor(), version.patch(),
|
|
||||||
version.preRelease(), version.preReleasePrefix(), version.buildMeta(),
|
|
||||||
version.buildMetaPrefix(), version.separator()),
|
|
||||||
writer.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* VersionTest.java
|
* VersionTest.java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
|
* Copyright (c) 2016-2024, Erik C. Thauvin (erik@thauvin.net)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -38,10 +38,10 @@ import java.lang.annotation.Annotation;
|
||||||
* The <code>VersionTest</code> class.
|
* The <code>VersionTest</code> class.
|
||||||
*
|
*
|
||||||
* @author <a href="https://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
|
||||||
* @created.on 2019-04-02
|
* @created 2019-04-02
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"ClassExplicitlyAnnotation", "SameReturnValue", "java:S2187", "PMD.TestClassWithoutTestCases"})
|
@SuppressWarnings({"ClassExplicitlyAnnotation", "PMD.TestClassWithoutTestCases"})
|
||||||
class VersionTest implements Version {
|
class VersionTest implements Version {
|
||||||
String template = "myversion.mustache";
|
String template = "myversion.mustache";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue