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

@@ -1,14 +1,13 @@
plugins {
id 'maven-publish'
id 'jacoco'
alias catalog.plugins.multi.release.jar
alias catalog.plugins.envelope
alias catalog.plugins.graalvm.native.image
alias catalog.plugins.sambal
}
import net.woggioni.gradle.graalvm.NativeImageTask
import net.woggioni.gradle.envelope.EnvelopeJarTask
import net.woggioni.gradle.envelope.EnvelopePlugin
import net.woggioni.gradle.graalvm.*
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
dependencies {
@@ -19,9 +18,12 @@ dependencies {
implementation project(':wcfg')
}
application {
mainClass = 'net.woggioni.wson.cli.WsonCli'
mainModule = 'net.woggioni.wson.cli'
Property<String> mainClassName = objects.property(String.class).convention('net.woggioni.wson.cli.WsonCli')
Property<String> mainModuleName = objects.property(String.class).convention('net.woggioni.wson.cli')
envelopeJar {
mainClass = mainClassName
mainModule = mainModuleName
}
compileJava {
@@ -33,17 +35,16 @@ compileJava {
options.javaModuleVersion = project.version
}
configureNativeImage {
// args = [
// 'wson',
// '-f',
// '../test-utils/src/main/resources/wordpress.json',
// '-t',
// 'jbon',
// '-o',
// '/dev/null'
// ]
tasks.named(NativeImagePlugin.CONFIGURE_NATIVE_IMAGE_TASK_NAME, NativeImageConfigurationTask) {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.GRAAL_VM
}
mainClass = mainClassName
mainModule = mainModuleName
mergeConfiguration = true
modularity.inferModulePath = true
enabled = true
args = [
'wcfg',
'-f',
@@ -53,24 +54,34 @@ configureNativeImage {
'-o',
'/dev/null'
]
mergeConfiguration = true
}
Provider<EnvelopeJarTask> envelopeJarTaskProvider = tasks.named('envelopeJar')
Provider<NativeImageTask> nativeImageTaskProvider = tasks.named("nativeImage") {
nativeImage {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.GRAAL_VM
}
mainClass = mainClassName
mainModule = mainModuleName
useMusl = true
buildStaticImage = true
linkAtBuildTime = false
compressExecutable = true
compressionLevel = 6
useLZMA = false
}
tasks.named(BasePlugin.ASSEMBLE_TASK_NAME, Task) {
inputs.files(nativeImageTaskProvider)
Provider<UpxTask> upxTaskProvider = tasks.named(NativeImagePlugin.UPX_TASK_NAME, UpxTask) {
}
Provider<EnvelopeJarTask> envelopeJarTaskProvider = tasks.named(EnvelopePlugin.ENVELOPE_JAR_TASK_NAME, EnvelopeJarTask.class) {
mainModule = mainModuleName
mainClass = mainClassName
}
artifacts {
archives nativeImageTaskProvider.map(NativeImageTask.&getOutputFile)
archives envelopeJarTaskProvider.map(EnvelopeJarTask.&getArchiveFile)
add('archives', upxTaskProvider)
add('archives', envelopeJarTaskProvider)
}
publishing {
@@ -78,10 +89,10 @@ publishing {
maven(MavenPublication) {
artifact envelopeJar
def host = DefaultNativePlatform.host()
artifact(
source: nativeImageTaskProvider,
classifier: host.operatingSystem.name + '-' + host.architecture.name
)
artifact(upxTaskProvider) {
extension = "exe"
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) {
String version = null;
String vcsHash = null;
Enumeration<URL> it = getClass().getClassLoader().getResources(JarFile.MANIFEST_NAME);
while (it.hasMoreElements()) {
URL manifestURL = it.nextElement();
Manifest mf = new Manifest();
try (InputStream inputStream = manifestURL.openStream()) {
mf.read(inputStream);
}
Attributes mainAttributes = mf.getMainAttributes();
if (Objects.equals(specificationTitle, mainAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE))) {
version = mainAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);
vcsHash = mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
}
final Manifest mf = new Manifest();
try(InputStream is = getClass().getModule().getResourceAsStream(JarFile.MANIFEST_NAME)) {
mf.read(is);
}
Attributes mainAttributes = mf.getMainAttributes();
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) {
throw new RuntimeException("Version information not found in manifest");