Compare commits

...

3 commits

Author SHA1 Message Date
b2a67a1262
Added soft assertions 2024-10-27 17:14:56 -07:00
10292cfec5
Updated dependencies
Bumped JUnit version to 5.11.3
Bumped PMD extension version to 1.1.7
Bumped JDK to version 23 (GitHub CI Workflow)
2024-10-27 17:14:25 -07:00
7bd786af1e
Added GitHub repository 2024-10-27 17:13:36 -07:00
6 changed files with 28 additions and 26 deletions

View file

@ -1,6 +1,6 @@
name: bld-ci name: bld-ci
on: [ push, pull_request, workflow_dispatch ] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
build-bld-project: build-bld-project:
@ -8,7 +8,7 @@ jobs:
strategy: strategy:
matrix: matrix:
java-version: [ 17, 21, 22 ] java-version: [17, 21, 23]
steps: steps:
- name: Checkout source repository - name: Checkout source repository

View file

@ -7,9 +7,9 @@
<!-- BEST PRACTICES --> <!-- BEST PRACTICES -->
<rule ref="category/java/bestpractices.xml"> <rule ref="category/java/bestpractices.xml">
<exclude name="AvoidPrintStackTrace"/> <exclude name="AvoidPrintStackTrace"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="GuardLogStatement"/> <exclude name="GuardLogStatement"/>
<exclude name="UnitTestContainsTooManyAsserts"/>
<exclude name="UnitTestShouldUseTestAnnotation"/>
</rule> </rule>
<rule ref="category/java/bestpractices.xml/MissingOverride"> <rule ref="category/java/bestpractices.xml/MissingOverride">

View file

@ -25,8 +25,8 @@ 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, 11, 0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 3)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0))); .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 3)));
} }
public static void main(String[] args) { public static void main(String[] args) {

View file

@ -2,6 +2,6 @@ bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.3 bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.3
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.5 bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.7
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.version=2.1.0 bld.version=2.1.0

View file

@ -40,6 +40,7 @@ public class JacocoReportOperationBuild extends Project {
downloadSources = true; downloadSources = true;
autoDownloadPurge = true; autoDownloadPurge = true;
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS);
var jacocoVersion = new VersionNumber(0, 8, 12); var jacocoVersion = new VersionNumber(0, 8, 12);
@ -47,8 +48,8 @@ public class JacocoReportOperationBuild extends Project {
.include(dependency("org.jacoco", "jacoco", jacocoVersion).exclude("*", "org.jacoco.doc")) .include(dependency("org.jacoco", "jacoco", jacocoVersion).exclude("*", "org.jacoco.doc"))
.include(dependency("com.uwyn.rife2", "bld", version(2, 1, 0))); .include(dependency("com.uwyn.rife2", "bld", version(2, 1, 0)));
scope(test) scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0))) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 3)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 3)))
.include(dependency("org.assertj", "assertj-core", version(3, 26, 3))); .include(dependency("org.assertj", "assertj-core", version(3, 26, 3)));
javadocOperation() javadocOperation()
@ -60,25 +61,23 @@ public class JacocoReportOperationBuild extends Project {
publishOperation() publishOperation()
.repository(version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2")) .repository(version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"))
.repository(repository("github"))
.info() .info()
.groupId("com.uwyn.rife2") .groupId("com.uwyn.rife2")
.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( .developer(new PublishDeveloper()
new PublishDeveloper()
.id("ethauvin") .id("ethauvin")
.name("Erik C. Thauvin") .name("Erik C. Thauvin")
.email("erik@thauvin.net") .email("erik@thauvin.net")
.url("https://erik.thauvin.net/") .url("https://erik.thauvin.net/")
) )
.license( .license(new PublishLicense()
new PublishLicense()
.name("The Apache License, Version 2.0") .name("The Apache License, Version 2.0")
.url("https://www.apache.org/licenses/LICENSE-2.0.txt") .url("https://www.apache.org/licenses/LICENSE-2.0.txt")
) )
.scm( .scm(new PublishScm().connection("scm:git:https://github.com/rife2/bld-pmd.git")
new PublishScm().connection("scm:git:https://github.com/rife2/bld-pmd.git")
.developerConnection("scm:git:git@github.com:rife2/bld-pmd.git") .developerConnection("scm:git:git@github.com:rife2/bld-pmd.git")
.url("https://github.com/rife2/bld-pmd") .url("https://github.com/rife2/bld-pmd")
) )

View file

@ -16,6 +16,7 @@
package rife.bld.extension; package rife.bld.extension;
import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import rife.bld.Project; import rife.bld.Project;
import rife.bld.operations.exceptions.ExitStatusException; import rife.bld.operations.exceptions.ExitStatusException;
@ -88,10 +89,12 @@ class JacocoReportOperationTest {
assertThat(csv).exists(); assertThat(csv).exists();
assertThat(html).isDirectory(); assertThat(html).isDirectory();
assertThat(xml).exists(); assertThat(xml).exists();
try (var softly = new AutoCloseableSoftAssertions()) {
try (var lines = Files.lines(xml.toPath())) { try (var lines = Files.lines(xml.toPath())) {
assertThat(lines.anyMatch(s -> softly.assertThat(lines.anyMatch(s ->
s.contains("<counter type=\"INSTRUCTION\" missed=\"0\" covered=\"3\"/>"))).isTrue(); s.contains("<counter type=\"INSTRUCTION\" missed=\"0\" covered=\"3\"/>"))).isTrue();
} }
}
assertThat(Path.of(html.getPath(), "com.example", "Examples.java.html")).exists(); assertThat(Path.of(html.getPath(), "com.example", "Examples.java.html")).exists();
} }