From 0c50c9cb9c5275bcdba08c929f1acbff27c9ef36 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 6 Sep 2021 10:18:36 +0200 Subject: [PATCH] make jackson jars open and non-synthetic modules --- build.gradle | 52 +++++++++++++++++++ .../javamodules/ExtraModuleInfoTransform.java | 14 +++-- .../transform/javamodules/ModuleInfo.java | 9 ++++ src/main/java/module-info.java | 1 + 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 0b1f5967..d14e4b1f 100644 --- a/build.gradle +++ b/build.gradle @@ -239,6 +239,55 @@ task packageTarDistribution(type: Tar) { } extraJavaModuleInfo { + module('jackson-core-2.10.1.jar', 'com.fasterxml.jackson.core', '2.10.1') { + exports('com.fasterxml.jackson.core') + exports('com.fasterxml.jackson.core.async') + exports('com.fasterxml.jackson.core.base') + exports('com.fasterxml.jackson.core.exc') + exports('com.fasterxml.jackson.core.filter') + exports('com.fasterxml.jackson.core.format') + exports('com.fasterxml.jackson.core.io') + exports('com.fasterxml.jackson.core.json') + exports('com.fasterxml.jackson.core.json.async') + exports('com.fasterxml.jackson.core.sym') + exports('com.fasterxml.jackson.core.type') + exports('com.fasterxml.jackson.core.util') + uses('com.fasterxml.jackson.core.ObjectCodec') + } + module('jackson-annotations-2.10.1.jar', 'com.fasterxml.jackson.annotation', '2.10.1') { + requires('com.fasterxml.jackson.core') + exports('com.fasterxml.jackson.annotation') + } + module('jackson-databind-2.10.1.jar', 'com.fasterxml.jackson.databind', '2.10.1') { + requires('java.desktop') + requires('java.logging') + requires('com.fasterxml.jackson.annotation') + requires('com.fasterxml.jackson.core') + requires('java.sql') + requires('java.xml') + exports('com.fasterxml.jackson.databind') + exports('com.fasterxml.jackson.databind.annotation') + exports('com.fasterxml.jackson.databind.cfg') + exports('com.fasterxml.jackson.databind.deser') + exports('com.fasterxml.jackson.databind.deser.impl') + exports('com.fasterxml.jackson.databind.deser.std') + exports('com.fasterxml.jackson.databind.exc') + exports('com.fasterxml.jackson.databind.ext') + exports('com.fasterxml.jackson.databind.introspect') + exports('com.fasterxml.jackson.databind.json') + exports('com.fasterxml.jackson.databind.jsonFormatVisitors') + exports('com.fasterxml.jackson.databind.jsonschema') + exports('com.fasterxml.jackson.databind.jsontype') + exports('com.fasterxml.jackson.databind.jsontype.impl') + exports('com.fasterxml.jackson.databind.module') + exports('com.fasterxml.jackson.databind.node') + exports('com.fasterxml.jackson.databind.ser') + exports('com.fasterxml.jackson.databind.ser.impl') + exports('com.fasterxml.jackson.databind.ser.std') + exports('com.fasterxml.jackson.databind.type') + exports('com.fasterxml.jackson.databind.util') + uses('com.fasterxml.jackson.databind.Module') + } module('tornadofx-controls-1.0.4.jar', 'tornadofx.controls', '1.0.4') { exports('tornadofx.control') requires('javafx.controls') @@ -255,6 +304,7 @@ extraJavaModuleInfo { exports('com.github.arteam.simplejsonrpc.client') exports('com.github.arteam.simplejsonrpc.client.builder') exports('com.github.arteam.simplejsonrpc.client.exception') + requires('com.fasterxml.jackson.core') requires('com.fasterxml.jackson.databind') requires('simple.json.rpc.core') } @@ -399,6 +449,8 @@ extraJavaModuleInfo { requires('org.slf4j') requires('org.bouncycastle.provider') requires('com.fasterxml.jackson.databind') + requires('com.fasterxml.jackson.annotation') + requires('com.fasterxml.jackson.core') requires('logback.classic') requires('org.json') exports('com.samourai.http.client') diff --git a/buildSrc/src/main/java/org/gradle/sample/transform/javamodules/ExtraModuleInfoTransform.java b/buildSrc/src/main/java/org/gradle/sample/transform/javamodules/ExtraModuleInfoTransform.java index 4621956c..6d7c6931 100644 --- a/buildSrc/src/main/java/org/gradle/sample/transform/javamodules/ExtraModuleInfoTransform.java +++ b/buildSrc/src/main/java/org/gradle/sample/transform/javamodules/ExtraModuleInfoTransform.java @@ -58,7 +58,8 @@ abstract public class ExtraModuleInfoTransform implements TransformAction exports = new ArrayList<>(); private List requires = new ArrayList<>(); private List requiresTransitive = new ArrayList<>(); + private List uses = new ArrayList<>(); ModuleInfo(String moduleName, String moduleVersion) { this.moduleName = moduleName; @@ -31,6 +32,10 @@ public class ModuleInfo implements Serializable { this.requiresTransitive.add(requiresTransitive); } + public void uses(String uses) { + this.uses.add(uses); + } + public String getModuleName() { return moduleName; } @@ -50,4 +55,8 @@ public class ModuleInfo implements Serializable { protected List getRequiresTransitive() { return requiresTransitive; } + + protected List getUses() { + return uses; + } } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index d846e1e1..8cd83390 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -18,6 +18,7 @@ open module com.sparrowwallet.sparrow { requires simple.json.rpc.core; requires org.jetbrains.annotations; requires com.fasterxml.jackson.databind; + requires com.fasterxml.jackson.annotation; requires netlayer.jpms; requires org.slf4j; requires com.google.gson;