Javadocs cleanup
This commit is contained in:
parent
31584513b0
commit
3e7250b7bb
4 changed files with 69 additions and 28 deletions
|
@ -42,8 +42,7 @@ public class GeneratedVersionOperationBuild extends Project {
|
|||
.link("https://javadoc.io/doc/net.sourceforge.pmd/pmd-core/latest/");
|
||||
|
||||
publishOperation()
|
||||
.repositories(MAVEN_LOCAL,
|
||||
version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"))
|
||||
.repositories(MAVEN_LOCAL, version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"))
|
||||
.info()
|
||||
.groupId("com.uwyn.rife2")
|
||||
.artifactId("bld-generated-version")
|
||||
|
|
|
@ -28,57 +28,93 @@ import java.io.File;
|
|||
*/
|
||||
@SuppressWarnings("PMD.DataClass")
|
||||
public class GeneratedVersion {
|
||||
private String className;
|
||||
private File classFile;
|
||||
private String className;
|
||||
private String packageName;
|
||||
private BaseProject project;
|
||||
private String projectName;
|
||||
private File template;
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class file.
|
||||
*/
|
||||
public File getClassFile() {
|
||||
return classFile;
|
||||
}
|
||||
|
||||
public void setClassFile(File classFile) {
|
||||
this.classFile = classFile;
|
||||
/**
|
||||
* Returns the class name.
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the package name.
|
||||
*/
|
||||
public String getPackageName() {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project.
|
||||
*/
|
||||
public BaseProject getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
public void setProject(BaseProject project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project name.
|
||||
*/
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the template.
|
||||
*/
|
||||
public File getTemplate() {
|
||||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class file.
|
||||
*/
|
||||
public void setClassFile(File classFile) {
|
||||
this.classFile = classFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class name.
|
||||
*/
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the package name.
|
||||
*/
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the project.
|
||||
*/
|
||||
public void setProject(BaseProject project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the project name.
|
||||
*/
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the template file.
|
||||
*/
|
||||
public void setTemplate(File template) {
|
||||
this.template = template;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.logging.Level;
|
|||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Implements the GeneratedVersionOperation class.
|
||||
* Generates a project version data class.
|
||||
*
|
||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||
* @since 1.0
|
||||
|
@ -112,6 +112,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
|
|||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the project version class in the given directory.
|
||||
*/
|
||||
public static void writeTemplate(Template template, File directory, GeneratedVersion gv) {
|
||||
if (gv.getPackageName() != null) {
|
||||
gv.setClassFile(Path.of(directory.getAbsolutePath(),
|
||||
|
@ -151,13 +154,16 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the class template path
|
||||
* Sets the class template path.
|
||||
*/
|
||||
public GeneratedVersionOperation classTemplate(File template) {
|
||||
generatedVersion.setTemplate(template);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a version data class for this project.
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
if (generatedVersion.getProject() == null && LOGGER.isLoggable(Level.SEVERE)) {
|
||||
|
|
|
@ -65,7 +65,7 @@ class GeneratedVersionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
void buildTemplateCustomTest() {
|
||||
void testBuildCustomTemplate() {
|
||||
var gv = new GeneratedVersion();
|
||||
gv.setProject(PROJECT);
|
||||
gv.setTemplate(new File(gv.getProject().srcTestResourcesDirectory().getAbsolutePath(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue