Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
9cbe98d479 | |||
fbede2207c | |||
a3e59d91cd | |||
7af5fe0893 | |||
615b4578a5 | |||
7596e735df | |||
b8a1d3e14f |
17 changed files with 493 additions and 22 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -4,8 +4,8 @@
|
||||||
**/.idea/tasks.xml
|
**/.idea/tasks.xml
|
||||||
**/.idea/workspace.xml
|
**/.idea/workspace.xml
|
||||||
*.iws
|
*.iws
|
||||||
.DS_Store
|
|
||||||
.classpath
|
.classpath
|
||||||
|
.DS_Store
|
||||||
.gradle
|
.gradle
|
||||||
.kobalt
|
.kobalt
|
||||||
.nb-gradle
|
.nb-gradle
|
||||||
|
@ -17,12 +17,13 @@
|
||||||
/dist
|
/dist
|
||||||
/gen
|
/gen
|
||||||
/gradle.properties
|
/gradle.properties
|
||||||
|
/lib
|
||||||
/local.properties
|
/local.properties
|
||||||
/out
|
/out
|
||||||
/proguard-project.txt
|
/proguard-project.txt
|
||||||
/project.properties
|
/project.properties
|
||||||
/target
|
/target
|
||||||
/test-output
|
/test-output
|
||||||
Thumbs.db
|
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
kobaltBuild
|
kobaltBuild
|
||||||
|
Thumbs.db
|
6
.idea/encodings.xml
generated
Normal file
6
.idea/encodings.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
53
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
53
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<option name="myLocal" value="true" />
|
||||||
|
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="INNER_CLASS_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="METHOD_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="FIELD_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="IGNORE_DEPRECATED" value="false" />
|
||||||
|
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||||
|
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||||
|
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||||
|
<option name="myAdditionalJavadocTags" value="created" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="REPORT_VARIABLES" value="true" />
|
||||||
|
<option name="REPORT_PARAMETERS" value="false" />
|
||||||
|
<option name="REPORT_CATCH_PARAMETERS" value="false" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
|
||||||
|
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
|
||||||
|
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
|
||||||
|
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
|
||||||
|
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
78
.idea/kobalt-test.iml
generated
Normal file
78
.idea/kobalt-test.iml
generated
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id="kobalt-test" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="KOBALT" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<output url="file://$MODULE_DIR$/kobaltBuild/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/kobaltBuild/test-classes" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/kobaltBuild" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="Kobalt: org.apache.velocity:velocity:jar:1.7">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/cache/org/apache/velocity/velocity/1.7/velocity-1.7.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="Kobalt: file://K:\java\semver\deploy\semver-0.9.7.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://K:/java/semver/deploy/semver-0.9.7.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library" scope="TEST">
|
||||||
|
<library name="Kobalt: org.testng:testng:jar:6.11">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/cache/org/testng/testng/6.11/testng-6.11.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="Kobalt: commons-collections:commons-collections:jar:3.2.1">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/cache/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="Kobalt: commons-lang:commons-lang:jar:2.4">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/cache/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library" scope="TEST">
|
||||||
|
<library name="Kobalt: com.beust:jcommander:jar:1.64">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/cache/com/beust/jcommander/1.64/jcommander-1.64.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library" scope="TEST">
|
||||||
|
<library name="Kobalt: org.yaml:snakeyaml:jar:1.17">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/cache/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
</component>
|
||||||
|
</module>
|
19
.idea/kobalt.xml
generated
Normal file
19
.idea/kobalt.xml
generated
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="KobaltSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<KobaltProjectSettings>
|
||||||
|
<option name="autoDownloadKobalt" value="true" />
|
||||||
|
<option name="downloadSources" value="false" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="kobaltHome" value="$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.59" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="profiles" value="" />
|
||||||
|
</KobaltProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
7
.idea/kotlinc.xml
generated
Normal file
7
.idea/kotlinc.xml
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="KotlinCommonCompilerArguments">
|
||||||
|
<option name="languageVersion" value="1.1" />
|
||||||
|
<option name="apiVersion" value="1.1" />
|
||||||
|
</component>
|
||||||
|
</project>
|
77
.idea/misc.xml
generated
Normal file
77
.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||||
|
<entry key="Project Default">
|
||||||
|
<profile-state>
|
||||||
|
<expanded-state>
|
||||||
|
<State>
|
||||||
|
<id />
|
||||||
|
</State>
|
||||||
|
<State>
|
||||||
|
<id>Java</id>
|
||||||
|
</State>
|
||||||
|
<State>
|
||||||
|
<id>Portability issuesJava</id>
|
||||||
|
</State>
|
||||||
|
</expanded-state>
|
||||||
|
<selected-state>
|
||||||
|
<State>
|
||||||
|
<id>Android</id>
|
||||||
|
</State>
|
||||||
|
</selected-state>
|
||||||
|
</profile-state>
|
||||||
|
</entry>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8.x" project-jdk-type="JavaSDK" />
|
||||||
|
<component name="masterDetails">
|
||||||
|
<states>
|
||||||
|
<state key="GlobalLibrariesConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>commons-logging-api</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="JdkListConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>1.8.x</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.19944212" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ProjectJDKs.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>1.8.x</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.19944212" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ProjectLibrariesConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
</states>
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/kobalt/Build.kt.iml" filepath="$PROJECT_DIR$/kobalt/Build.kt.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/kobalt-test.iml" filepath="$PROJECT_DIR$/.idea/kobalt-test.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
7
.idea/vcs.xml
generated
Normal file
7
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
24
kobalt/Build.kt.iml
Normal file
24
kobalt/Build.kt.iml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id="Build.kt" external.linked.project.path="$MODULE_DIR$/.." external.root.project.path="$MODULE_DIR$/.." external.system.id="KOBALT" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<output url="file://$MODULE_DIR$/out/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/out/test-classes" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="Kobalt: com.beust.kobalt:kobalt:jar:1.0.54">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.54/kobalt/wrapper/kobalt-1.0.54.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="library" name="KotlinJavaScript" level="project" />
|
||||||
|
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
|
@ -1,14 +1,20 @@
|
||||||
import com.beust.kobalt.*
|
import com.beust.kobalt.*
|
||||||
import com.beust.kobalt.plugin.packaging.*
|
import com.beust.kobalt.plugin.application.application
|
||||||
import com.beust.kobalt.plugin.publish.*
|
import com.beust.kobalt.plugin.apt.apt
|
||||||
import com.beust.kobalt.plugin.application.*
|
import com.beust.kobalt.plugin.packaging.assemble
|
||||||
import com.beust.kobalt.plugin.java.*
|
import com.beust.kobalt.plugin.packaging.install
|
||||||
|
import com.beust.kobalt.plugin.publish.autoGitTag
|
||||||
|
import com.beust.kobalt.plugin.publish.bintray
|
||||||
import org.apache.maven.model.*
|
import org.apache.maven.model.*
|
||||||
|
|
||||||
val bs = buildScript {
|
val bs = buildScript {
|
||||||
repos()
|
repos()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val processorJar = "net.thauvin.erik:semver:0.9.6-beta"
|
||||||
|
|
||||||
|
val mainClassName = "com.example.Main"
|
||||||
|
val lib = "lib"
|
||||||
|
|
||||||
val p = project {
|
val p = project {
|
||||||
|
|
||||||
|
@ -34,25 +40,26 @@ val p = project {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceDirectories {
|
|
||||||
path("src/main/java")
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceDirectoriesTest {
|
|
||||||
path("src/test/java")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// compile("com.beust:jcommander:1.48")
|
apt(processorJar)
|
||||||
|
compile("org.twitter4j:twitter4j-core:4.0.6")
|
||||||
|
compileOnly(processorJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
dependenciesTest {
|
dependenciesTest {
|
||||||
compile("org.testng:testng:6.10")
|
compile("org.testng:testng:6.11")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assemble {
|
assemble {
|
||||||
jar {
|
jar {
|
||||||
|
manifest {
|
||||||
|
attributes("Main-Class", mainClassName)
|
||||||
|
attributes("Class-Path",
|
||||||
|
collect(compileDependencies)
|
||||||
|
.map { it.file.name }
|
||||||
|
.joinToString(" ./$lib/", prefix = ". ./$lib/"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +67,22 @@ val p = project {
|
||||||
mainClass = "com.example.Main"
|
mainClass = "com.example.Main"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install {
|
||||||
|
target = "deploy"
|
||||||
|
include(from("kobaltBuild/libs"), to(target), glob("**/*"))
|
||||||
|
collect(compileDependencies).forEach {
|
||||||
|
copy(from(it.file.absolutePath), to("$target/$lib"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apt {
|
||||||
|
outputDir = "src/generated/java/"
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass = mainClassName
|
||||||
|
}
|
||||||
|
|
||||||
autoGitTag {
|
autoGitTag {
|
||||||
enabled = true
|
enabled = true
|
||||||
message = "Version $version"
|
message = "Version $version"
|
||||||
|
@ -69,4 +92,4 @@ val p = project {
|
||||||
bintray {
|
bintray {
|
||||||
publish = false
|
publish = false
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1 +1 @@
|
||||||
kobalt.version=1.0.18
|
kobalt.version=1.0.60
|
3
kobaltw
3
kobaltw
|
@ -1,3 +1,2 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
JAR=$(ls -1 -t /k/GitHub/kobalt/kobaltBuild/libs/*.jar | grep -v javadoc | grep -v sources | head -1)
|
java -jar "`dirname "$0"`/kobalt/wrapper/kobalt-wrapper.jar" $*
|
||||||
java -jar $JAR $*
|
|
||||||
|
|
4
kobaltw-test
Normal file
4
kobaltw-test
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
JAR=$(ls -1 -t /k/GitHub/kobalt/kobaltBuild/libs/*.jar | egrep -v "(sources|javadoc)" | head -1)
|
||||||
|
export KOBALT_JAR=$JAR
|
||||||
|
java -jar $JAR $*
|
4
kobaltw.bat
Normal file
4
kobaltw.bat
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
@echo off
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
java -jar "%DIRNAME%/kobalt/wrapper/kobalt-wrapper.jar" %*
|
157
src/generated/java/com/example/GeneratedVersion.java
Normal file
157
src/generated/java/com/example/GeneratedVersion.java
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
/*
|
||||||
|
* This file is automatically generated.
|
||||||
|
* Do not modify! -- ALL CHANGES WILL BE ERASED!
|
||||||
|
*/
|
||||||
|
package com.example;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides semantic version information.
|
||||||
|
*
|
||||||
|
* @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(1492033276280L);
|
||||||
|
private final static int major = 1;
|
||||||
|
private final static int minor = 0;
|
||||||
|
private final static int patch = 0;
|
||||||
|
private final static String prerelease = "beta";
|
||||||
|
private final static String project = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables the default constructor.
|
||||||
|
*
|
||||||
|
* @throws UnsupportedOperationException If the constructor is called.
|
||||||
|
*/
|
||||||
|
private GeneratedVersion()
|
||||||
|
throws UnsupportedOperationException {
|
||||||
|
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the build date.
|
||||||
|
*
|
||||||
|
* @return The build date.
|
||||||
|
*/
|
||||||
|
public static Date getBuildDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the project name.
|
||||||
|
*
|
||||||
|
* @return The project name, if any.
|
||||||
|
*/
|
||||||
|
public static String getProject() {
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the full version string.
|
||||||
|
* <p>
|
||||||
|
* Formatted as:
|
||||||
|
* <blockquote>
|
||||||
|
* <code>MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA]</code>
|
||||||
|
* </blockquote>
|
||||||
|
* <p>
|
||||||
|
* For example:
|
||||||
|
* <ul>
|
||||||
|
* <li><code>1.0.0</code></li>
|
||||||
|
* <li><code>1.0.0-beta</code></li>
|
||||||
|
* <li><code>1.0.0+20160124144700</code></li>
|
||||||
|
* <li><code>1.0.0-alpha+001</code></li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @return The version string.
|
||||||
|
*/
|
||||||
|
public static String getVersion() {
|
||||||
|
return Integer.toString(getMajor()) + '.'
|
||||||
|
+ Integer.toString(getMinor()) + '.'
|
||||||
|
+ Integer.toString(getPatch())
|
||||||
|
+ getPreRelease(true) + getBuildMetadata(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the major version.
|
||||||
|
*
|
||||||
|
* @return The major version.
|
||||||
|
*/
|
||||||
|
public static int getMajor() {
|
||||||
|
return major;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the minor version.
|
||||||
|
*
|
||||||
|
* @return The minor version.
|
||||||
|
*/
|
||||||
|
public static int getMinor() {
|
||||||
|
return minor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the patch version.
|
||||||
|
*
|
||||||
|
* @return The patch version.
|
||||||
|
*/
|
||||||
|
public static int getPatch() {
|
||||||
|
return patch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the pre-release version.
|
||||||
|
*
|
||||||
|
* @param isHyphen Prepend a hyphen, if <code>true</code>.
|
||||||
|
* @return The pre-release version, if any.
|
||||||
|
*/
|
||||||
|
public static String getPreRelease(final boolean isHyphen) {
|
||||||
|
if (prerelease.length() > 0) {
|
||||||
|
if (isHyphen) {
|
||||||
|
return '-' + prerelease;
|
||||||
|
} else {
|
||||||
|
return prerelease;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the pre-release version.
|
||||||
|
*
|
||||||
|
* @return The pre-release version, if any.
|
||||||
|
*/
|
||||||
|
public static String getPreRelease() {
|
||||||
|
return getPreRelease(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the build metadata.
|
||||||
|
*
|
||||||
|
* @param isPlus Prepend a plus sign, if <code>true</code>.
|
||||||
|
* @return The build metadata, if any.
|
||||||
|
*/
|
||||||
|
public static String getBuildMetadata(final boolean isPlus) {
|
||||||
|
if (buildmeta.length() > 0) {
|
||||||
|
if (isPlus) {
|
||||||
|
return '+' + buildmeta;
|
||||||
|
} else {
|
||||||
|
return buildmeta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the build metadata.
|
||||||
|
*
|
||||||
|
* @return The build metadata, if any.
|
||||||
|
*/
|
||||||
|
public static String getBuildMetadata() {
|
||||||
|
return getBuildMetadata(false);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,10 @@
|
||||||
package com.example;
|
package com.example;
|
||||||
|
|
||||||
|
import net.thauvin.erik.semver.Version;
|
||||||
|
|
||||||
|
@Version(major = 1, minor = 0, patch = 0, prerelease = "beta")
|
||||||
class Main {
|
class Main {
|
||||||
public static void main(String[] argv) {
|
public static void main(String[] argv) {
|
||||||
System.out.println("\n\nHello Java world from Kobalt\n\n");
|
System.out.println(GeneratedVersion.getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue