From ed9e8de7216ff5e4b163990aa6557e57417750e6 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Mon, 16 Sep 2024 17:11:31 +0200 Subject: [PATCH] Better separation --- pom.xml | 82 ++++++++++++++++--- src/fatjar/java/module-info.java | 37 +++++++++ src/library/java/module-info.java | 35 ++++++++ .../rockserver/core}/EmptyByteBufStub.java | 2 +- .../JettyAlpnSslEngineSubstitutions.java | 2 +- .../core}/Log4J2LoggerSubstitutions.java | 2 +- src/{main => native}/java/module-info.java | 0 7 files changed, 145 insertions(+), 15 deletions(-) create mode 100644 src/fatjar/java/module-info.java create mode 100644 src/library/java/module-info.java rename src/{standalone/java/it/cavallium/rockserver/core/logging => native/java/it/cavallium/rockserver/core}/EmptyByteBufStub.java (94%) rename src/{standalone/java/it/cavallium/rockserver/core/logging => native/java/it/cavallium/rockserver/core}/JettyAlpnSslEngineSubstitutions.java (99%) rename src/{standalone/java/it/cavallium/rockserver/core/logging => native/java/it/cavallium/rockserver/core}/Log4J2LoggerSubstitutions.java (91%) rename src/{main => native}/java/module-info.java (100%) diff --git a/pom.xml b/pom.xml index c2baa58..8a0d436 100644 --- a/pom.xml +++ b/pom.xml @@ -237,10 +237,7 @@ - standalone - - false - + fatjar io.jstach.rainbowgum @@ -277,18 +274,12 @@ src/standalone/java/ + src/fatjar/java/ - - - - - fatjar - - org.apache.maven.plugins maven-shade-plugin @@ -310,10 +301,77 @@ + - native + library + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add-source + generate-sources + + add-source + + + + src/library/java/ + + + + + + + + + + native + + + io.jstach.rainbowgum + rainbowgum-core + ${rainbowgum.version} + compile + + + io.jstach.rainbowgum + rainbowgum-pattern + ${rainbowgum.version} + compile + + + io.jstach.rainbowgum + rainbowgum-slf4j + ${rainbowgum.version} + compile + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add-source + generate-sources + + add-source + + + + src/native/java/ + src/standalone/java/ + + + + + org.graalvm.buildtools native-maven-plugin diff --git a/src/fatjar/java/module-info.java b/src/fatjar/java/module-info.java new file mode 100644 index 0000000..ceb32a5 --- /dev/null +++ b/src/fatjar/java/module-info.java @@ -0,0 +1,37 @@ +module rockserver.core { + requires rocksdbjni; + requires net.sourceforge.argparse4j; + requires java.logging; + requires org.jetbrains.annotations; + requires high.scale.lib; + requires org.github.gestalt.core; + requires org.github.gestalt.hocon; + requires it.unimi.dsi.fastutil; + requires org.apache.thrift; + requires org.slf4j; + requires protobuf.java; + requires io.grpc.protobuf; + requires io.grpc.stub; + requires io.grpc; + requires jsr305; + requires com.google.common; + requires io.grpc.netty; + requires io.jstach.rainbowgum; + requires io.jstach.rainbowgum.pattern; + requires io.netty.common; + requires proto.google.common.protos; + requires io.netty.handler; + requires io.netty.buffer; + requires io.netty.transport; + requires io.netty.codec.http; + requires io.netty.codec; + requires io.netty.codec.http2; + + exports it.cavallium.rockserver.core.client; + exports it.cavallium.rockserver.core.common; + exports it.cavallium.rockserver.core.config; + opens it.cavallium.rockserver.core.resources; + opens it.cavallium.rockserver.core.config to org.github.gestalt.core, org.github.gestalt.hocon; + exports it.cavallium.rockserver.core.impl.rocksdb; + exports it.cavallium.rockserver.core.impl; +} \ No newline at end of file diff --git a/src/library/java/module-info.java b/src/library/java/module-info.java new file mode 100644 index 0000000..b2f0d2e --- /dev/null +++ b/src/library/java/module-info.java @@ -0,0 +1,35 @@ +module rockserver.core { + requires rocksdbjni; + requires net.sourceforge.argparse4j; + requires java.logging; + requires org.jetbrains.annotations; + requires high.scale.lib; + requires org.github.gestalt.core; + requires org.github.gestalt.hocon; + requires it.unimi.dsi.fastutil; + requires org.apache.thrift; + requires org.slf4j; + requires protobuf.java; + requires io.grpc.protobuf; + requires io.grpc.stub; + requires io.grpc; + requires jsr305; + requires com.google.common; + requires io.grpc.netty; + requires io.netty.common; + requires proto.google.common.protos; + requires io.netty.handler; + requires io.netty.buffer; + requires io.netty.transport; + requires io.netty.codec.http; + requires io.netty.codec; + requires io.netty.codec.http2; + + exports it.cavallium.rockserver.core.client; + exports it.cavallium.rockserver.core.common; + exports it.cavallium.rockserver.core.config; + opens it.cavallium.rockserver.core.resources; + opens it.cavallium.rockserver.core.config to org.github.gestalt.core, org.github.gestalt.hocon; + exports it.cavallium.rockserver.core.impl.rocksdb; + exports it.cavallium.rockserver.core.impl; +} \ No newline at end of file diff --git a/src/standalone/java/it/cavallium/rockserver/core/logging/EmptyByteBufStub.java b/src/native/java/it/cavallium/rockserver/core/EmptyByteBufStub.java similarity index 94% rename from src/standalone/java/it/cavallium/rockserver/core/logging/EmptyByteBufStub.java rename to src/native/java/it/cavallium/rockserver/core/EmptyByteBufStub.java index cd91dd2..9567265 100644 --- a/src/standalone/java/it/cavallium/rockserver/core/logging/EmptyByteBufStub.java +++ b/src/native/java/it/cavallium/rockserver/core/EmptyByteBufStub.java @@ -1,4 +1,4 @@ -package it.cavallium.rockserver.core.logging; +package it.cavallium.rockserver.core; import java.nio.ByteBuffer; diff --git a/src/standalone/java/it/cavallium/rockserver/core/logging/JettyAlpnSslEngineSubstitutions.java b/src/native/java/it/cavallium/rockserver/core/JettyAlpnSslEngineSubstitutions.java similarity index 99% rename from src/standalone/java/it/cavallium/rockserver/core/logging/JettyAlpnSslEngineSubstitutions.java rename to src/native/java/it/cavallium/rockserver/core/JettyAlpnSslEngineSubstitutions.java index 5462cac..04b2b9e 100644 --- a/src/standalone/java/it/cavallium/rockserver/core/logging/JettyAlpnSslEngineSubstitutions.java +++ b/src/native/java/it/cavallium/rockserver/core/JettyAlpnSslEngineSubstitutions.java @@ -1,4 +1,4 @@ -package it.cavallium.rockserver.core.logging; +package it.cavallium.rockserver.core; import static io.netty.handler.codec.http.HttpHeaderValues.DEFLATE; import static io.netty.handler.codec.http.HttpHeaderValues.GZIP; diff --git a/src/standalone/java/it/cavallium/rockserver/core/logging/Log4J2LoggerSubstitutions.java b/src/native/java/it/cavallium/rockserver/core/Log4J2LoggerSubstitutions.java similarity index 91% rename from src/standalone/java/it/cavallium/rockserver/core/logging/Log4J2LoggerSubstitutions.java rename to src/native/java/it/cavallium/rockserver/core/Log4J2LoggerSubstitutions.java index f653040..059bcad 100644 --- a/src/standalone/java/it/cavallium/rockserver/core/logging/Log4J2LoggerSubstitutions.java +++ b/src/native/java/it/cavallium/rockserver/core/Log4J2LoggerSubstitutions.java @@ -1,4 +1,4 @@ -package it.cavallium.rockserver.core.logging; +package it.cavallium.rockserver.core; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; diff --git a/src/main/java/module-info.java b/src/native/java/module-info.java similarity index 100% rename from src/main/java/module-info.java rename to src/native/java/module-info.java