Upaded default template.

This commit is contained in:
Erik C. Thauvin 2016-01-27 19:01:23 -08:00
parent 0d37a19c63
commit 703362c2b3
6 changed files with 103 additions and 103 deletions

View file

@ -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="kw">public</span> <span class="kw">class</span> A {
<span class="co">// ...</span></code></pre></div> <span class="co">// ...</span></code></pre></div>
<h3 id="default-template">Default Template</h3> <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%;"> <table style="width:101%;">
<colgroup> <colgroup>
<col style="width: 26%" /> <col style="width: 26%" />
@ -274,7 +274,7 @@ compileJava {
options.compilerArgs &lt;&lt; &#39;-proc:none&#39; options.compilerArgs &lt;&lt; &#39;-proc:none&#39;
}</code></pre> }</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>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> <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> <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 { <pre class="gradle"><code>dependencies {
@ -282,7 +282,7 @@ compileJava {
}</code></pre> }</code></pre>
<h3 id="auto-increment">Auto-Increment</h3> <h3 id="auto-increment">Auto-Increment</h3>
<p>Incrementing the version is best left to your favorite build system.</p> <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> <pre><code>gradle clean release run</code></pre>
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" /> <output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" /> <output-test url="file://$MODULE_DIR$/build/classes/test" />

View file

@ -305,7 +305,7 @@
</XML> </XML>
</value> </value>
</option> </option>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Erik's Code Style" /> <option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />

View file

@ -20,6 +20,16 @@ public final class ${className} {
private final static String prerelease = "${prerelease}"; private final static String prerelease = "${prerelease}";
private final static String project = "${project}"; private final static String project = "${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. * Returns the build date.
* *
@ -29,6 +39,15 @@ public final class ${className} {
return date; return date;
} }
/**
* Returns the project name.
*
* @return The project name, if any.
*/
public static String getProject() {
return project;
}
/** /**
* Returns the full version string. * Returns the full version string.
* <p> * <p>
@ -94,15 +113,6 @@ public final class ${className} {
return ""; return "";
} }
/**
* Returns the project name.
*
* @return The project name, if any.
*/
public static String getProject() {
return project;
}
/** /**
* Returns the build metadata. * Returns the build metadata.
* *
@ -115,14 +125,4 @@ public final class ${className} {
return ""; return "";
} }
/**
* Disables the default constructor.
*
* @throws UnsupportedOperationException if the constructor is called.
*/
private ${className}()
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
} }