Compare commits

...

11 commits

Author SHA1 Message Date
7f4e2a8421
Update root pom 2025-03-16 12:12:18 -07:00
ad879b36e4
Update copyright 2025-03-16 12:12:05 -07:00
f4f831895d
Add parameters kdoc for builder constructor 2025-03-16 12:09:27 -07:00
918efe4c70
Updated extensions dependencies
Bump Detekt extension to version 0.9.9
Bump Dokka extension to version 1.0.3
Bump Jacoco Report extension to version 0.9.9
2025-03-16 12:09:26 -07:00
45d1d402bb
Bump Kotlin extension to version 1.0.4 2025-03-16 12:06:43 -07:00
c0e0989863
Bump Java matrix from version 22 to 23 2025-03-16 12:06:11 -07:00
dba879dcbc
Bump Kotlin to version 2.1.10 2025-03-16 12:05:34 -07:00
05361c981e
Bump JSoup to version 1.19.1 2025-03-16 12:04:22 -07:00
dbc782aca8
Bump JUnit to version 5.12.1 2025-03-16 12:03:52 -07:00
a5dbf0b546
Bump Gradle to version 8.13 2025-03-16 12:03:24 -07:00
4d78c7f86d
Bump bld to version 2.2.1 2025-03-16 12:02:32 -07:00
21 changed files with 98 additions and 38 deletions

View file

@ -13,8 +13,8 @@ jobs:
strategy:
matrix:
java-version: [17, 21, 22]
kotlin-version: [1.19.24, 2.0.20]
java-version: [17, 21, 23]
kotlin-version: [1.9.25, 2.1.10]
steps:
- name: Checkout source repository

View file

@ -2,12 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -9,7 +9,7 @@
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.1.0.jar",
"${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar"
]
}

View file

@ -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-2.0.20-7f52ff)](https://kotlinlang.org/)
[![bld](https://img.shields.io/badge/2.1.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.10-7f52ff)](https://kotlinlang.org/)
[![bld](https://img.shields.io/badge/2.2.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/)

View file

@ -2,11 +2,11 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -9,7 +9,7 @@
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.1.0.jar",
"${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar"
]
}

Binary file not shown.

View file

@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.4
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.1.0
bld.version=2.2.1

View file

@ -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 "2.0.20"
kotlin("jvm") version "2.1.10"
}
repositories {

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View file

@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

Binary file not shown.

View file

@ -1,10 +1,10 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.7
bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.1
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.9
bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.3
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.9
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.4
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.1.0
bld.version=2.2.1

View file

@ -18,13 +18,13 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>2.0.20</version>
<version>2.1.10</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.18.1</version>
<version>1.19.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2024, Erik C. Thauvin (erik@thauvin.net)
* Copyright (c) 2020-2025, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -67,14 +67,14 @@ public class ReadingTimeBuild extends Project {
autoDownloadPurge = true;
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
final var kotlin = version(2, 0, 20);
final var kotlin = version(2, 1, 10);
scope(compile)
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
.include(dependency("org.jsoup", "jsoup", version(1, 18, 1)));
.include(dependency("org.jsoup", "jsoup", version(1, 19, 1)));
scope(test)
.include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)));
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1)));
publishOperation()
.repository(version.isSnapshot() ? repository(SONATYPE_SNAPSHOTS_LEGACY.location())

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2024, Erik C. Thauvin (erik@thauvin.net)
* Copyright (c) 2020-2025, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -33,7 +33,15 @@ package net.thauvin.erik.readingtime
import java.math.RoundingMode
/**
* Provides a configuration builder.
* Configuration class for reading time calculations.
*
* @property text The text to be evaluated.
* @property wpm The words per minute reading average.
* @property postfix The text to append after the reading time.
* @property plural The text to append after the reading time if plural.
* @property excludeImages Whether to exclude images in the word count.
* @property extra Additional time to add to the reading time.
* @property roundingMode The rounding mode to apply to the reading time.
*/
class Config private constructor(builder: Builder) {
val text = builder.text

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2024, Erik C. Thauvin (erik@thauvin.net)
* Copyright (c) 2020-2025, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,4 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020-2025, Erik C. Thauvin (erik@thauvin.net)
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice, this
~ list of conditions and the following disclaimer.
~
~ Redistributions in binary form must reproduce the above copyright notice,
~ this list of conditions and the following disclaimer in the documentation
~ and/or other materials provided with the distribution.
~
~ Neither the name of this project nor the names of its contributors may be
~ used to endorse or promote products derived from this software without
~ specific prior written permission.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
~ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
~ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
~ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
~ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
~ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
~ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
~ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<taglib xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0"
xmlns="http://java.sun.com/xml/ns/j2ee"

View file

@ -1,9 +1,32 @@
<%--
Copyright (c) 2020-2024, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
See: https://erik.thauvin.net/licenses/bsd.shtml
--%>
~ Copyright (c) 2020-2025, Erik C. Thauvin (erik@thauvin.net)
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice, this
~ list of conditions and the following disclaimer.
~
~ Redistributions in binary form must reproduce the above copyright notice,
~ this list of conditions and the following disclaimer in the documentation
~ and/or other materials provided with the distribution.
~
~ Neither the name of this project nor the names of its contributors may be
~ used to endorse or promote products derived from this software without
~ specific prior written permission.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
~ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
~ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
~ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
~ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
~ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
~ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
~ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--%>
<%@tag body-content="scriptless" import="net.thauvin.erik.readingtime.ReadingTime" trimDirectiveWhitespaces="true" %>
<%@attribute name="debug" type="java.lang.Boolean" %>
<%@attribute name="excludeImages" type="java.lang.Boolean" %>

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2024, Erik C. Thauvin (erik@thauvin.net)
* Copyright (c) 2020-2025, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without