updated dependencies
All checks were successful
CI / build (push) Successful in 2m4s

This commit is contained in:
2026-03-12 21:32:18 +08:00
parent bd1bc9c997
commit e23e12266e
15 changed files with 703 additions and 63 deletions

View File

@@ -4,12 +4,10 @@ on:
branches: [ master ] branches: [ master ]
jobs: jobs:
build: build:
runs-on: hostinger runs-on: woryzen
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Execute Gradle build - name: Execute Gradle build
env: env:
PUBLISHER_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} PUBLISHER_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

View File

@@ -1,7 +1,6 @@
plugins { plugins {
id 'jacoco' id 'jacoco'
id 'maven-publish' id 'maven-publish'
alias catalog.plugins.multi.release.jar
alias catalog.plugins.envelope apply false alias catalog.plugins.envelope apply false
alias catalog.plugins.lombok apply false alias catalog.plugins.lombok apply false
} }
@@ -17,8 +16,8 @@ allprojects {
java { java {
modularity.inferModulePath = true modularity.inferModulePath = true
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(21) languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.ORACLE vendor = JvmVendorSpec.GRAAL_VM
} }
} }
@@ -48,10 +47,12 @@ allprojects {
dependencies { dependencies {
implementation catalog.xz implementation catalog.xz
compileOnly catalog.lombok
testImplementation catalog.junit.jupiter.api testImplementation catalog.junit.jupiter.api
testImplementation catalog.junit.jupiter.params testImplementation catalog.junit.jupiter.params
testRuntimeOnly catalog.junit.jupiter.engine testRuntimeOnly catalog.junit.jupiter.engine
testRuntimeOnly catalog.junit.platform.launcher
} }
test { test {

View File

@@ -1,7 +1,7 @@
org.gradle.caching=true org.gradle.caching=true
wson.version = 2025.01.21 wson.version = 2026.03.12
lys.version = 2025.01.17 lys.version = 2026.02.19
gitea.maven.url = https://gitea.woggioni.net/api/packages/woggioni/maven gitea.maven.url = https://gitea.woggioni.net/api/packages/woggioni/maven

Binary file not shown.

View File

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

15
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original authors. # Copyright © 2015 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
# #
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || 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. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@@ -112,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@@ -170,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -203,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # 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. # 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 # * 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. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.

5
gradlew.bat vendored
View File

@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@@ -68,11 +70,10 @@ goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

View File

@@ -6,7 +6,6 @@ pluginManagement {
includeGroup 'net.woggioni.gradle' includeGroup 'net.woggioni.gradle'
includeGroup 'net.woggioni.gradle.lombok' includeGroup 'net.woggioni.gradle.lombok'
includeGroup 'net.woggioni.gradle.envelope' includeGroup 'net.woggioni.gradle.envelope'
includeGroup 'net.woggioni.gradle.multi-release-jar'
includeGroup 'net.woggioni.gradle.graalvm.native-image' includeGroup 'net.woggioni.gradle.graalvm.native-image'
includeGroup 'net.woggioni.gradle.graalvm.jlink' includeGroup 'net.woggioni.gradle.graalvm.jlink'
includeGroup 'net.woggioni.gradle.sambal' includeGroup 'net.woggioni.gradle.sambal'
@@ -28,6 +27,7 @@ dependencyResolutionManagement {
versionCatalogs { versionCatalogs {
catalog { catalog {
from group: 'com.lys', name: 'lys-catalog', version: getProperty('lys.version') from group: 'com.lys', name: 'lys-catalog', version: getProperty('lys.version')
version('my-gradle-plugins', '2026.02.23')
} }
} }
} }

View File

@@ -1,7 +1,6 @@
plugins { plugins {
id 'antlr' id 'antlr'
id 'jacoco' id 'jacoco'
alias catalog.plugins.multi.release.jar
} }
configurations { configurations {

View File

@@ -1,14 +1,13 @@
plugins { plugins {
id 'maven-publish' id 'maven-publish'
id 'jacoco' id 'jacoco'
alias catalog.plugins.multi.release.jar
alias catalog.plugins.envelope alias catalog.plugins.envelope
alias catalog.plugins.graalvm.native.image alias catalog.plugins.graalvm.native.image
alias catalog.plugins.sambal alias catalog.plugins.sambal
} }
import net.woggioni.gradle.graalvm.NativeImageTask
import net.woggioni.gradle.envelope.EnvelopeJarTask import net.woggioni.gradle.envelope.EnvelopeJarTask
import net.woggioni.gradle.envelope.EnvelopePlugin
import net.woggioni.gradle.graalvm.*
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
dependencies { dependencies {
@@ -19,9 +18,12 @@ dependencies {
implementation project(':wcfg') implementation project(':wcfg')
} }
application { Property<String> mainClassName = objects.property(String.class).convention('net.woggioni.wson.cli.WsonCli')
mainClass = 'net.woggioni.wson.cli.WsonCli' Property<String> mainModuleName = objects.property(String.class).convention('net.woggioni.wson.cli')
mainModule = 'net.woggioni.wson.cli'
envelopeJar {
mainClass = mainClassName
mainModule = mainModuleName
} }
compileJava { compileJava {
@@ -33,17 +35,16 @@ compileJava {
options.javaModuleVersion = project.version options.javaModuleVersion = project.version
} }
configureNativeImage { tasks.named(NativeImagePlugin.CONFIGURE_NATIVE_IMAGE_TASK_NAME, NativeImageConfigurationTask) {
// args = [ toolchain {
// 'wson', languageVersion = JavaLanguageVersion.of(25)
// '-f', vendor = JvmVendorSpec.GRAAL_VM
// '../test-utils/src/main/resources/wordpress.json', }
// '-t', mainClass = mainClassName
// 'jbon', mainModule = mainModuleName
// '-o', mergeConfiguration = true
// '/dev/null' modularity.inferModulePath = true
// ] enabled = true
args = [ args = [
'wcfg', 'wcfg',
'-f', '-f',
@@ -53,24 +54,34 @@ configureNativeImage {
'-o', '-o',
'/dev/null' '/dev/null'
] ]
mergeConfiguration = true
} }
Provider<EnvelopeJarTask> envelopeJarTaskProvider = tasks.named('envelopeJar') nativeImage {
toolchain {
Provider<NativeImageTask> nativeImageTaskProvider = tasks.named("nativeImage") { languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.GRAAL_VM
}
mainClass = mainClassName
mainModule = mainModuleName
useMusl = true useMusl = true
buildStaticImage = true buildStaticImage = true
linkAtBuildTime = false
compressExecutable = true
compressionLevel = 6
useLZMA = false
} }
tasks.named(BasePlugin.ASSEMBLE_TASK_NAME, Task) { Provider<UpxTask> upxTaskProvider = tasks.named(NativeImagePlugin.UPX_TASK_NAME, UpxTask) {
inputs.files(nativeImageTaskProvider) }
Provider<EnvelopeJarTask> envelopeJarTaskProvider = tasks.named(EnvelopePlugin.ENVELOPE_JAR_TASK_NAME, EnvelopeJarTask.class) {
mainModule = mainModuleName
mainClass = mainClassName
} }
artifacts { artifacts {
archives nativeImageTaskProvider.map(NativeImageTask.&getOutputFile) add('archives', upxTaskProvider)
archives envelopeJarTaskProvider.map(EnvelopeJarTask.&getArchiveFile) add('archives', envelopeJarTaskProvider)
} }
publishing { publishing {
@@ -78,10 +89,10 @@ publishing {
maven(MavenPublication) { maven(MavenPublication) {
artifact envelopeJar artifact envelopeJar
def host = DefaultNativePlatform.host() def host = DefaultNativePlatform.host()
artifact( artifact(upxTaskProvider) {
source: nativeImageTaskProvider, extension = "exe"
classifier: host.operatingSystem.name + '-' + host.architecture.name classifier = host.operatingSystem.name + '-' + host.architecture.name
) }
} }
} }
} }

View File

@@ -0,0 +1,635 @@
{
"reflection": [
{
"type": "com.sun.crypto.provider.AESCipher$General",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.crypto.provider.ARCFOURCipher",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Poly1305",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.crypto.provider.DESCipher",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.crypto.provider.DESedeCipher",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.crypto.provider.GaloisCounterMode$AESGCM",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "groovy.lang.Closure"
},
{
"type": "java.lang.Boolean",
"jniAccessible": true,
"methods": [
{
"name": "getBoolean",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.lang.Object",
"allDeclaredFields": true
},
{
"type": "java.nio.file.Path"
},
{
"type": "java.nio.file.Paths",
"methods": [
{
"name": "get",
"parameterTypes": [
"java.lang.String",
"java.lang.String[]"
]
}
]
},
{
"type": "java.security.AlgorithmParametersSpi"
},
{
"type": "java.security.KeyStoreSpi"
},
{
"type": "java.security.SecureRandomParameters"
},
{
"type": "java.sql.Connection"
},
{
"type": "java.sql.Driver"
},
{
"type": "java.sql.DriverManager",
"methods": [
{
"name": "getConnection",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "getDriver",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.sql.Time",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"long"
]
}
]
},
{
"type": "java.sql.Timestamp",
"methods": [
{
"name": "valueOf",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.time.Duration",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.Instant",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.LocalDate",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.LocalDateTime",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.LocalTime",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.MonthDay",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.OffsetDateTime",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.OffsetTime",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.Period",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.Year",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.YearMonth",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "java.time.ZoneId",
"methods": [
{
"name": "of",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.time.ZoneOffset",
"methods": [
{
"name": "of",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.time.ZonedDateTime",
"methods": [
{
"name": "parse",
"parameterTypes": [
"java.lang.CharSequence"
]
}
]
},
{
"type": "javax.security.auth.x500.X500Principal",
"fields": [
{
"name": "thisX500Name"
}
],
"methods": [
{
"name": "<init>",
"parameterTypes": [
"sun.security.x509.X500Name"
]
}
]
},
{
"type": "net.woggioni.wson.cli.OutputTypeConverter",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "net.woggioni.wson.cli.SerializationTypeConverter",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "net.woggioni.wson.cli.VersionProvider",
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "net.woggioni.wson.cli.WcfgCommand",
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "net.woggioni.wson.cli.WsonCli",
"allDeclaredFields": true
},
{
"type": "net.woggioni.wson.cli.WsonCommand",
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "org.slf4j.simple.SimpleServiceProvider"
},
{
"type": "sun.security.pkcs12.PKCS12KeyStore",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.pkcs12.PKCS12KeyStore$DualFormatPKCS12",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.JavaKeyStore$JKS",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.NativePRNG",
"methods": [
{
"name": "<init>",
"parameterTypes": []
},
{
"name": "<init>",
"parameterTypes": [
"java.security.SecureRandomParameters"
]
}
]
},
{
"type": "sun.security.provider.SHA",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.X509Factory",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.rsa.RSAKeyFactory$Legacy",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.ssl.KeyManagerFactoryImpl$SunX509",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.ssl.SSLContextImpl$DefaultSSLContext",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.x509.AuthorityInfoAccessExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.AuthorityKeyIdentifierExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.BasicConstraintsExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.CRLDistributionPointsExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.CertificatePoliciesExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.ExtendedKeyUsageExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.IssuerAlternativeNameExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.KeyUsageExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.NetscapeCertTypeExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.PrivateKeyUsageExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.SubjectAlternativeNameExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
},
{
"type": "sun.security.x509.SubjectKeyIdentifierExtension",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.Boolean",
"java.lang.Object"
]
}
]
}
],
"resources": [
{
"glob": "META-INF/MANIFEST.MF"
},
{
"glob": "META-INF/services/java.lang.System$LoggerFinder"
},
{
"glob": "META-INF/services/java.net.spi.URLStreamHandlerProvider"
},
{
"glob": "META-INF/services/java.time.zone.ZoneRulesProvider"
},
{
"glob": "META-INF/services/org.slf4j.spi.SLF4JServiceProvider"
},
{
"glob": "simplelogger.properties"
},
{
"module": "net.woggioni.wson.cli",
"glob": "META-INF/MANIFEST.MF"
}
]
}

View File

@@ -20,18 +20,14 @@ abstract class AbstractVersionProvider implements CommandLine.IVersionProvider {
protected AbstractVersionProvider(String specificationTitle) { protected AbstractVersionProvider(String specificationTitle) {
String version = null; String version = null;
String vcsHash = null; String vcsHash = null;
Enumeration<URL> it = getClass().getClassLoader().getResources(JarFile.MANIFEST_NAME); final Manifest mf = new Manifest();
while (it.hasMoreElements()) { try(InputStream is = getClass().getModule().getResourceAsStream(JarFile.MANIFEST_NAME)) {
URL manifestURL = it.nextElement(); mf.read(is);
Manifest mf = new Manifest(); }
try (InputStream inputStream = manifestURL.openStream()) { Attributes mainAttributes = mf.getMainAttributes();
mf.read(inputStream); if (Objects.equals(specificationTitle, mainAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE))) {
} version = mainAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);
Attributes mainAttributes = mf.getMainAttributes(); vcsHash = mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
if (Objects.equals(specificationTitle, mainAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE))) {
version = mainAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);
vcsHash = mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
}
} }
if (version == null || vcsHash == null) { if (version == null || vcsHash == null) {
throw new RuntimeException("Version information not found in manifest"); throw new RuntimeException("Version information not found in manifest");