Upaded default template.
This commit is contained in:
parent
0d37a19c63
commit
703362c2b3
6 changed files with 103 additions and 103 deletions
|
@ -76,7 +76,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
|||
<span class="kw">public</span> <span class="kw">class</span> A {
|
||||
<span class="co">// ...</span></code></pre></div>
|
||||
<h3 id="default-template">Default Template</h3>
|
||||
<p>The default template implements the following static methods:</p>
|
||||
<p>The <a href="https://github.com/ethauvin/semver/blob/master/src/main/resources/version.vm">default template</a> implements the following static methods:</p>
|
||||
<table style="width:101%;">
|
||||
<colgroup>
|
||||
<col style="width: 26%" />
|
||||
|
@ -274,7 +274,7 @@ compileJava {
|
|||
options.compilerArgs << '-proc:none'
|
||||
}</code></pre>
|
||||
<p>The plugin implements a separate compile task that only runs the annotation processor and is executed during the build phase.</p>
|
||||
<p>Please look at the <code>build.gradle</code> file in the <code>example</code> module directory for a sample.</p>
|
||||
<p>Please look at the <code>build.gradle</code> file in the <a href="https://github.com/ethauvin/semver/tree/master/example">example</a> module directory for a sample.</p>
|
||||
<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 {
|
||||
|
@ -282,7 +282,7 @@ compileJava {
|
|||
}</code></pre>
|
||||
<h3 id="auto-increment">Auto-Increment</h3>
|
||||
<p>Incrementing the version is best left to your favorite build system.</p>
|
||||
<p>For a solution using <a href="https://gradle.org/">Gradle</a>, please have a look at the <code>build.gradle</code> file in the <code>example</code> module directory. To run the example with patch version auto-incrementing, issue the following command:</p>
|
||||
<p>For a solution using <a href="https://gradle.org/">Gradle</a>, please have a look at the <a href="https://github.com/ethauvin/semver/blob/master/example/build.gradle">build.gradle</a> file in the <a href="https://github.com/ethauvin/semver/tree/master/example">example</a> module directory. To run the example with patch version auto-incrementing, issue the following command:</p>
|
||||
<pre><code>gradle clean release run</code></pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="semver" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.9.1-beta" type="JAVA_MODULE" version="4">
|
||||
<module external.linked.project.id="semver" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.9.2-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" />
|
||||
|
|
|
@ -305,7 +305,7 @@
|
|||
</XML>
|
||||
</value>
|
||||
</option>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Erik's Code Style" />
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
|
|
|
@ -20,109 +20,109 @@ public final class ${className} {
|
|||
private final static String prerelease = "${prerelease}";
|
||||
private final static String project = "${project}";
|
||||
|
||||
/**
|
||||
* Returns the build date.
|
||||
*
|
||||
* @return The build date.
|
||||
*/
|
||||
public static Date getBuildDate() {
|
||||
return date;
|
||||
}
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
*
|
||||
* @throws UnsupportedOperationException if the constructor is called.
|
||||
*/
|
||||
private GeneratedVersion()
|
||||
throws UnsupportedOperationException {
|
||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() + getBuildMetadata();
|
||||
}
|
||||
/**
|
||||
* Returns the build date.
|
||||
*
|
||||
* @return The build date.
|
||||
*/
|
||||
public static Date getBuildDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the major version.
|
||||
*
|
||||
* @return The major version.
|
||||
*/
|
||||
public static int getMajor() {
|
||||
return major;
|
||||
}
|
||||
/**
|
||||
* Returns the project name.
|
||||
*
|
||||
* @return The project name, if any.
|
||||
*/
|
||||
public static String getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minor version.
|
||||
*
|
||||
* @return The minor version.
|
||||
*/
|
||||
public static int getMinor() {
|
||||
return minor;
|
||||
}
|
||||
/**
|
||||
* 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() + getBuildMetadata();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the patch version.
|
||||
*
|
||||
* @return The patch version.
|
||||
*/
|
||||
public static int getPatch() {
|
||||
return patch;
|
||||
}
|
||||
/**
|
||||
* Returns the major version.
|
||||
*
|
||||
* @return The major version.
|
||||
*/
|
||||
public static int getMajor() {
|
||||
return major;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the pre-release version.
|
||||
*
|
||||
* @return The pre-release version, if any.
|
||||
*/
|
||||
public static String getPreRelease() {
|
||||
if (prerelease.length() > 0) {
|
||||
return '-' + prerelease;
|
||||
}
|
||||
/**
|
||||
* Returns the minor version.
|
||||
*
|
||||
* @return The minor version.
|
||||
*/
|
||||
public static int getMinor() {
|
||||
return minor;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
/**
|
||||
* Returns the patch version.
|
||||
*
|
||||
* @return The patch version.
|
||||
*/
|
||||
public static int getPatch() {
|
||||
return patch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project name.
|
||||
*
|
||||
* @return The project name, if any.
|
||||
*/
|
||||
public static String getProject() {
|
||||
return project;
|
||||
}
|
||||
/**
|
||||
* Returns the pre-release version.
|
||||
*
|
||||
* @return The pre-release version, if any.
|
||||
*/
|
||||
public static String getPreRelease() {
|
||||
if (prerelease.length() > 0) {
|
||||
return '-' + prerelease;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the build metadata.
|
||||
*
|
||||
* @return The build metadata, if any.
|
||||
*/
|
||||
public static String getBuildMetadata() {
|
||||
if (buildmeta.length() > 0) {
|
||||
return '+' + buildmeta;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
/**
|
||||
* Returns the build metadata.
|
||||
*
|
||||
* @return The build metadata, if any.
|
||||
*/
|
||||
public static String getBuildMetadata() {
|
||||
if (buildmeta.length() > 0) {
|
||||
return '+' + buildmeta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
*
|
||||
* @throws UnsupportedOperationException if the constructor is called.
|
||||
*/
|
||||
private ${className}()
|
||||
throws UnsupportedOperationException {
|
||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue