Compare commits

...

2 commits

Author SHA1 Message Date
dc27cb86e5 Cleanup before new release 2023-09-29 16:18:50 -07:00
c5a6e2220c Updated all dependencies 2023-09-29 15:31:33 -07:00
21 changed files with 116 additions and 71 deletions

View file

@ -0,0 +1 @@
future-release=1.2.1

16
.idea/compiler.xml generated Normal file
View file

@ -0,0 +1,16 @@
<?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>

View file

@ -1,6 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright 2016=&amp;#36;today.year Erik C. Thauvin (erik@thauvin.net)&#10;All rights reserved.&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright (c) 2016-&amp;#36;today.year, Erik C. Thauvin (erik@thauvin.net)&#10;All rights reserved.&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="myName" value="BSD-3 Clause" />
</copyright>
</component>

7
.idea/copyright/profiles_settings.xml generated Normal file
View file

@ -0,0 +1,7 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="Source Code" copyright="BSD-3 Clause" />
</module2copyright>
</settings>
</component>

30
.idea/jarRepositories.xml generated Normal file
View 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>

6
.idea/kotlinc.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.10" />
</component>
</project>

8
.idea/misc.xml generated
View file

@ -6,10 +6,16 @@
<pattern value="net.thauvin.erik.semver.SemverBuild" method="pandoc" />
<pattern value="net.thauvin.erik.semver.SemverBuild" />
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="PDMPlugin">
<option name="customRuleSets">
<list>
<option value="$PROJECT_DIR$/../bld-exec/config/pmd.xml" />
</list>
</option>
<option name="skipTestSources" value="false" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build" />
</component>
</project>
</project>

1
.idea/modules.xml generated
View file

@ -4,6 +4,7 @@
<modules>
<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/modules/examples-java.main.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java.main.iml" />
</modules>
</component>
</project>

8
.idea/modules/examples-java.main.iml generated Normal file
View file

@ -0,0 +1,8 @@
<?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>

3
.idea/scopes/Source_Code.xml generated Normal file
View file

@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Source Code" pattern="*.java||file[bld]:*/||file[app]:src/main/java//*||file[app]:src/test/java//*" />
</component>

View file

@ -1,9 +1,13 @@
# Changelog
## [1.2.1](https://github.com/ethauvin/semver/tree/1.2.1) (2021-04-29)
## [1.2.1](https://github.com/ethauvin/semver/tree/1.2.1) (2023-09-29)
[Full Changelog](https://github.com/ethauvin/semver/compare/1.2.0...1.2.1)
**Implemented enhancements:**
- Move from Gradle to bld [\#7](https://github.com/ethauvin/semver/issues/7)
**Fixed bugs:**
- NPE with Java 12 and Kotlin 1.3.30 [\#1](https://github.com/ethauvin/semver/issues/1)

View file

@ -1,11 +1,11 @@
# Semantic Version Annotation Processor
# Semantic Version Annotation Processor
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/1.7.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![bld](https://img.shields.io/badge/1.7.2-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![release](https://img.shields.io/github/release/ethauvin/semver.svg)](https://github.com/ethauvin/semver/releases/latest)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.thauvin.erik/semver/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.thauvin.erik/semver)
[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/semver?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/semver.svg)](https://central.sonatype.com/artifact/net.thauvin.erik/semver)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_semver&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_semver)
[![GitHub CI](https://github.com/ethauvin/semver/actions/workflows/gradle.yml/badge.svg)](https://github.com/ethauvin/semver/actions/workflows/gradle.yml)
@ -17,6 +17,7 @@ An [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annota
This processor was inspired by Cédric Beust's [version-processor](https://github.com/cbeust/version-processor) and works well in conjunction with the [__Semantic Version Plugin for Gradle__](https://github.com/ethauvin/semver-gradle).
## Table of Contents
- [Examples](#examples)
- [Template](#template)
- [Default Template](#default-template)
@ -33,7 +34,7 @@ This processor was inspired by Cédric Beust's [version-processor](https://githu
## Examples
* Using annotation elements:
- Using annotation elements:
```java
import net.thauvin.erik.semver.Version;
@ -44,7 +45,7 @@ public class A {
}
```
* Or using a [properties](hhttps://github.com/ethauvin/semver/blob/master/examples/java/version.properties) file:
- Or using a [properties](hhttps://github.com/ethauvin/semver/blob/master/examples/java/version.properties) file:
```java
import net.thauvin.erik.semver.Version;
@ -220,8 +221,8 @@ public class ExampleBuild extends Project {
}
}
```
Please look at [ExamapleBuild](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.
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).
## Gradle
@ -239,7 +240,7 @@ dependencies {
compileOnly 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
}
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
}
```
@ -255,7 +256,7 @@ Please look at [build.gradle](https://github.com/ethauvin/semver/blob/master/exa
In order to also incorporate the generated source code into the `source tree`, add the following to [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle):
```gradle
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
}
```
@ -276,6 +277,7 @@ open class Main {
// ...
}
```
The [Kotlin default template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver-kt.mustache) implements the same static fields and functions as the [Java template](#default-template).
Please look at the [examples/kotlin](https://github.com/ethauvin/semver/tree/master/examples/kotlin) project for a [build.gradle.kts](https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts) sample.

View file

@ -1,7 +1,7 @@
plugins {
id 'java'
id 'application'
id 'com.github.ben-manes.versions' version '0.47.0'
id 'com.github.ben-manes.versions' version '0.48.0'
}
// ./gradlew run
@ -11,11 +11,6 @@ defaultTasks 'run'
final def semverProcessor = 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
sourceCompatibility = 17
targetCompatibility = 17
mainClassName = 'com.example.App'
repositories {
mavenLocal()
mavenCentral()
@ -27,12 +22,21 @@ dependencies {
implementation semverProcessor
}
tasks.withType(JavaCompile) {
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
application {
mainClassName = 'com.example.App'
}
tasks.withType(JavaCompile).configureEach {
options.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
options.compilerArgs += ["-Asemver.project.dir=$projectDir"]
}
task runExample(type: JavaExec) {
tasks.register("runExample", JavaExec) {
group = 'application'
classpath = sourceSets.main.runtimeClasspath
mainClass.set('com.example.Example')

View file

@ -9,7 +9,7 @@ import java.util.Date;
public final class ExampleVersion {
public static final String PROJECT = "Java Example";
public static final Date BUILDDATE = new Date(1692564205424L);
public static final Date BUILDDATE = new Date(1696019617021L);
public static final String VERSION = "8.4.97-alpha+T800";
/**

View file

@ -14,7 +14,7 @@ import java.util.Date;
*/
public final class GeneratedVersion {
public static final String PROJECT = "Java App";
public static final Date BUILDDATE = new Date(1692564205452L);
public static final Date BUILDDATE = new Date(1696019617081L);
public static final int MAJOR = 11;
public static final int MINOR = 11;
public static final int PATCH = 20;

View file

@ -1,8 +1,8 @@
plugins {
id("application")
id("com.github.ben-manes.versions") version "0.47.0"
kotlin("jvm") version "1.9.0"
kotlin("kapt") version "1.9.0"
id("com.github.ben-manes.versions") version "0.48.0"
kotlin("jvm") version "1.9.10"
kotlin("kapt") version "1.9.10"
}
// ./gradlew

View file

@ -1,10 +1,9 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.2
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.0
bld.extension-testng=com.uwyn.rife2:bld-testng:0.9.1-SNAPSHOT
bld.extension-exec=com.uwyn.rife2:bld-exec:0.9.0-SNAPSHOT
bld.repositories=MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
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.sourceDirectories=
bld.version=1.7.2

View file

@ -137,13 +137,11 @@ public final class Constants {
* The kotlin type.
*/
public static final String KOTLIN_TYPE = "kt";
/**
* The argument used to specify the project location.
*/
public static final String SEMVER_PROJECT_DIR_ARG = "semver.project.dir";
/**
* Disables the default constructor.
*/

View file

@ -1,33 +1 @@
#
# javax.annotation.processing.Processor
#
# Copyright (c) 2016-2023, Erik C. Thauvin (erik@thauvin.net)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of this project nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
net.thauvin.erik.semver.VersionProcessor

View file

@ -34,7 +34,7 @@ package net.thauvin.erik.semver;
import org.junit.jupiter.api.Test;
import java.util.Date; // NOPMD
import java.util.Date;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

View file

@ -1,8 +0,0 @@
#Generated by the Semver Plugin for Gradle
#Sun May 02 21:54:48 PDT 2021
version.buildmeta=
version.major=1
version.minor=2
version.patch=1
version.prerelease=SNAPSHOT
version.semver=1.2.1-SNAPSHOT