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
```

View file

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

View file

@ -36,7 +36,7 @@ public class GeneratedVersionOperationBuild extends Project {
public GeneratedVersionOperationBuild() {
pkg = "rife.bld.extension";
name = "GeneratedVersionOperation";
version = version(0, 9, 3);
version = version(0, 9, 4, "SNAPSHOT");
javaRelease = 17;
downloadSources = true;
@ -68,13 +68,24 @@ public class GeneratedVersionOperationBuild extends Project {
.artifactId("bld-generated-version")
.description("bld Extension to Generate Project Version Data")
.url("https://github.com/rife2/generated-version")
.developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").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")
.url("https://github.com/rife2/generated-version"))
.developer(
new PublishDeveloper()
.id("ethauvin")
.name("Erik C. Thauvin")
.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")
.url("https://github.com/rife2/generated-version")
)
.signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase"));
}

View file

@ -46,6 +46,8 @@ public class GeneratedVersion {
/**
* Returns the class name.
*
* @return the class name
*/
public String getClassName() {
return className;
@ -53,6 +55,8 @@ public class GeneratedVersion {
/**
* Returns the destination directory.
*
* @return the destination directory
*/
public File getDirectory() {
return directory;
@ -60,6 +64,8 @@ public class GeneratedVersion {
/**
* Returns the file extension.
*
* @return the file extension
*/
public String getExtension() {
return extension;
@ -67,6 +73,8 @@ public class GeneratedVersion {
/**
* Returns the package name.
*
* @return the package name
*/
public String getPackageName() {
return packageName;
@ -74,6 +82,8 @@ public class GeneratedVersion {
/**
* Returns the project.
*
* @return the project
*/
public BaseProject getProject() {
return project;
@ -81,6 +91,8 @@ public class GeneratedVersion {
/**
* Returns the project name.
*
* @return the project name
*/
public String getProjectName() {
return projectName;
@ -88,6 +100,8 @@ public class GeneratedVersion {
/**
* Returns the template.
*
* @return the template
*/
public File getTemplate() {
return template;
@ -95,6 +109,8 @@ public class GeneratedVersion {
/**
* Sets the class file.
*
* @param classFile the class file
*/
public void setClassFile(File classFile) {
this.classFile = classFile;
@ -102,6 +118,8 @@ public class GeneratedVersion {
/**
* Sets the class name.
*
* @param className the class name
*/
public void setClassName(String className) {
this.className = className;
@ -109,6 +127,8 @@ public class GeneratedVersion {
/**
* Set the destination directory.
*
* @param directory the destination directory
*/
public void setDirectory(File directory) {
this.directory = directory;
@ -116,6 +136,8 @@ public class GeneratedVersion {
/**
* Sets the file extension. (Default is: {@code .java})
*
* @param extension the file extension
*/
public void setExtension(String extension) {
this.extension = extension;
@ -123,6 +145,8 @@ public class GeneratedVersion {
/**
* Sets the package name.
*
* @param packageName the package name
*/
public void setPackageName(String packageName) {
this.packageName = packageName;
@ -130,6 +154,8 @@ public class GeneratedVersion {
/**
* Sets the project.
*
* @param project the project
*/
public void setProject(BaseProject project) {
this.project = project;
@ -137,6 +163,8 @@ public class GeneratedVersion {
/**
* Sets the project name.
*
* @param projectName the project name
*/
public void setProjectName(String projectName) {
this.projectName = projectName;
@ -144,6 +172,8 @@ public class GeneratedVersion {
/**
* Sets the template file.
*
* @param template the template
*/
public void setTemplate(File 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.
*
* @param gv the generated version
* @return the template
*/
public static Template buildTemplate(GeneratedVersion gv) {
Template template;
@ -114,6 +117,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* 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) {
if (gv.getPackageName() != null) {
@ -149,6 +155,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Sets the class name.
*
* @param className the class name
* @return this operation instance
*/
public GeneratedVersionOperation className(String className) {
generatedVersion.setClassName(className);
@ -157,6 +166,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Sets the class template path.
*
* @param template the template path
* @return this operation instance
*/
public GeneratedVersionOperation classTemplate(File template) {
generatedVersion.setTemplate(template);
@ -165,6 +177,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Sets the destination directory.
*
* @param directory the destination directory
* @return this operation instance
*/
public GeneratedVersionOperation directory(File directory) {
generatedVersion.setDirectory(directory);
@ -186,6 +201,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Sets the file extension. (Default is: {@code .java})
*
* @param extension the file extension
* @return this operation instance
*/
public GeneratedVersionOperation extension(String extension) {
generatedVersion.setExtension(extension);
@ -194,6 +212,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Configure the operation from a {@link BaseProject}.
*
* @param project the project
* @return this operation instance
*/
public GeneratedVersionOperation fromProject(BaseProject project) {
generatedVersion.setProject(project);
@ -203,6 +224,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Sets the package name.
*
* @param packageName the package name
* @return this operation instance
*/
public GeneratedVersionOperation packageName(String packageName) {
generatedVersion.setPackageName(packageName);
@ -211,6 +235,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
/**
* Sets the project name.
*
* @param projectName the project name
* @return this operation instance
*/
public GeneratedVersionOperation projectName(String projectName) {
generatedVersion.setProjectName(projectName);

View file

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