Compare commits

..

4 commits

Author SHA1 Message Date
f8cceedc35
Minor cleanups 2024-10-27 17:23:38 -07:00
77b9ea0f61
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:23:09 -07:00
4fa6ec6306
Added GitHub repository 2024-10-27 17:22:32 -07:00
592a269ec8
Added soft assertions 2024-10-27 17:21:24 -07:00
8 changed files with 19 additions and 15 deletions

View file

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

@ -42,8 +42,8 @@ public class PropertyFileExampleBuild extends Project {
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES); repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
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

@ -1,6 +1,6 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
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

@ -45,8 +45,8 @@ public class PropertyFileBuild extends Project {
.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.jsoup", "jsoup", version(1, 18, 1))) .include(dependency("org.jsoup", "jsoup", version(1, 18, 1)))
.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-joda-time:2.2.0")); .include(dependency("org.assertj:assertj-joda-time:2.2.0"));
javadocOperation() javadocOperation()
@ -58,6 +58,7 @@ public class PropertyFileBuild 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-property-file") .artifactId("bld-property-file")

View file

@ -35,7 +35,7 @@ import java.util.logging.Logger;
* @since 1.0 * @since 1.0
*/ */
public class PropertyFileOperation extends AbstractOperation<PropertyFileOperation> { public class PropertyFileOperation extends AbstractOperation<PropertyFileOperation> {
private final static Logger LOGGER = Logger.getLogger(PropertyFileOperation.class.getName()); private static final Logger LOGGER = Logger.getLogger(PropertyFileOperation.class.getName());
private final List<EntryBase<?>> entries_ = new ArrayList<>(); private final List<EntryBase<?>> entries_ = new ArrayList<>();
private String comment_ = ""; private String comment_ = "";
private boolean failOnWarning_; private boolean failOnWarning_;

View file

@ -39,7 +39,7 @@ import java.util.logging.Logger;
* @since 1.0 * @since 1.0
*/ */
public final class PropertyFileUtils { public final class PropertyFileUtils {
private final static Logger LOGGER = Logger.getLogger(PropertyFileUtils.class.getName()); private static final Logger LOGGER = Logger.getLogger(PropertyFileUtils.class.getName());
private PropertyFileUtils() { private PropertyFileUtils() {
// no-op // no-op

View file

@ -16,6 +16,7 @@
package rife.bld.extension.propertyfile; package rife.bld.extension.propertyfile;
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;
@ -51,11 +52,13 @@ class PropertyFileOperationTest {
var p = new Properties(); var p = new Properties();
p.load(Files.newInputStream(tmpFile.toPath())); p.load(Files.newInputStream(tmpFile.toPath()));
assertThat(p.getProperty("version.major")).as("major").isEqualTo("1"); try (var softly = new AutoCloseableSoftAssertions()) {
assertThat(p.getProperty("version.minor")).as("minor").isEqualTo("0"); softly.assertThat(p.getProperty("version.major")).as("major").isEqualTo("1");
assertThat(p.getProperty("version.patch")).as("patch").isEqualTo("0"); softly.assertThat(p.getProperty("version.minor")).as("minor").isEqualTo("0");
assertThat(p.getProperty("build.date")).as("date") softly.assertThat(p.getProperty("version.patch")).as("patch").isEqualTo("0");
.isEqualTo(LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE)); softly.assertThat(p.getProperty("build.date")).as("date")
.isEqualTo(LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE));
}
new PropertyFileOperation() new PropertyFileOperation()
.fromProject(new Project()) .fromProject(new Project())