diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 21cca4a..bf65051 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -1,16 +1,14 @@ name: bld-ci -on: [ push, pull_request, workflow_dispatch ] +on: [push, pull_request, workflow_dispatch] jobs: build-bld-project: + runs-on: ubuntu-latest + strategy: matrix: - java-version: [ 17, 21, 24 ] - kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ] - os: [ ubuntu-latest, windows-latest, macos-latest ] - - runs-on: ${{ matrix.os }} + java-version: [17, 21, 22] steps: - name: Checkout source repository @@ -24,28 +22,8 @@ jobs: distribution: "zulu" java-version: ${{ matrix.java-version }} - - name: Download dependencies [examples] - working-directory: examples - run: ./bld download - - - name: Compile run [examples] - working-directory: examples - run: ./bld compile run - - - name: Update version properties and run [examples] - working-directory: examples - run: | - ./bld update-major run - ./bld update-minor run - ./bld update-patch run - ./bld update-release run - - - name: Delete version properties and run [examples] - working-directory: examples - run: ./bld delete-version run - - name: Download dependencies run: ./bld download - name: Run tests - run: ./bld compile test \ No newline at end of file + run: ./bld compile test diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 508f6a5..bf43624 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -47,11 +47,11 @@ jobs: uses: actions/configure-pages@v3 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v1 with: # Upload generated Javadocs repository path: "build/javadoc/" - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v1 diff --git a/.idea/copyright/Apache_License.xml b/.idea/copyright/Apache_License.xml index 4446c15..ade80da 100644 --- a/.idea/copyright/Apache_License.xml +++ b/.idea/copyright/Apache_License.xml @@ -1,6 +1,6 @@ - - \ No newline at end of file + diff --git a/.idea/icon.svg b/.idea/icon.svg deleted file mode 100644 index 81220b4..0000000 --- a/.idea/icon.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index 153a060..4dd96bf 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml index 99cc0c0..9bd86aa 100644 --- a/.idea/libraries/compile.xml +++ b/.idea/libraries/compile.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml index 56ddbf1..81feb0b 100644 --- a/.idea/libraries/runtime.xml +++ b/.idea/libraries/runtime.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml index f72f7a3..13b6513 100644 --- a/.idea/libraries/test.xml +++ b/.idea/libraries/test.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index ba429d0..5b2667b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-2.2.1.jar", + "${HOME}/.bld/dist/bld-2.0.1.jar", "lib/**/*.jar" ] } diff --git a/README.md b/README.md index b7ae443..d599633 100755 --- a/README.md +++ b/README.md @@ -2,22 +2,14 @@ [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) -[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) +[![bld](https://img.shields.io/badge/2.0.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/releases/com/uwyn/rife2/bld-property-file/maven-metadata.xml?color=blue)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-property-file) [![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-property-file/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-property-file) [![GitHub CI](https://github.com/rife2/bld-property-file/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-property-file/actions/workflows/bld.yml) -To install the latest version, add the following to the `lib/bld/bld-wrapper.properties` file: +To install, please refer to the [extensions documentation](https://github.com/rife2/bld/wiki/Extensions). -```properties -bld.extension-property-file=com.uwyn.rife2:bld-property-file -``` - -For more information, please refer to the [extensions](https://github.com/rife2/bld/wiki/Extensions) documentation. - -## Create or Modify Property Files - -To create or modify [property files](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) with [bld](https://rife2.com/bld), add the follwing to your build file: +To create or modifying [property files](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) with [bld](https://rife2.com/bld), add the follwing to your build file: ```java @BuildCommand diff --git a/config/pmd.xml b/config/pmd.xml index 2641880..3d3203c 100644 --- a/config/pmd.xml +++ b/config/pmd.xml @@ -7,9 +7,9 @@ + + - - diff --git a/examples/.idea/libraries/bld.xml b/examples/.idea/libraries/bld.xml index b1bce61..c56c376 100644 --- a/examples/.idea/libraries/bld.xml +++ b/examples/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/examples/.idea/libraries/compile.xml b/examples/.idea/libraries/compile.xml index 99cc0c0..9bd86aa 100644 --- a/examples/.idea/libraries/compile.xml +++ b/examples/.idea/libraries/compile.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/examples/.idea/libraries/runtime.xml b/examples/.idea/libraries/runtime.xml index 56ddbf1..81feb0b 100644 --- a/examples/.idea/libraries/runtime.xml +++ b/examples/.idea/libraries/runtime.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/examples/.idea/libraries/test.xml b/examples/.idea/libraries/test.xml index f72f7a3..13b6513 100644 --- a/examples/.idea/libraries/test.xml +++ b/examples/.idea/libraries/test.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/examples/.vscode/settings.json b/examples/.vscode/settings.json index ba429d0..5b2667b 100644 --- a/examples/.vscode/settings.json +++ b/examples/.vscode/settings.json @@ -9,7 +9,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-2.2.1.jar", + "${HOME}/.bld/dist/bld-2.0.1.jar", "lib/**/*.jar" ] } diff --git a/examples/lib/bld/bld-wrapper.jar b/examples/lib/bld/bld-wrapper.jar index 2e6f0b2..9633e67 100644 Binary files a/examples/lib/bld/bld-wrapper.jar and b/examples/lib/bld/bld-wrapper.jar differ diff --git a/examples/lib/bld/bld-wrapper.properties b/examples/lib/bld/bld-wrapper.properties index 804e68c..1b2f976 100644 --- a/examples/lib/bld/bld-wrapper.properties +++ b/examples/lib/bld/bld-wrapper.properties @@ -1,6 +1,6 @@ #Sun Apr 02 10:32:44 PDT 2023 bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension=com.uwyn.rife2:bld-property-file:0.9.9 +bld.extension=com.uwyn.rife2:bld-property-file:0.9.6 bld.repositories=MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES -bld.version=2.2.1 +bld.version=2.0.1 diff --git a/examples/src/bld/java/com/example/PropertyFileExampleBuild.java b/examples/src/bld/java/com/example/PropertyFileExampleBuild.java index 8f9a29c..7cc4319 100644 --- a/examples/src/bld/java/com/example/PropertyFileExampleBuild.java +++ b/examples/src/bld/java/com/example/PropertyFileExampleBuild.java @@ -42,8 +42,8 @@ public class PropertyFileExampleBuild extends Project { repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1))); + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3))); } public static void main(String[] args) { diff --git a/examples/version.properties b/examples/version.properties index 2d06736..8a1539b 100644 --- a/examples/version.properties +++ b/examples/version.properties @@ -1,7 +1,7 @@ # -#Mon Jan 13 22:23:02 PST 2025 -build.date=2025-01-13 -release=beta.20250113222132 -version.major=3 +#Sun Jul 28 22:07:37 PDT 2024 +build.date=2024-07-28 +release=beta.20240728220737 +version.major=1 version.minor=1 version.patch=20 diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index b067ce9..d055d00 100644 Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 42fad1d..e783f23 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,6 +1,6 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.2.2 +bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.4 bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES -bld.version=2.2.1 +bld.version=2.0.1 diff --git a/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java b/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java index fbfd1e7..a0b3afb 100644 --- a/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java +++ b/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class PropertyFileBuild extends Project { public PropertyFileBuild() { pkg = "rife.bld.extension"; name = "bld-property-file"; - version = version(0, 9, 9); + version = version(0, 9, 6); javaRelease = 17; downloadSources = true; @@ -42,11 +42,11 @@ public class PropertyFileBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS); scope(compile) - .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))); + .include(dependency("com.uwyn.rife2", "bld", version(2, 0, 1))); scope(test) - .include(dependency("org.jsoup", "jsoup", version(1, 19, 1))) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1))) + .include(dependency("org.jsoup", "jsoup", version(1, 18, 1))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3))) .include(dependency("org.assertj:assertj-joda-time:2.2.0")); javadocOperation() @@ -58,7 +58,6 @@ public class PropertyFileBuild extends Project { publishOperation() .repository(version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2")) - .repository(repository("github")) .info() .groupId("com.uwyn.rife2") .artifactId("bld-property-file") diff --git a/src/main/java/rife/bld/extension/propertyfile/Calc.java b/src/main/java/rife/bld/extension/propertyfile/Calc.java index 4c3f8bf..3f17e67 100644 --- a/src/main/java/rife/bld/extension/propertyfile/Calc.java +++ b/src/main/java/rife/bld/extension/propertyfile/Calc.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/rife/bld/extension/propertyfile/Entry.java b/src/main/java/rife/bld/extension/propertyfile/Entry.java index 3cdf925..9e8009a 100644 --- a/src/main/java/rife/bld/extension/propertyfile/Entry.java +++ b/src/main/java/rife/bld/extension/propertyfile/Entry.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryBase.java b/src/main/java/rife/bld/extension/propertyfile/EntryBase.java index ff9f05e..ca193b1 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryBase.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryDate.java b/src/main/java/rife/bld/extension/propertyfile/EntryDate.java index 8990119..0a93745 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryDate.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryDate.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,16 +48,6 @@ public class EntryDate extends EntryBase { return this; } - /** - * Sets the {@link java.time.format.DateTimeFormatter DateTimeFormatter} pattern. - * - * @param pattern the pattern - */ - public EntryDate pattern(String pattern) { - super.pattern(pattern); - return this; - } - /** * Sets the new {@link java.util.Properties property} value to an {@link Instant} * @@ -155,6 +145,16 @@ public class EntryDate extends EntryBase { return this; } + /** + * Sets the {@link java.time.format.DateTimeFormatter DateTimeFormatter} pattern. + * + * @param pattern the pattern + */ + public EntryDate pattern(String pattern) { + super.pattern(pattern); + return this; + } + /** * The units available for {@link EntryDate} calculations. * diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryInt.java b/src/main/java/rife/bld/extension/propertyfile/EntryInt.java index b2e0e91..896bbf1 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryInt.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,16 +32,6 @@ public class EntryInt extends EntryBase { super(key); } - /** - * Sets the {@link java.text.DecimalFormat DecimalFormat} pattern. - * - * @param pattern the pattern - */ - public EntryInt pattern(String pattern) { - super.pattern(pattern); - return this; - } - /** * Sets the new {@link java.util.Properties property} value to an integer. * @@ -52,4 +42,14 @@ public class EntryInt extends EntryBase { newValue(i); return this; } + + /** + * Sets the {@link java.text.DecimalFormat DecimalFormat} pattern. + * + * @param pattern the pattern + */ + public EntryInt pattern(String pattern) { + super.pattern(pattern); + return this; + } } diff --git a/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java b/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java index f51b288..c86204e 100644 --- a/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java +++ b/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import rife.bld.operations.AbstractOperation; import rife.bld.operations.exceptions.ExitStatusException; import java.io.File; -import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Properties; @@ -35,7 +34,7 @@ import java.util.logging.Logger; * @since 1.0 */ public class PropertyFileOperation extends AbstractOperation { - private static final Logger LOGGER = Logger.getLogger(PropertyFileOperation.class.getName()); + private final static Logger LOGGER = Logger.getLogger(PropertyFileOperation.class.getName()); private final List> entries_ = new ArrayList<>(); private String comment_ = ""; private boolean failOnWarning_; @@ -153,26 +152,8 @@ public class PropertyFileOperation extends AbstractOperation v - 2); PropertyFileUtils.processDate(p, entryDate.now()); - assertThat(p.getProperty(entryDate.key())).as("processDate(now-2)").isEqualTo(String.valueOf( - LocalDateTime.now().minusDays(2).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(now-2)").isEqualTo(String.valueOf(dayOfYear - 2)); entryDate.calc(SUB); PropertyFileUtils.processDate(p, entryDate.set(new Date())); - assertThat(p.getProperty(entryDate.key())).as("processDate(date-1)").isEqualTo(String.valueOf( - LocalDateTime.now().minusDays(1).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(date-1)").isEqualTo(String.valueOf(dayOfYear - 1)); entryDate.calc(v -> v - 2); PropertyFileUtils.processDate(p, entryDate.set(Calendar.getInstance())); - assertThat(p.getProperty(entryDate.key())).as("processDate(cal-2)").isEqualTo(String.valueOf( - LocalDateTime.now().minusDays(2).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(cal-2)").isEqualTo(String.valueOf(dayOfYear - 2)); entryDate.calc(v -> v - 3); PropertyFileUtils.processDate(p, entryDate.set(LocalDate.now())); - assertThat(p.getProperty(entryDate.key())).as("processDate(LocalDate-3)").isEqualTo(String.valueOf( - LocalDateTime.now().minusDays(3).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(LocalDate-3)").isEqualTo(String.valueOf(dayOfYear - 3)); } @Test @@ -174,26 +170,22 @@ class PropertyFileUtilsTest { var entryDate = newEntryDate(); entryDate.calc(ADD); PropertyFileUtils.processDate(p, entryDate.now()); - assertThat(p.getProperty(entryDate.key())).as("processDate(now+1)").isEqualTo(String.valueOf( - LocalDateTime.now().plusDays(1).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(now+1)").isEqualTo(String.valueOf(dayOfYear + 1)); PropertyFileUtils.processDate(p, entryDate.now().calc(v -> v + 3)); - assertThat(p.getProperty(entryDate.key())).as("processDate(now+3)").isEqualTo(String.valueOf( - LocalDateTime.now().plusDays(3).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(now+3)").isEqualTo(String.valueOf(dayOfYear + 3)); entryDate.calc(ADD); PropertyFileUtils.processDate(p, entryDate.set(ZonedDateTime.now())); assertThat(p.getProperty(entryDate.key())).as("processDate(ZonedDateTime+1)") - .isEqualTo(String.valueOf(LocalDateTime.now().plusDays(1).getDayOfYear())); + .isEqualTo(String.valueOf(dayOfYear + 1)); PropertyFileUtils.processDate(p, entryDate.set(Instant.now()).calc(v -> v + 2)); - assertThat(p.getProperty(entryDate.key())).as("processDate(Instant+2)").isEqualTo(String.valueOf( - LocalDateTime.now().plusDays(2).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(Instant+2)").isEqualTo(String.valueOf(dayOfYear + 2)); entryDate.calc(v -> v + 3); PropertyFileUtils.processDate(p, entryDate.set(LocalDateTime.now())); - assertThat(p.getProperty(entryDate.key())).as("processDate(LocalDteTime+2)") - .isEqualTo(String.valueOf(LocalDateTime.now().plusDays(3).getDayOfYear())); + assertThat(p.getProperty(entryDate.key())).as("processDate(LocalDteTime+2)").isEqualTo(String.valueOf(dayOfYear + 3)); } @Test