Added variables description in default template comments.
Fixed default constructor in template.
This commit is contained in:
parent
35ee113a04
commit
8d6d840efb
4 changed files with 23 additions and 8 deletions
|
@ -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 <a href="https://github.com/ethauvin/semver/tree/master/example">example</a> module directory for a sample.</p>
|
||||
<p>Please 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 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 {
|
||||
|
|
|
@ -7,13 +7,13 @@ package net.thauvin.erik.semver.example;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* This class provides semantic version information.
|
||||
* This <code>GeneratedVersion</code> class provides semantic version information.
|
||||
*
|
||||
* @author Semantic Version Annotation Processor
|
||||
*/
|
||||
public final class GeneratedVersion {
|
||||
private final static String buildmeta = "";
|
||||
private final static Date date = new Date(1453950493893L);
|
||||
private final static Date date = new Date(1454030788850L);
|
||||
private final static int major = 3;
|
||||
private final static int minor = 1;
|
||||
private final static int patch = 37;
|
||||
|
@ -23,7 +23,7 @@ public final class GeneratedVersion {
|
|||
/**
|
||||
* Disables the default constructor.
|
||||
*
|
||||
* @throws UnsupportedOperationException if the constructor is called.
|
||||
* @throws UnsupportedOperationException If the constructor is called.
|
||||
*/
|
||||
private GeneratedVersion()
|
||||
throws UnsupportedOperationException {
|
||||
|
|
|
@ -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.2-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.3-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" />
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
########################################################################################
|
||||
##
|
||||
## Available variables:
|
||||
##
|
||||
## $packageName - The package name. (string)
|
||||
## $className - The class name. (string)
|
||||
## $project - The project name. (string)
|
||||
## $epoch - The build epoch/unix time. (long)
|
||||
## $major - The major version. (int)
|
||||
## $minor - The minor version. (int)
|
||||
## $patch - The patch version. (int)
|
||||
## $prerelease - The pre-release version. (string)
|
||||
## $buildmeta - The build metadata version. (string)
|
||||
##
|
||||
########################################################################################
|
||||
/*
|
||||
* This file is automatically generated by the Semantic Version Annotation Processor.
|
||||
* Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
|
@ -7,7 +22,7 @@ package ${packageName};
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* This class provides semantic version information.
|
||||
* This <code>${className}</code> class provides semantic version information.
|
||||
*
|
||||
* @author Semantic Version Annotation Processor
|
||||
*/
|
||||
|
@ -23,9 +38,9 @@ public final class ${className} {
|
|||
/**
|
||||
* Disables the default constructor.
|
||||
*
|
||||
* @throws UnsupportedOperationException if the constructor is called.
|
||||
* @throws UnsupportedOperationException If the constructor is called.
|
||||
*/
|
||||
private GeneratedVersion()
|
||||
private ${className}()
|
||||
throws UnsupportedOperationException {
|
||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue