Cleaned up Javadocs

This commit is contained in:
Erik C. Thauvin 2023-11-27 14:34:07 -08:00
parent bbc0a92d23
commit 87bfac676d
10 changed files with 290 additions and 20 deletions

204
.idea/intellij-javadocs-4.0.1.xml generated Normal file
View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaDocConfiguration">
<GENERAL>
<MODE>UPDATE</MODE>
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
<LEVELS>
<LEVEL>METHOD</LEVEL>
<LEVEL>FIELD</LEVEL>
<LEVEL>TYPE</LEVEL>
</LEVELS>
<VISIBILITIES>
<VISIBILITY>PUBLIC</VISIBILITY>
<VISIBILITY>DEFAULT</VISIBILITY>
<VISIBILITY>PROTECTED</VISIBILITY>
</VISIBILITIES>
</GENERAL>
<TEMPLATES>
<CLASSES>
<CLASS>
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
<VALUE>/**\n
* The interface ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
<VALUE>/**\n
* The enum ${name}.\n
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
<VALUE>/**\n
* The type ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>.+</KEY>
<VALUE>/**\n
* The type ${name}.\n
*/</VALUE>
</CLASS>
</CLASSES>
<CONSTRUCTORS>
<CONSTRUCTOR>
<KEY>.+</KEY>
<VALUE>/**\n
* Instantiates a new ${name}.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</CONSTRUCTOR>
</CONSTRUCTORS>
<METHODS>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*&lt;.+&gt;)*)+\s+get\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Gets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*&lt;.+&gt;)*)+\s+set\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Sets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
<VALUE>/**\n
* The entry point of application.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
* @param ${element.parameterList.parameters[0].name} the input arguments\n
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>.+</KEY>
<VALUE>/**\n
* ${name}&lt;#if isNotVoid&gt; ${return}&lt;/#if&gt;.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${return}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
</METHODS>
<FIELDS>
<FIELD>
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
* The constant ${element.getName()}.\n
*/</VALUE>
</FIELD>
<FIELD>
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isInterface()&gt;
* The constant ${element.getName()}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt; */</VALUE>
</FIELD>
<FIELD>
<KEY>.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isEnum()&gt;
*${name} ${typeName}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt;*/</VALUE>
</FIELD>
</FIELDS>
</TEMPLATES>
</component>
</project>

View file

@ -6,6 +6,7 @@
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
@ -14,4 +15,4 @@
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library> </library>
</component> </component>

2
.idea/misc.xml generated
View file

@ -29,6 +29,7 @@
<pattern value="rife.bld.extension.JacocoReportOperation" method="writeReports" /> <pattern value="rife.bld.extension.JacocoReportOperation" method="writeReports" />
<pattern value="rife.bld.extension.JacocoReportOperationBuild" method="pmd" /> <pattern value="rife.bld.extension.JacocoReportOperationBuild" method="pmd" />
<pattern value="rife.bld.extension.JacocoReportOperation" method="destFile" /> <pattern value="rife.bld.extension.JacocoReportOperation" method="destFile" />
<pattern value="rife.bld.extension.JacocoReportOperation" method="isNotBlank" />
</component> </component>
<component name="PDMPlugin"> <component name="PDMPlugin">
<option name="customRuleSets"> <option name="customRuleSets">
@ -39,6 +40,7 @@
<option value="$PROJECT_DIR$/../bld-exec/config/pmd.xml" /> <option value="$PROJECT_DIR$/../bld-exec/config/pmd.xml" />
<option value="$PROJECT_DIR$/../bld-testng/config/pmd.xml" /> <option value="$PROJECT_DIR$/../bld-testng/config/pmd.xml" />
<option value="$PROJECT_DIR$/../bld-pitest/config/pmd.xml" /> <option value="$PROJECT_DIR$/../bld-pitest/config/pmd.xml" />
<option value="$PROJECT_DIR$/../bld-generated-version/config/pmd.xml" />
</list> </list>
</option> </option>
<option name="skipTestSources" value="false" /> <option name="skipTestSources" value="false" />

View file

@ -21,7 +21,7 @@ public void jacoco() throws IOException {
} }
``` ```
```text ```console
./bld compile jacoco ./bld compile jacoco
``` ```

View file

@ -6,6 +6,7 @@
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
@ -14,4 +15,4 @@
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library> </library>
</component> </component>

6
examples/README.md Normal file
View file

@ -0,0 +1,6 @@
# Compile and Generate JaCoCo Reports
```console
./bld compile jacoco
```

View file

@ -20,17 +20,18 @@ public class ExamplesBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
scope(test) scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0))); .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1)));
} }
public static void main(String[] args) { public static void main(String[] args) {
new ExamplesBuild().start(args); new ExamplesBuild().start(args);
} }
@BuildCommand(summary = "Generates Jacoco Reports") @BuildCommand(summary = "Generates Jacoco Reports")
public void jacoco() throws IOException { public void jacoco() throws IOException {
new JacocoReportOperation() new JacocoReportOperation()
.fromProject(this) .fromProject(this)
.execute(); .execute();
} }
} }

View file

@ -1,6 +1,6 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.3 bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.4
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation= bld.downloadLocation=
bld.version=1.7.5 bld.version=1.7.5

View file

@ -48,8 +48,8 @@ public class JacocoReportOperationBuild extends Project {
scope(runtime) scope(runtime)
.include(dependency("org.jacoco", "jacoco", jacocoVersion).exclude("*", "org.jacoco.doc")); .include(dependency("org.jacoco", "jacoco", jacocoVersion).exclude("*", "org.jacoco.doc"));
scope(test) scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1)))
.include(dependency("org.assertj", "assertj-core", version(3, 24, 2))); .include(dependency("org.assertj", "assertj-core", version(3, 24, 2)));
javadocOperation() javadocOperation()
@ -66,13 +66,23 @@ public class JacocoReportOperationBuild extends Project {
.artifactId("bld-jacoco-report") .artifactId("bld-jacoco-report")
.description("bld Extension to Generate JaCoCo Code Coverage Reports") .description("bld Extension to Generate JaCoCo Code Coverage Reports")
.url("https://github.com/rife2/bld-pmd") .url("https://github.com/rife2/bld-pmd")
.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/bld-pmd.git") .email("erik@thauvin.net")
.developerConnection("scm:git:git@github.com:rife2/bld-pmd.git") .url("https://erik.thauvin.net/")
.url("https://github.com/rife2/bld-pmd")) )
.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/bld-pmd.git")
.developerConnection("scm:git:git@github.com:rife2/bld-pmd.git")
.url("https://github.com/rife2/bld-pmd")
)
.signKey(property("sign.key")) .signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase")); .signPassphrase(property("sign.passphrase"));
} }

View file

@ -111,7 +111,10 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the locations of Java class files. * Sets the locations of Java class files.
**/ *
* @param classFiles the class files
* @return this operation instance
*/
public JacocoReportOperation classFiles(File... classFiles) { public JacocoReportOperation classFiles(File... classFiles) {
this.classFiles.addAll(List.of(classFiles)); this.classFiles.addAll(List.of(classFiles));
return this; return this;
@ -119,7 +122,10 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the locations of Java class files. * Sets the locations of Java class files.
**/ *
* @param classFiles the class files
* @return this operation instance
*/
public JacocoReportOperation classFiles(Collection<File> classFiles) { public JacocoReportOperation classFiles(Collection<File> classFiles) {
this.classFiles.addAll(classFiles); this.classFiles.addAll(classFiles);
return this; return this;
@ -127,6 +133,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the location of the CSV report. * Sets the location of the CSV report.
*
* @param cvs the report location
* @return this operation instance
*/ */
public JacocoReportOperation csv(File cvs) { public JacocoReportOperation csv(File cvs) {
this.csv = cvs; this.csv = cvs;
@ -135,6 +144,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the file to write execution data to. * Sets the file to write execution data to.
*
* @param destFile the file
* @return this operation instance
*/ */
public JacocoReportOperation destFile(File destFile) { public JacocoReportOperation destFile(File destFile) {
this.destFile = destFile; this.destFile = destFile;
@ -143,6 +155,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the source file encoding. The platform encoding is used by default. * Sets the source file encoding. The platform encoding is used by default.
*
* @param encoding the encoding
* @return this operation instance
*/ */
public JacocoReportOperation encoding(String encoding) { public JacocoReportOperation encoding(String encoding) {
this.encoding = encoding; this.encoding = encoding;
@ -151,6 +166,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the locations of the JaCoCo *.exec files to read. * Sets the locations of the JaCoCo *.exec files to read.
*
* @param execFiles the exec files
* @return this operation instance
*/ */
public JacocoReportOperation execFiles(File... execFiles) { public JacocoReportOperation execFiles(File... execFiles) {
this.execFiles.addAll(List.of(execFiles)); this.execFiles.addAll(List.of(execFiles));
@ -159,6 +177,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the locations of the JaCoCo *.exec files to read. * Sets the locations of the JaCoCo *.exec files to read.
*
* @param execFiles the exec files
* @return this operation instance
*/ */
public JacocoReportOperation execFiles(Collection<File> execFiles) { public JacocoReportOperation execFiles(Collection<File> execFiles) {
this.execFiles.addAll(execFiles); this.execFiles.addAll(execFiles);
@ -238,6 +259,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Configure the operation from a {@link BaseProject}. * Configure the operation from a {@link BaseProject}.
*
* @param project the project
* @return this operation instance
*/ */
public JacocoReportOperation fromProject(BaseProject project) { public JacocoReportOperation fromProject(BaseProject project) {
this.project = project; this.project = project;
@ -246,6 +270,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the location of the HTML report. * Sets the location of the HTML report.
*
* @param html the html
* @return this operation instance
*/ */
public JacocoReportOperation html(File html) { public JacocoReportOperation html(File html) {
this.html = html; this.html = html;
@ -270,6 +297,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the name used for the report. * Sets the name used for the report.
*
* @param name the name
* @return this operation instance
*/ */
public JacocoReportOperation name(String name) { public JacocoReportOperation name(String name) {
this.name = name; this.name = name;
@ -278,6 +308,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Suppresses all output. * Suppresses all output.
*
* @param quiet {@code true} or {@code false}
* @return this operation instance
*/ */
public JacocoReportOperation quiet(boolean quiet) { public JacocoReportOperation quiet(boolean quiet) {
this.quiet = quiet; this.quiet = quiet;
@ -307,7 +340,10 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the locations of the source files. (e.g., {@code src/main/java}) * Sets the locations of the source files. (e.g., {@code src/main/java})
**/ *
* @param sourceFiles the source files
* @return this operation instance
*/
public JacocoReportOperation sourceFiles(File... sourceFiles) { public JacocoReportOperation sourceFiles(File... sourceFiles) {
this.sourceFiles.addAll(List.of(sourceFiles)); this.sourceFiles.addAll(List.of(sourceFiles));
return this; return this;
@ -315,7 +351,10 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the locations of the source files. (e.g., {@code src/main/java}) * Sets the locations of the source files. (e.g., {@code src/main/java})
**/ *
* @param sourceFiles the source files
* @return this operation instance
*/
public JacocoReportOperation sourceFiles(Collection<File> sourceFiles) { public JacocoReportOperation sourceFiles(Collection<File> sourceFiles) {
this.sourceFiles.addAll(sourceFiles); this.sourceFiles.addAll(sourceFiles);
return this; return this;
@ -332,6 +371,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the tab stop width for the source pages. Default is {@code 4}. * Sets the tab stop width for the source pages. Default is {@code 4}.
*
* @param tabWidth the tab width
* @return this operation instance
*/ */
public JacocoReportOperation tabWidth(int tabWidth) { public JacocoReportOperation tabWidth(int tabWidth) {
this.tabWidth = tabWidth; this.tabWidth = tabWidth;
@ -358,6 +400,9 @@ public class JacocoReportOperation extends AbstractOperation<JacocoReportOperati
/** /**
* Sets the location of the XML report. * Sets the location of the XML report.
*
* @param xml the report location
* @return this operation instance
*/ */
public JacocoReportOperation xml(File xml) { public JacocoReportOperation xml(File xml) {
this.xml = xml; this.xml = xml;