diff --git a/.circleci/config.yml b/.circleci/config.yml index 77889be..09d8896 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ defaults: &defaults TERM: dumb CI_NAME: "CircleCI" -defaults_gradle: &defaults_bld +defaults_bld: &defaults_bld steps: - checkout - run: diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index ba51eb1..19a51fd 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -1,6 +1,6 @@ name: bld-ci -on: [ push, pull_request, workflow_dispatch ] +on: [push, pull_request, workflow_dispatch] jobs: build-bld-project: @@ -11,18 +11,18 @@ jobs: strategy: matrix: - java-version: [ 17, 20 ] + java-version: [17, 21, 22] steps: - name: Checkout source repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: "zulu" java-version: ${{ matrix.java-version }} - name: Grant bld execute permission diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index bff4f62..a2969be 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/.vscode/settings.json b/.vscode/settings.json index 5633e79..d136e4d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,13 +3,13 @@ "src/main/java", "src/main/resources", "src/test/java", - "src/bld/java" + "src/test/resources", + "src/bld/java", + "src/bld/resources" ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-1.8.0.jar", - "lib/compile/*.jar", - "lib/runtime/*.jar", - "lib/test/*.jar" + "${HOME}/.bld/dist/bld-1.9.1.jar", + "lib/**/*.jar" ] } diff --git a/README.md b/README.md index 5ad9830..7dd06b6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause) -[![Kotlin](https://img.shields.io/badge/kotlin-1.9.21-7f52ff)](https://kotlinlang.org/) -[![bld](https://img.shields.io/badge/1.8.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) +[![Kotlin](https://img.shields.io/badge/kotlin-1.9.24-7f52ff)](https://kotlinlang.org/) +[![bld](https://img.shields.io/badge/1.9.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://img.shields.io/github/release/ethauvin/readingtime.svg)](https://github.com/ethauvin/readingtime/releases/latest) [![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/readingtime.svg?color=blue)](https://search.maven.org/search?q=g:%22net.thauvin.erik%22%20AND%20a:%22readingtime%22) [![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/readingtime?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/readingtime/) @@ -30,7 +30,7 @@ println(rt.calcEstimatedReadTime()) // eg: 2 min read To get the estimated reading time in seconds use the `calcReadingTimeInSec()` function. -### bld +## bld To use with [bld](https://rife2.com/bld), include the following dependency in your [build](https://github.com/ethauvin/readingtime/blob/master/examples/bld/src/bld/java/com/example/ReadingTimeExampleBuild.java) file: @@ -56,7 +56,7 @@ dependencies { ``` Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://search.maven.org/search?q=g:%22net.thauvin.erik%22%20AND%20a:%22readingtime%22). -### Properties +## Properties The following properties are available: @@ -83,7 +83,7 @@ Property | Description `extra` | Additional seconds to be added to the total reading time. `roundingMode` | The [rounding mode](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/RoundingMode.html) to apply. -### Functions +## Functions A couple of useful functions are also available: @@ -92,7 +92,7 @@ ReadingTime.wordCount(htmlText) // Returns the count of words. (HTML stripped) ReadingTime.imgCount(htmlText) // Returns the count of images. (HTML img tags) ``` -### JSP +## JSP A JSP tag is also available for easy incorporation into web applications: @@ -124,5 +124,4 @@ cd readingtime ./bld compile ``` -The project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all -the dependencies were downloaded and peruse the code. +The project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all the dependencies were downloaded and peruse the code. diff --git a/examples/bld/.idea/libraries/bld.xml b/examples/bld/.idea/libraries/bld.xml index 9a58e7b..cb3eddb 100644 --- a/examples/bld/.idea/libraries/bld.xml +++ b/examples/bld/.idea/libraries/bld.xml @@ -2,11 +2,11 @@ - + - + diff --git a/examples/bld/.vscode/settings.json b/examples/bld/.vscode/settings.json index 5633e79..d136e4d 100644 --- a/examples/bld/.vscode/settings.json +++ b/examples/bld/.vscode/settings.json @@ -3,13 +3,13 @@ "src/main/java", "src/main/resources", "src/test/java", - "src/bld/java" + "src/test/resources", + "src/bld/java", + "src/bld/resources" ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-1.8.0.jar", - "lib/compile/*.jar", - "lib/runtime/*.jar", - "lib/test/*.jar" + "${HOME}/.bld/dist/bld-1.9.1.jar", + "lib/**/*.jar" ] } diff --git a/examples/bld/lib/bld/bld-wrapper.jar b/examples/bld/lib/bld/bld-wrapper.jar index 1ae4f55..4e3c280 100644 Binary files a/examples/bld/lib/bld/bld-wrapper.jar and b/examples/bld/lib/bld/bld-wrapper.jar differ diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties index 6a3f215..113b890 100644 --- a/examples/bld/lib/bld/bld-wrapper.properties +++ b/examples/bld/lib/bld/bld-wrapper.properties @@ -1,7 +1,7 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.0-SNAPSHOT +bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.4 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= bld.sourceDirectories= -bld.version=1.8.0 +bld.version=1.9.1 diff --git a/examples/gradle/build.gradle.kts b/examples/gradle/build.gradle.kts index 637f809..f5ec670 100644 --- a/examples/gradle/build.gradle.kts +++ b/examples/gradle/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("application") id("com.github.ben-manes.versions") version "0.51.0" - kotlin("jvm") version "1.9.22" + kotlin("jvm") version "1.9.24" } repositories { diff --git a/examples/gradle/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/gradle/wrapper/gradle-wrapper.jar index 7f93135..e644113 100644 Binary files a/examples/gradle/gradle/wrapper/gradle-wrapper.jar and b/examples/gradle/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/gradle/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/gradle/wrapper/gradle-wrapper.properties index 1af9e09..b82aa23 100644 --- a/examples/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/examples/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/examples/gradle/gradlew.bat b/examples/gradle/gradlew.bat index 93e3f59..25da30d 100644 --- a/examples/gradle/gradlew.bat +++ b/examples/gradle/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index 1ae4f55..ddd6351 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 826f8dd..2895a28 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,9 +1,9 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.2 -bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.0 -bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.0 +bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.2 +bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5 +bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.4 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= bld.sourceDirectories= -bld.version=1.8.0 +bld.version=1.9.1 diff --git a/pom.xml b/pom.xml index 0702f28..812df01 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ org.jetbrains.kotlin kotlin-stdlib - 1.9.22 + 1.9.24 compile diff --git a/src/bld/java/net/thauvin/erik/ReadingTimeBuild.java b/src/bld/java/net/thauvin/erik/ReadingTimeBuild.java index 1a79c82..681b670 100644 --- a/src/bld/java/net/thauvin/erik/ReadingTimeBuild.java +++ b/src/bld/java/net/thauvin/erik/ReadingTimeBuild.java @@ -64,14 +64,14 @@ public class ReadingTimeBuild extends Project { autoDownloadPurge = true; repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); - final var kotlin = version(1, 9, 22); + final var kotlin = version(1, 9, 24); scope(compile) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) .include(dependency("org.jsoup", "jsoup", version(1, 17, 2))); scope(test) .include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin)) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1))); + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2))); publishOperation() .repository(version.isSnapshot() ? repository(SONATYPE_SNAPSHOTS_LEGACY.location()) @@ -140,6 +140,7 @@ public class ReadingTimeBuild extends Project { public void jacoco() throws IOException { new JacocoReportOperation() .fromProject(this) + .sourceFiles(new File(srcMainDirectory(), "kotlin")) .execute(); }