Cleaned up Javadocs

This commit is contained in:
Erik C. Thauvin 2023-11-27 11:52:48 -08:00
parent 1090f06fdf
commit 6a1dc286da
6 changed files with 80 additions and 11 deletions

View file

@ -26,7 +26,7 @@ public void genver() throws Exception {
} }
``` ```
```text ```console
./bld compile ./bld compile
``` ```

View file

@ -1,5 +1,5 @@
# Compile and Run Example # Compile and Run Example
```plain ```console
./bld compile run ./bld compile run
``` ```

View file

@ -36,7 +36,7 @@ public class GeneratedVersionOperationBuild extends Project {
public GeneratedVersionOperationBuild() { public GeneratedVersionOperationBuild() {
pkg = "rife.bld.extension"; pkg = "rife.bld.extension";
name = "GeneratedVersionOperation"; name = "GeneratedVersionOperation";
version = version(0, 9, 3); version = version(0, 9, 4, "SNAPSHOT");
javaRelease = 17; javaRelease = 17;
downloadSources = true; downloadSources = true;
@ -68,13 +68,24 @@ public class GeneratedVersionOperationBuild extends Project {
.artifactId("bld-generated-version") .artifactId("bld-generated-version")
.description("bld Extension to Generate Project Version Data") .description("bld Extension to Generate Project Version Data")
.url("https://github.com/rife2/generated-version") .url("https://github.com/rife2/generated-version")
.developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").email("erik@thauvin.net") .developer(
.url("https://erik.thauvin.net/")) new PublishDeveloper()
.license(new PublishLicense().name("The Apache License, Version 2.0") .id("ethauvin")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt")) .name("Erik C. Thauvin")
.scm(new PublishScm().connection("scm:git:https://github.com/rife2/generated-version.git") .email("erik@thauvin.net")
.url("https://erik.thauvin.net/")
)
.license(
new PublishLicense()
.name("The Apache License, Version 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt")
)
.scm(
new PublishScm()
.connection("scm:git:https://github.com/rife2/generated-version.git")
.developerConnection("scm:git:git@github.com:rife2/generated-version.git") .developerConnection("scm:git:git@github.com:rife2/generated-version.git")
.url("https://github.com/rife2/generated-version")) .url("https://github.com/rife2/generated-version")
)
.signKey(property("sign.key")) .signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase")); .signPassphrase(property("sign.passphrase"));
} }

View file

@ -46,6 +46,8 @@ public class GeneratedVersion {
/** /**
* Returns the class name. * Returns the class name.
*
* @return the class name
*/ */
public String getClassName() { public String getClassName() {
return className; return className;
@ -53,6 +55,8 @@ public class GeneratedVersion {
/** /**
* Returns the destination directory. * Returns the destination directory.
*
* @return the destination directory
*/ */
public File getDirectory() { public File getDirectory() {
return directory; return directory;
@ -60,6 +64,8 @@ public class GeneratedVersion {
/** /**
* Returns the file extension. * Returns the file extension.
*
* @return the file extension
*/ */
public String getExtension() { public String getExtension() {
return extension; return extension;
@ -67,6 +73,8 @@ public class GeneratedVersion {
/** /**
* Returns the package name. * Returns the package name.
*
* @return the package name
*/ */
public String getPackageName() { public String getPackageName() {
return packageName; return packageName;
@ -74,6 +82,8 @@ public class GeneratedVersion {
/** /**
* Returns the project. * Returns the project.
*
* @return the project
*/ */
public BaseProject getProject() { public BaseProject getProject() {
return project; return project;
@ -81,6 +91,8 @@ public class GeneratedVersion {
/** /**
* Returns the project name. * Returns the project name.
*
* @return the project name
*/ */
public String getProjectName() { public String getProjectName() {
return projectName; return projectName;
@ -88,6 +100,8 @@ public class GeneratedVersion {
/** /**
* Returns the template. * Returns the template.
*
* @return the template
*/ */
public File getTemplate() { public File getTemplate() {
return template; return template;
@ -95,6 +109,8 @@ public class GeneratedVersion {
/** /**
* Sets the class file. * Sets the class file.
*
* @param classFile the class file
*/ */
public void setClassFile(File classFile) { public void setClassFile(File classFile) {
this.classFile = classFile; this.classFile = classFile;
@ -102,6 +118,8 @@ public class GeneratedVersion {
/** /**
* Sets the class name. * Sets the class name.
*
* @param className the class name
*/ */
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
@ -109,6 +127,8 @@ public class GeneratedVersion {
/** /**
* Set the destination directory. * Set the destination directory.
*
* @param directory the destination directory
*/ */
public void setDirectory(File directory) { public void setDirectory(File directory) {
this.directory = directory; this.directory = directory;
@ -116,6 +136,8 @@ public class GeneratedVersion {
/** /**
* Sets the file extension. (Default is: {@code .java}) * Sets the file extension. (Default is: {@code .java})
*
* @param extension the file extension
*/ */
public void setExtension(String extension) { public void setExtension(String extension) {
this.extension = extension; this.extension = extension;
@ -123,6 +145,8 @@ public class GeneratedVersion {
/** /**
* Sets the package name. * Sets the package name.
*
* @param packageName the package name
*/ */
public void setPackageName(String packageName) { public void setPackageName(String packageName) {
this.packageName = packageName; this.packageName = packageName;
@ -130,6 +154,8 @@ public class GeneratedVersion {
/** /**
* Sets the project. * Sets the project.
*
* @param project the project
*/ */
public void setProject(BaseProject project) { public void setProject(BaseProject project) {
this.project = project; this.project = project;
@ -137,6 +163,8 @@ public class GeneratedVersion {
/** /**
* Sets the project name. * Sets the project name.
*
* @param projectName the project name
*/ */
public void setProjectName(String projectName) { public void setProjectName(String projectName) {
this.projectName = projectName; this.projectName = projectName;
@ -144,6 +172,8 @@ public class GeneratedVersion {
/** /**
* Sets the template file. * Sets the template file.
*
* @param template the template
*/ */
public void setTemplate(File template) { public void setTemplate(File template) {
this.template = template; this.template = template;

View file

@ -53,6 +53,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Builds the template based on the {@link GeneratedVersion} data. * Builds the template based on the {@link GeneratedVersion} data.
*
* @param gv the generated version
* @return the template
*/ */
public static Template buildTemplate(GeneratedVersion gv) { public static Template buildTemplate(GeneratedVersion gv) {
Template template; Template template;
@ -114,6 +117,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Writes the project version class in the given directory. * Writes the project version class in the given directory.
*
* @param template the template
* @param gv the generated version
*/ */
public static void writeTemplate(Template template, GeneratedVersion gv) { public static void writeTemplate(Template template, GeneratedVersion gv) {
if (gv.getPackageName() != null) { if (gv.getPackageName() != null) {
@ -149,6 +155,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Sets the class name. * Sets the class name.
*
* @param className the class name
* @return this operation instance
*/ */
public GeneratedVersionOperation className(String className) { public GeneratedVersionOperation className(String className) {
generatedVersion.setClassName(className); generatedVersion.setClassName(className);
@ -157,6 +166,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Sets the class template path. * Sets the class template path.
*
* @param template the template path
* @return this operation instance
*/ */
public GeneratedVersionOperation classTemplate(File template) { public GeneratedVersionOperation classTemplate(File template) {
generatedVersion.setTemplate(template); generatedVersion.setTemplate(template);
@ -165,6 +177,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Sets the destination directory. * Sets the destination directory.
*
* @param directory the destination directory
* @return this operation instance
*/ */
public GeneratedVersionOperation directory(File directory) { public GeneratedVersionOperation directory(File directory) {
generatedVersion.setDirectory(directory); generatedVersion.setDirectory(directory);
@ -186,6 +201,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Sets the file extension. (Default is: {@code .java}) * Sets the file extension. (Default is: {@code .java})
*
* @param extension the file extension
* @return this operation instance
*/ */
public GeneratedVersionOperation extension(String extension) { public GeneratedVersionOperation extension(String extension) {
generatedVersion.setExtension(extension); generatedVersion.setExtension(extension);
@ -194,6 +212,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Configure the operation from a {@link BaseProject}. * Configure the operation from a {@link BaseProject}.
*
* @param project the project
* @return this operation instance
*/ */
public GeneratedVersionOperation fromProject(BaseProject project) { public GeneratedVersionOperation fromProject(BaseProject project) {
generatedVersion.setProject(project); generatedVersion.setProject(project);
@ -203,6 +224,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Sets the package name. * Sets the package name.
*
* @param packageName the package name
* @return this operation instance
*/ */
public GeneratedVersionOperation packageName(String packageName) { public GeneratedVersionOperation packageName(String packageName) {
generatedVersion.setPackageName(packageName); generatedVersion.setPackageName(packageName);
@ -211,6 +235,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/** /**
* Sets the project name. * Sets the project name.
*
* @param projectName the project name
* @return this operation instance
*/ */
public GeneratedVersionOperation projectName(String projectName) { public GeneratedVersionOperation projectName(String projectName) {
generatedVersion.setProjectName(projectName); generatedVersion.setProjectName(projectName);

View file

@ -112,7 +112,8 @@ class GeneratedVersionTest {
@Test @Test
void testWriteTemplate() throws IOException { void testWriteTemplate() throws IOException {
var tmpDir = Files.createTempDirectory("bldGeneratedVersion").toFile(); var tmpDir = Files.createTempDirectory("bld-generated-version-").toFile();
tmpDir.deleteOnExit();
var gv = new GeneratedVersion(); var gv = new GeneratedVersion();
gv.setProject(PROJECT); gv.setProject(PROJECT);