Added test.
This commit is contained in:
parent
f9dd17da1f
commit
ac2088aa54
10 changed files with 274 additions and 211 deletions
10
README.html
10
README.html
|
@ -244,13 +244,13 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
|||
<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><dependency></span>
|
||||
<span class="kw"><groupId></span>net.thauvin.erik<span class="kw"></groupId></span>
|
||||
<span class="kw"><artifactId></span>semver<span class="kw"></artifactId></span>
|
||||
<span class="kw"><version></span>0.9.4-beta<span class="kw"></version></span>
|
||||
<span class="kw"><version></span>0.9.5-beta<span class="kw"></version></span>
|
||||
<span class="kw"></dependency></span></code></pre></div>
|
||||
<h3 id="gradle">Gradle</h3>
|
||||
<h4 id="class-generation">Class Generation</h4>
|
||||
<p>To install and run from <a href="https://gradle.org/">Gradle</a>, add the following to the <code>build.gradle</code> file:</p>
|
||||
<pre class="gradle"><code>dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
compile 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
}</code></pre>
|
||||
<p>The <code>GeneratedVersion</code> class will be automatically created in the <code>build</code> directory upon compiling.</p>
|
||||
<h4 id="class-source-generation">Class & Source Generation</h4>
|
||||
|
@ -260,11 +260,11 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
|||
}</code></pre>
|
||||
<p>Then add the following to the <code>build.gradle</code> file:</p>
|
||||
<pre class="gradle"><code>dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
compile 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
}
|
||||
|
||||
annotationProcessor {
|
||||
library 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
library 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
// sourcesDir 'src/generated/java'
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ compileJava {
|
|||
<h3 id="kobalt">Kobalt</h3>
|
||||
<p>To install and run from <a href="http://beust.com/kobalt/">Kobalt</a>, add the following to the <code>Build.kt</code> file:</p>
|
||||
<pre class="gradle"><code>dependencies {
|
||||
apt("net.thauvin.erik:semver:0.9.4-beta")
|
||||
apt("net.thauvin.erik:semver:0.9.5-beta")
|
||||
}</code></pre>
|
||||
<h3 id="auto-increment">Auto-Increment</h3>
|
||||
<p>Incrementing the version is best left to your favorite build system.</p>
|
||||
|
|
10
README.md
10
README.md
|
@ -129,7 +129,7 @@ To install and run from [Maven](http://maven.apache.org/), configure an artifact
|
|||
<dependency>
|
||||
<groupId>net.thauvin.erik</groupId>
|
||||
<artifactId>semver</artifactId>
|
||||
<version>0.9.4-beta</version>
|
||||
<version>0.9.5-beta</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
@ -141,7 +141,7 @@ To install and run from [Gradle](https://gradle.org/), add the following to the
|
|||
|
||||
```gradle
|
||||
dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
compile 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -161,11 +161,11 @@ Then add the following to the `build.gradle` file:
|
|||
|
||||
```gradle
|
||||
dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
compile 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
}
|
||||
|
||||
annotationProcessor {
|
||||
library 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
library 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
// sourcesDir 'src/generated/java'
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ To install and run from [Kobalt](http://beust.com/kobalt/), add the following to
|
|||
|
||||
```gradle
|
||||
dependencies {
|
||||
apt("net.thauvin.erik:semver:0.9.4-beta")
|
||||
apt("net.thauvin.erik:semver:0.9.5-beta")
|
||||
}
|
||||
```
|
||||
|
||||
|
|
264
build.gradle
264
build.gradle
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id "com.jfrog.bintray" version "1.5"
|
||||
id "com.jfrog.bintray" version "1.5"
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
|
@ -11,26 +11,26 @@ import org.apache.tools.ant.taskdefs.condition.Os
|
|||
defaultTasks 'deploy'
|
||||
|
||||
def getVersion(isIncrement = false) {
|
||||
def propsFile = 'version.properties'
|
||||
def majorKey = 'version.major'
|
||||
def minorKey = 'version.minor'
|
||||
def patchKey = 'version.patch'
|
||||
def metaKey = 'version.buildmeta'
|
||||
def preKey = 'version.prerelease'
|
||||
if (isIncrement) {
|
||||
ant.propertyfile(file: propsFile) {
|
||||
entry(key: patchKey,
|
||||
type: 'int',
|
||||
default: '-1',
|
||||
operation: '+')
|
||||
}
|
||||
}
|
||||
def p = new Properties()
|
||||
file(propsFile).withInputStream { stream -> p.load(stream) }
|
||||
def metadata = p.getProperty(metaKey, '')
|
||||
def prerelease = p.getProperty(preKey, '')
|
||||
return (p.getProperty(majorKey, '1') + '.' + p.getProperty(minorKey, '0') + '.' + p.getProperty(patchKey, '0') +
|
||||
(prerelease.length() > 0 ? '-' + prerelease : '') + (metadata.length() > 0 ? '+' + metadata : ''))
|
||||
def propsFile = 'version.properties'
|
||||
def majorKey = 'version.major'
|
||||
def minorKey = 'version.minor'
|
||||
def patchKey = 'version.patch'
|
||||
def metaKey = 'version.buildmeta'
|
||||
def preKey = 'version.prerelease'
|
||||
if (isIncrement) {
|
||||
ant.propertyfile(file: propsFile) {
|
||||
entry(key: patchKey,
|
||||
type: 'int',
|
||||
default: '-1',
|
||||
operation: '+')
|
||||
}
|
||||
}
|
||||
def p = new Properties()
|
||||
file(propsFile).withInputStream { stream -> p.load(stream) }
|
||||
def metadata = p.getProperty(metaKey, '')
|
||||
def prerelease = p.getProperty(preKey, '')
|
||||
return (p.getProperty(majorKey, '1') + '.' + p.getProperty(minorKey, '0') + '.' + p.getProperty(patchKey, '0') +
|
||||
(prerelease.length() > 0 ? '-' + prerelease : '') + (metadata.length() > 0 ? '+' + metadata : ''))
|
||||
}
|
||||
|
||||
version = getVersion()
|
||||
|
@ -54,167 +54,163 @@ def pkgLabels = ['java', 'annotation', 'processor', 'semantic', 'version']
|
|||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'org.apache.velocity:velocity:1.7'
|
||||
testCompile 'org.testng:testng:6.9.10'
|
||||
compile 'org.apache.velocity:velocity:1.7'
|
||||
testCompile 'org.testng:testng:6.9.10'
|
||||
}
|
||||
|
||||
bintray {
|
||||
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
|
||||
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
|
||||
publications = ['MyPublication']
|
||||
dryRun = true
|
||||
pkg {
|
||||
repo = 'maven'
|
||||
name = mavenName
|
||||
licenses = pkgLicenses
|
||||
desc = mavenDescription
|
||||
websiteUrl = mavenUrl
|
||||
issueTrackerUrl = pkgIssueTrackerUrl
|
||||
vcsUrl = mavenScmCon
|
||||
labels = pkgLabels
|
||||
publicDownloadNumbers = true
|
||||
version {
|
||||
name = project.version
|
||||
desc = 'Version ' + project.version
|
||||
vcsTag = project.version
|
||||
gpg {
|
||||
sign = true
|
||||
}
|
||||
}
|
||||
}
|
||||
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
|
||||
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
|
||||
publications = ['MyPublication']
|
||||
dryRun = true
|
||||
pkg {
|
||||
repo = 'maven'
|
||||
name = mavenName
|
||||
licenses = pkgLicenses
|
||||
desc = mavenDescription
|
||||
websiteUrl = mavenUrl
|
||||
issueTrackerUrl = pkgIssueTrackerUrl
|
||||
vcsUrl = mavenScmCon
|
||||
labels = pkgLabels
|
||||
publicDownloadNumbers = true
|
||||
version {
|
||||
name = project.version
|
||||
desc = 'Version ' + project.version
|
||||
vcsTag = project.version
|
||||
gpg {
|
||||
sign = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def pomConfig = {
|
||||
licenses {
|
||||
license {
|
||||
name mavenLicense
|
||||
url mavenLicenseUrl
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id 'ethauvin'
|
||||
name 'Erik C. Thauvin'
|
||||
email 'erik@thauvin.net'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection 'scm:git:' + mavenScmCon
|
||||
developerConnection 'scm:git:' + mavenScmDevCon
|
||||
url mavenScmCon
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name mavenLicense
|
||||
url mavenLicenseUrl
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id 'ethauvin'
|
||||
name 'Erik C. Thauvin'
|
||||
email 'erik@thauvin.net'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection 'scm:git:' + mavenScmCon
|
||||
developerConnection 'scm:git:' + mavenScmDevCon
|
||||
url mavenScmCon
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
MyPublication(MavenPublication) {
|
||||
from components.java
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
groupId mavenGroupId
|
||||
artifactId rootProject.name
|
||||
version project.version
|
||||
publications {
|
||||
MyPublication(MavenPublication) {
|
||||
from components.java
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
groupId mavenGroupId
|
||||
artifactId rootProject.name
|
||||
version project.version
|
||||
|
||||
pom.withXml {
|
||||
def root = asNode()
|
||||
root.appendNode('name', mavenName)
|
||||
root.appendNode('description', mavenDescription)
|
||||
root.appendNode('url', mavenUrl)
|
||||
root.children().last() + pomConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
pom.withXml {
|
||||
def root = asNode()
|
||||
root.appendNode('name', mavenName)
|
||||
root.appendNode('description', mavenDescription)
|
||||
root.appendNode('url', mavenUrl)
|
||||
root.children().last() + pomConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the javadoc docs.'
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the javadoc docs.'
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the source code.'
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the source code.'
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
javadoc {
|
||||
title = mavenDescription + ' ' + version
|
||||
options.tags = ['created']
|
||||
options.author = true
|
||||
options.addStringOption('link', 'http://docs.oracle.com/javase/8/docs/api/')
|
||||
options.addStringOption('sourcepath', project.hasProperty('jdkSrc') ? jdkSrc : "$System.env.JAVA_HOME/src.zip")
|
||||
if (JavaVersion.current().isJava8Compatible())
|
||||
{
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
title = mavenDescription + ' ' + version
|
||||
options.tags = ['created']
|
||||
options.author = true
|
||||
options.addStringOption('link', 'http://docs.oracle.com/javase/8/docs/api/')
|
||||
options.addStringOption('sourcepath', project.hasProperty('jdkSrc') ? jdkSrc : "$System.env.JAVA_HOME/src.zip")
|
||||
if (JavaVersion.current().isJava8Compatible()) {
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useTestNG()
|
||||
useTestNG()
|
||||
}
|
||||
|
||||
compileJava {
|
||||
doFirst {
|
||||
project.version = getVersion(isRelease)
|
||||
}
|
||||
doFirst {
|
||||
project.version = getVersion(isRelease)
|
||||
}
|
||||
}
|
||||
|
||||
clean {
|
||||
delete deployDir
|
||||
delete deployDir
|
||||
}
|
||||
|
||||
task copyToDeploy(type: Copy) {
|
||||
from jar
|
||||
into deployDir
|
||||
from jar
|
||||
into deployDir
|
||||
}
|
||||
|
||||
task deploy(dependsOn: ['build', 'copyToDeploy']) {
|
||||
description = 'Copies all needed files to the ${deployDir} directory.'
|
||||
group = 'Publishing'
|
||||
outputs.dir deployDir
|
||||
inputs.files copyToDeploy
|
||||
mustRunAfter clean
|
||||
description = 'Copies all needed files to the ${deployDir} directory.'
|
||||
group = 'Publishing'
|
||||
outputs.dir deployDir
|
||||
inputs.files copyToDeploy
|
||||
mustRunAfter clean
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = gradle.gradleVersion
|
||||
gradleVersion = gradle.gradleVersion
|
||||
}
|
||||
|
||||
task release(dependsOn: ['deploy', 'wrapper']) << {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
}
|
||||
|
||||
task pandoc(type: Exec) {
|
||||
group = 'Documentation'
|
||||
def pandoc_args = ['--from', 'markdown_github', '--to', 'html5', '-s', '-o', 'README.html', 'README.md']
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS))
|
||||
{
|
||||
commandLine(['cmd', '/c', 'pandoc'] + pandoc_args)
|
||||
}
|
||||
else
|
||||
{
|
||||
executable '/usr/local/bin/pandoc'
|
||||
args pandoc_args
|
||||
}
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
ext.output = {
|
||||
return standardOutput.toString()
|
||||
}
|
||||
group = 'Documentation'
|
||||
def pandoc_args = ['--from', 'markdown_github', '--to', 'html5', '-s', '-o', 'README.html', 'README.md']
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
commandLine(['cmd', '/c', 'pandoc'] + pandoc_args)
|
||||
} else {
|
||||
executable '/usr/local/bin/pandoc'
|
||||
args pandoc_args
|
||||
}
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
ext.output = {
|
||||
return standardOutput.toString()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2"
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2"
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
|
@ -12,26 +12,26 @@ def deployDir = 'deploy'
|
|||
|
||||
// Get version from properties file. Increment patch if specified.
|
||||
def getVersion(isIncrement = false) {
|
||||
def propsFile = 'version.properties'
|
||||
def majorKey = 'version.major'
|
||||
def minorKey = 'version.minor'
|
||||
def patchKey = 'version.patch'
|
||||
def metaKey = 'version.buildmeta'
|
||||
def preKey = 'version.prerelease'
|
||||
if (isIncrement) {
|
||||
ant.propertyfile(file: propsFile) {
|
||||
entry(key: patchKey,
|
||||
type: 'int',
|
||||
default: '-1',
|
||||
operation: '+')
|
||||
}
|
||||
}
|
||||
def p = new Properties()
|
||||
file(propsFile).withInputStream { stream -> p.load(stream) }
|
||||
def metadata = p.getProperty(metaKey, '')
|
||||
def prerelease = p.getProperty(preKey, '')
|
||||
return (p.getProperty(majorKey, '1') + '.' + p.getProperty(minorKey, '0') + '.' + p.getProperty(patchKey, '0') +
|
||||
(prerelease.length() > 0 ? '-' + prerelease : '') + (metadata.length() > 0 ? '+' + metadata : ''))
|
||||
def propsFile = 'version.properties'
|
||||
def majorKey = 'version.major'
|
||||
def minorKey = 'version.minor'
|
||||
def patchKey = 'version.patch'
|
||||
def metaKey = 'version.buildmeta'
|
||||
def preKey = 'version.prerelease'
|
||||
if (isIncrement) {
|
||||
ant.propertyfile(file: propsFile) {
|
||||
entry(key: patchKey,
|
||||
type: 'int',
|
||||
default: '-1',
|
||||
operation: '+')
|
||||
}
|
||||
}
|
||||
def p = new Properties()
|
||||
file(propsFile).withInputStream { stream -> p.load(stream) }
|
||||
def metadata = p.getProperty(metaKey, '')
|
||||
def prerelease = p.getProperty(preKey, '')
|
||||
return (p.getProperty(majorKey, '1') + '.' + p.getProperty(minorKey, '0') + '.' + p.getProperty(patchKey, '0') +
|
||||
(prerelease.length() > 0 ? '-' + prerelease : '') + (metadata.length() > 0 ? '+' + metadata : ''))
|
||||
}
|
||||
|
||||
version = getVersion()
|
||||
|
@ -40,55 +40,55 @@ mainClassName = 'net.thauvin.erik.semver.example.Example'
|
|||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
compile 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
}
|
||||
|
||||
annotationProcessor {
|
||||
// Update version, increment on release.
|
||||
project.version = getVersion(isRelease)
|
||||
library 'net.thauvin.erik:semver:0.9.4-beta'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
// Update version, increment on release.
|
||||
project.version = getVersion(isRelease)
|
||||
library 'net.thauvin.erik:semver:0.9.5-beta'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
}
|
||||
|
||||
compileJava {
|
||||
options.compilerArgs << '-proc:none'
|
||||
options.compilerArgs << '-proc:none'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest.attributes('Main-Class': mainClassName)
|
||||
manifest.attributes('Main-Class': mainClassName)
|
||||
}
|
||||
|
||||
clean {
|
||||
delete deployDir
|
||||
delete deployDir
|
||||
}
|
||||
|
||||
|
||||
task copyToDeploy(type: Copy) {
|
||||
from jar
|
||||
into deployDir
|
||||
from jar
|
||||
into deployDir
|
||||
}
|
||||
|
||||
task deploy(dependsOn: ['build', 'copyToDeploy']) {
|
||||
description = 'Copies all needed files to the ${deployDir} directory.'
|
||||
group = 'Publishing'
|
||||
outputs.dir deployDir
|
||||
inputs.files copyToDeploy
|
||||
mustRunAfter clean
|
||||
description = 'Copies all needed files to the ${deployDir} directory.'
|
||||
group = 'Publishing'
|
||||
outputs.dir deployDir
|
||||
inputs.files copyToDeploy
|
||||
mustRunAfter clean
|
||||
}
|
||||
|
||||
|
||||
task release(dependsOn: ['deploy', 'wrapper']) << {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = gradle.gradleVersion
|
||||
gradleVersion = gradle.gradleVersion
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="example" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="3.1.37-beta" type="JAVA_MODULE" version="4">
|
||||
<module external.linked.project.id="example" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="3.1.38-beta" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/classes/main" />
|
||||
<output-test url="file://$MODULE_DIR$/build/classes/test" />
|
||||
|
@ -16,10 +16,6 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Gradle: org.apache.velocity:velocity:1.7" level="project" />
|
||||
<orderEntry type="library" name="Gradle: commons-collections:commons-collections:3.2.1" level="project" />
|
||||
<orderEntry type="library" name="Gradle: commons-lang:commons-lang:2.4" level="project" />
|
||||
<orderEntry type="library" name="Gradle: net.thauvin.erik:semver:0.9.4-beta" level="project" />
|
||||
</component>
|
||||
<component name="org.twodividedbyzero.idea.findbugs">
|
||||
<option name="_basePreferences">
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
/*
|
||||
* This file is automatically generated by the Semantic Version Annotation Processor.
|
||||
* Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
* This file is automatically generated.
|
||||
* Do not modify! -- ALL CHANGES WILL BE ERASED!
|
||||
*/
|
||||
package net.thauvin.erik.semver.example;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* This <code>GeneratedVersion</code> class provides semantic version information.
|
||||
* Provides semantic version information.
|
||||
*
|
||||
* @author Semantic Version Annotation Processor
|
||||
* @author <a href="https://github.com/ethauvin/semver">Semantic Version
|
||||
* Annotation Processor</a>
|
||||
*/
|
||||
public final class GeneratedVersion {
|
||||
private final static String buildmeta = "";
|
||||
private final static Date date = new Date(1454031375359L);
|
||||
private final static Date date = new Date(1454533811647L);
|
||||
private final static int major = 3;
|
||||
private final static int minor = 1;
|
||||
private final static int patch = 37;
|
||||
private final static int patch = 39;
|
||||
private final static String prerelease = "beta";
|
||||
private final static String project = "Example";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#Sat, 23 Jan 2016 18:16:26 -0800
|
||||
#Wed, 03 Feb 2016 13:10:11 -0800
|
||||
version.project=Example
|
||||
version.major=3
|
||||
version.minor=1
|
||||
version.patch=37
|
||||
version.patch=39
|
||||
version.buildmeta=
|
||||
version.prerelease=beta
|
||||
|
|
13
semver.ipr
13
semver.ipr
|
@ -72,7 +72,7 @@
|
|||
</LanguageOptions>
|
||||
</component>
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="Source" pattern="file[example]:src/main/java/*.java||file[semver]:src/main/java/*.java" />
|
||||
<scope name="Source" pattern="file[example]:src/main/java/*.java||file[semver]:src/main/java/*.java||file[semver]:src/test/java/*.java" />
|
||||
</component>
|
||||
<component name="Encoding">
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
|
@ -305,7 +305,7 @@
|
|||
</XML>
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Erik's Code Style" />
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
|
@ -357,15 +357,6 @@
|
|||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.4/2b8c4b3035e45520ef42033e823c7d33e4b4402c/commons-lang-2.4-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: net.thauvin.erik:semver:0.9.4-beta">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/0.9.4-beta/semver-0.9.4-beta.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/0.9.4-beta/semver-0.9.4-beta-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.apache.velocity:velocity:1.7">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.velocity/velocity/1.7/2ceb567b8f3f21118ecdec129fe1271dbc09aa7a/velocity-1.7.jar!/" />
|
||||
|
|
79
src/test/java/net/thauvin/erik/semver/VersionInfoTest.java
Normal file
79
src/test/java/net/thauvin/erik/semver/VersionInfoTest.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* VersionInfoTest.java
|
||||
*
|
||||
* Copyright (c) 2016, 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.
|
||||
*/
|
||||
package net.thauvin.erik.semver;
|
||||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* The <code>VersionInfoTest</code> class.
|
||||
*
|
||||
* @author <a href="mailto:erik@thauvin.net">Erik C. Thauvin</a>
|
||||
* @created 2016-02-03
|
||||
* @since 1.0
|
||||
*/
|
||||
public class VersionInfoTest
|
||||
{
|
||||
@Test
|
||||
public void testGetVersion()
|
||||
throws Exception
|
||||
{
|
||||
|
||||
final VersionInfo version = new VersionInfo();
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "1.0.0");
|
||||
|
||||
version.setMajor(3);
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "3.0.0");
|
||||
|
||||
version.setMinor(2);
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "3.2.0");
|
||||
|
||||
version.setPatch(1);
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "3.2.1");
|
||||
|
||||
version.setPreRelease("beta");
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "3.2.1-beta");
|
||||
|
||||
version.setBuildMetadata("001");
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "3.2.1-beta+001");
|
||||
|
||||
version.setPreRelease("");
|
||||
|
||||
Assert.assertEquals(version.getVersion(), "3.2.1+001");
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#Thu, 28 Jan 2016 17:33:17 -0800
|
||||
version.major=0
|
||||
version.minor=9
|
||||
version.patch=4
|
||||
version.patch=5
|
||||
version.buildmeta=
|
||||
version.prerelease=beta
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue