Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] c2e7a5e86c
Bump org.junit.jupiter:junit-jupiter-engine from 5.10.1 to 5.10.2
Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.10.1 to 5.10.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.1...r5.10.2)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
10 months ago

@ -6,22 +6,22 @@ plugins {
} }
group 'org.inksnow.husk' group 'net.william278'
version "1.1.2${versionMetadata()}" version "1.1.1${versionMetadata()}"
defaultTasks 'licenseFormat', 'build' defaultTasks 'licenseFormat', 'build'
repositories { repositories {
mavenCentral() mavenCentral()
maven { url 'https://repo.william278.net/releases/' } maven { url 'https://repo.minebench.de/' }
} }
dependencies { dependencies {
compileOnly 'net.william278:minedown:1.8.2' compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
compileOnly 'org.jetbrains:annotations:24.1.0' compileOnly 'org.jetbrains:annotations:24.1.0'
testImplementation 'net.william278:minedown:1.8.2' testImplementation 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
testImplementation 'net.kyori:adventure-platform-bukkit:4.3.2' testImplementation 'net.kyori:adventure-platform-bukkit:4.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
} }
@ -32,7 +32,7 @@ archivesBaseName = "${rootProject.name}"
tasks { tasks {
compileJava { compileJava {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.release.set(8) options.release.set(11)
} }
jar { jar {
manifest { manifest {
@ -67,19 +67,36 @@ test {
publishing { publishing {
repositories { repositories {
if (System.getenv("RELEASES_MAVEN_USERNAME") != null) {
maven { maven {
name = 'husk-release' name = "william278-releases"
url = findProperty("repository.huskrelease.url") url = "https://repo.william278.net/releases"
credentials { credentials {
username = findProperty("repository.huskrelease.username") username = System.getenv("RELEASES_MAVEN_USERNAME")
password = findProperty("repository.huskrelease.password") password = System.getenv("RELEASES_MAVEN_PASSWORD")
}
authentication {
basic(BasicAuthentication)
}
}
}
if (System.getenv("SNAPSHOTS_MAVEN_USERNAME") != null) {
maven {
name = "william278-snapshots"
url = "https://repo.william278.net/snapshots"
credentials {
username = System.getenv("SNAPSHOTS_MAVEN_USERNAME")
password = System.getenv("SNAPSHOTS_MAVEN_PASSWORD")
}
authentication {
basic(BasicAuthentication)
} }
} }
} }
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
groupId = 'org.inksnow.husk' groupId = 'net.william278'
artifactId = 'paginedown' artifactId = 'paginedown'
version = "$rootProject.version" version = "$rootProject.version"
artifact jar artifact jar
@ -87,6 +104,7 @@ publishing {
artifact sourcesJar artifact sourcesJar
} }
} }
}
} }
@SuppressWarnings('GrMethodMayBeStatic') @SuppressWarnings('GrMethodMayBeStatic')

@ -21,7 +21,6 @@ package net.william278.paginedown;
import de.themoep.minedown.adventure.MineDown; import de.themoep.minedown.adventure.MineDown;
import net.william278.paginedown.util.StringUtil;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.List; import java.util.List;
@ -137,7 +136,7 @@ public class PaginatedList {
} }
final StringJoiner menuJoiner = new StringJoiner("\n"); final StringJoiner menuJoiner = new StringJoiner("\n");
if (!StringUtil.isBlank(options.headerFormat)) { if (!options.headerFormat.isBlank()) {
menuJoiner.add(formatPageString(options.headerFormat, page)); menuJoiner.add(formatPageString(options.headerFormat, page));
if (options.spaceAfterHeader) { if (options.spaceAfterHeader) {
menuJoiner.add(""); menuJoiner.add("");
@ -151,7 +150,7 @@ public class PaginatedList {
menuJoiner.add(String.join(options.itemSeparator, getItemsForPage(page))); menuJoiner.add(String.join(options.itemSeparator, getItemsForPage(page)));
} }
if (!StringUtil.isBlank(options.footerFormat)) { if (!options.footerFormat.isBlank()) {
if (options.spaceBeforeFooter) { if (options.spaceBeforeFooter) {
menuJoiner.add(""); menuJoiner.add("");
} }
@ -292,7 +291,7 @@ public class PaginatedList {
lastPage = i; lastPage = i;
} }
} }
if (!StringUtil.isBlank(pages.toString())) { if (!pages.toString().isBlank()) {
pageGroups.add(pages.toString()); pageGroups.add(pages.toString());
} }
return pageGroups.toString(); return pageGroups.toString();

@ -1,40 +0,0 @@
/*
* This file is part of PagineDown, licensed under the Apache License 2.0.
*
* Copyright (c) William278 <will27528@gmail.com>
* Copyright (c) contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.william278.paginedown.util;
public final class StringUtil {
private StringUtil() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}
public static boolean isBlank(String $this) {
final int strLen = $this.length();
if (strLen == 0) {
return true;
}
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace($this.charAt(i))) {
return false;
}
}
return true;
}
}
Loading…
Cancel
Save