diff --git a/NOTICE.txt b/NOTICE.txt index e754a62..8321e3f 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -24,6 +24,7 @@ The following changes were performed on the original source code: - removed all windows related code - removed all macos related code (including kqueue) - removed all aarch64 related code +- removed the direct brotli4j dependency by rewriting Brotli4jOptions to not use Encoder.Parameters Challenges for Netty build on JDK 21 @@ -33,37 +34,38 @@ Challenges for Netty build on JDK 21 --add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED - finalize() calls in PoolThreadCache, PoolArena are deprecated - when using boringssl static, setting of SSLContent.useTasks to false makes tests hang. Tests using false setting were removed. +- native code jars with module info Subproject organization Original netty subproject names are not related to package names. I reorganized the names to allow better assignment between subproject name, package name, artifact names, and java module. The following reorgnizations were performed: -all -> [todo] -bom -> [todo] -buffer -> netty-buffer -codec -> netty-handler-codec, netty-handler-codec-compression, netty-handler-codec-protobuf -codec-dns -> [todo] -codec-haproxy -> [todo] -codec-http -> netty-handler-codec-http, netty-handler-codec-rtsp, netty-handler-codec-spdy -codec-http2 -> -codec-memcache -> -codec-mqtt -> -codec-redis -> -codec-smtp -> -codec-socks -> -codec->stomp -> -codec-xml -> -common -> netty-util -handler -> netty-handler -handler-proxy -handler-ssl-ocsp -resolver -> netty-resolver -resolver-dns -> -resolver-dns-classes-macos -> [dropped] -resolver-dns-native-macos -> [dropped] -transport -> netty-channel -transport-classes-epoll -> netty-channel-epoll -transport-native-kqueue -> [dropped] -transport-native-unix-common -> netty-channel-unix -transport-native-unix-common-tests -> netty-channel-unix +netty/all -> [todo] +netty/bom -> [todo] +netty/buffer -> netty-buffer +netty/codec -> netty-handler-codec, netty-handler-codec-compression, netty-handler-codec-protobuf +netty/codec-dns -> [todo] +netty/codec-haproxy -> [todo] +netty/codec-http -> netty-handler-codec-http, netty-handler-codec-rtsp, netty-handler-codec-spdy +netty/codec-http2 -> +netty/codec-memcache -> +netty/codec-mqtt -> +netty/codec-redis -> +netty/codec-smtp -> +netty/codec-socks -> +netty/codec->stomp -> +netty/codec-xml -> +netty/common -> netty-util +netty/handler -> netty-handler +netty/handler-proxy +netty/handler-ssl-ocsp +netty/resolver -> netty-resolver +netty/resolver-dns -> +netty/resolver-dns-classes-macos -> [dropped] +netty/resolver-dns-native-macos -> [dropped] +netty/transport -> netty-channel +netty/transport-classes-epoll -> netty-channel-epoll +netty/transport-native-kqueue -> [dropped] +netty/transport-native-unix-common -> netty-channel-unix +netty/transport-native-unix-common-tests -> netty-channel-unix diff --git a/build.gradle b/build.gradle index 37ff8f0..40aee8a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,13 +3,16 @@ plugins { id 'maven-publish' id 'signing' id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1" + id "com.google.osdetector" version "1.7.3" } wrapper { gradleVersion = libs.versions.gradle.get() - distributionType = Wrapper.DistributionType.ALL + distributionType = Wrapper.DistributionType.BIN } +apply plugin: 'com.google.osdetector' + ext { user = 'joerg' name = 'netty' @@ -23,6 +26,8 @@ ext { issueManagementUrl = ext.scmUrl + '/issues' licenseName = 'The Apache License, Version 2.0' licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + organizationName = 'xbib' + organizationUrl = 'https://xbib.org' } subprojects { diff --git a/gradle/test/junit5.gradle b/gradle/test/junit5.gradle index 0469489..656e636 100644 --- a/gradle/test/junit5.gradle +++ b/gradle/test/junit5.gradle @@ -30,7 +30,10 @@ test { '--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED', '-Dio.netty.bootstrap.extensions=serviceload' systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties' + // we have remove native images, this is no longer used systemProperty "nativeImage.handlerMetadataGroupId", "io.netty" + // we have remove native images + // we have remove native images, this is no longer used systemProperty "nativeimage.handlerMetadataArtifactId", "netty-transport" afterSuite { desc, result -> if (!desc.parent) { diff --git a/netty-handler-codec-compression/build.gradle b/netty-handler-codec-compression/build.gradle index f527962..0ca9e29 100644 --- a/netty-handler-codec-compression/build.gradle +++ b/netty-handler-codec-compression/build.gradle @@ -1,3 +1,6 @@ + +apply plugin: 'com.google.osdetector' + dependencies { api project(':netty-handler-codec') implementation project(':netty-bzip2') @@ -6,11 +9,7 @@ dependencies { implementation libs.lz4 implementation libs.lzf implementation libs.zstd + runtimeOnly libs.brotli4j.native."${osdetector.os}"."${osdetector.arch.replace('_','')}" testImplementation testLibs.commons.compress testImplementation testLibs.mockito.core - testRuntimeOnly testLibs.brotli4j.native.linux.x8664 - testRuntimeOnly testLibs.brotli4j.native.linux.aarch64 - testRuntimeOnly testLibs.brotli4j.native.osx.x8664 - testRuntimeOnly testLibs.brotli4j.native.osx.aarch64 - testRuntimeOnly testLibs.brotli4j.native.windows.x8664 } diff --git a/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java b/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java index 652dd8b..86a1254 100644 --- a/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java +++ b/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java @@ -27,12 +27,12 @@ import io.netty.channel.ChannelPromise; import io.netty.handler.codec.MessageToByteEncoder; import io.netty.util.AttributeKey; import io.netty.util.ReferenceCountUtil; -import io.netty.util.internal.ObjectUtil; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.nio.channels.WritableByteChannel; +import java.util.Locale; /** * Compress a {@link ByteBuf} with the Brotli compression. @@ -44,8 +44,10 @@ public final class BrotliEncoder extends MessageToByteEncoder { private static final AttributeKey ATTR = AttributeKey.valueOf("BrotliEncoderWriter"); - private final Encoder.Parameters parameters; + private final BrotliOptions brotliOptions; + private final boolean isSharable; + private Writer writer; /** @@ -53,7 +55,7 @@ public final class BrotliEncoder extends MessageToByteEncoder { * and {@link #isSharable()} set to {@code true} */ public BrotliEncoder() { - this(BrotliOptions.DEFAULT); + this(BrotliOptions.DEFAULT, true); } /** @@ -63,17 +65,7 @@ public final class BrotliEncoder extends MessageToByteEncoder { * {@link #isSharable()} set to {@code true} */ public BrotliEncoder(BrotliOptions brotliOptions) { - this(brotliOptions.parameters()); - } - - /** - * Create a new {@link BrotliEncoder} Instance - * and {@link #isSharable()} set to {@code true} - * - * @param parameters {@link Encoder.Parameters} to use - */ - public BrotliEncoder(Encoder.Parameters parameters) { - this(parameters, true); + this(brotliOptions, true); } /** @@ -89,17 +81,16 @@ public final class BrotliEncoder extends MessageToByteEncoder { * with the appropriate channel. And this will add a overhead. So it is recommended to set {@link #isSharable()} * to {@code false} and create new {@link BrotliEncoder} instance for every pipeline. * - * @param parameters {@link Encoder.Parameters} to use * @param isSharable Set to {@code true} if this instance is shared else set to {@code false} */ - public BrotliEncoder(Encoder.Parameters parameters, boolean isSharable) { - this.parameters = ObjectUtil.checkNotNull(parameters, "Parameters"); + public BrotliEncoder(BrotliOptions brotliOptions, boolean isSharable) { + this.brotliOptions = brotliOptions; this.isSharable = isSharable; } @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { - Writer writer = new Writer(parameters, ctx); + Writer writer = new Writer(brotliOptions, ctx); if (isSharable) { ctx.channel().attr(ATTR).set(writer); } else { @@ -189,7 +180,11 @@ public final class BrotliEncoder extends MessageToByteEncoder { private final ChannelHandlerContext ctx; private boolean isClosed; - private Writer(Encoder.Parameters parameters, ChannelHandlerContext ctx) throws IOException { + private Writer(BrotliOptions brotliOptions, ChannelHandlerContext ctx) throws IOException { + Encoder.Parameters parameters = new Encoder.Parameters() + .setMode(Encoder.Mode.valueOf(brotliOptions.getMode().toUpperCase(Locale.ROOT))) + .setQuality(brotliOptions.getQuality()) + .setWindow(brotliOptions.getWindow()); brotliEncoderChannel = new BrotliEncoderChannel(this, parameters); this.ctx = ctx; } @@ -242,14 +237,11 @@ public final class BrotliEncoder extends MessageToByteEncoder { public void close() { final ChannelPromise promise = ctx.newPromise(); - ctx.executor().execute(new Runnable() { - @Override - public void run() { - try { - finish(promise); - } catch (IOException ex) { - promise.setFailure(new IllegalStateException("Failed to finish encoding", ex)); - } + ctx.executor().execute(() -> { + try { + finish(promise); + } catch (IOException ex) { + promise.setFailure(new IllegalStateException("Failed to finish encoding", ex)); } }); } diff --git a/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliOptions.java b/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliOptions.java index 737f5d1..e342f6c 100644 --- a/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliOptions.java +++ b/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliOptions.java @@ -15,33 +15,43 @@ */ package io.netty.handler.codec.compression; -import com.aayushatharva.brotli4j.encoder.Encoder; -import io.netty.util.internal.ObjectUtil; +import java.util.Objects; /** - * {@link BrotliOptions} holds {@link Encoder.Parameters} for + * {@link BrotliOptions} holds configuration options for * Brotli compression. */ public final class BrotliOptions implements CompressionOptions { - private final Encoder.Parameters parameters; + private final String mode; + + private final int quality; + + private final int window; /** * @see StandardCompressionOptions#brotli() */ - static final BrotliOptions DEFAULT = new BrotliOptions( - new Encoder.Parameters().setQuality(4).setMode(Encoder.Mode.TEXT) - ); + static final BrotliOptions DEFAULT = new BrotliOptions("text", 4, -1); - BrotliOptions(Encoder.Parameters parameters) { + BrotliOptions(String mode, int quality, int window) { if (!Brotli.isAvailable()) { throw new IllegalStateException("Brotli is not available", Brotli.cause()); } - - this.parameters = ObjectUtil.checkNotNull(parameters, "Parameters"); + this.mode = Objects.requireNonNull(mode); + this.quality = quality; + this.window = window; } - public Encoder.Parameters parameters() { - return parameters; + public String getMode() { + return mode; + } + + public int getQuality() { + return quality; + } + + public int getWindow() { + return window; } } diff --git a/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java b/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java index ac25824..92d4a4b 100644 --- a/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java +++ b/netty-handler-codec-compression/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java @@ -30,6 +30,7 @@ public final class StandardCompressionOptions { /** * Default implementation of {@link BrotliOptions} with {@link Encoder.Parameters#setQuality(int)} set to 4 * and {@link Encoder.Parameters#setMode(Encoder.Mode)} set to {@link Encoder.Mode#TEXT} + * and {@link Encoder.Parameters#setWindow(int)}} set to -1 */ public static BrotliOptions brotli() { return BrotliOptions.DEFAULT; @@ -38,11 +39,10 @@ public final class StandardCompressionOptions { /** * Create a new {@link BrotliOptions} * - * @param parameters {@link Encoder.Parameters} Instance * @throws NullPointerException If {@link Encoder.Parameters} is {@code null} */ - public static BrotliOptions brotli(Encoder.Parameters parameters) { - return new BrotliOptions(parameters); + public static BrotliOptions brotli(String mode, int quality, int window) { + return new BrotliOptions(mode, quality, window); } /** diff --git a/netty-handler-codec-http/build.gradle b/netty-handler-codec-http/build.gradle index ba6ee81..9a111d7 100644 --- a/netty-handler-codec-http/build.gradle +++ b/netty-handler-codec-http/build.gradle @@ -3,12 +3,8 @@ dependencies { api project(':netty-handler-ssl') api project(':netty-handler-codec-compression') implementation project(':netty-zlib') - implementation libs.brotli4j // accessing com.aayushatharva.brotli4j.encoder.Encoder + testImplementation libs.brotli4j testImplementation testLibs.assertj testImplementation testLibs.mockito.core - testRuntimeOnly testLibs.brotli4j.native.linux.x8664 - testRuntimeOnly testLibs.brotli4j.native.linux.aarch64 - testRuntimeOnly testLibs.brotli4j.native.osx.x8664 - testRuntimeOnly testLibs.brotli4j.native.osx.aarch64 - testRuntimeOnly testLibs.brotli4j.native.windows.x8664 + testRuntimeOnly libs.brotli4j.native."${osdetector.os}"."${osdetector.arch.replace('_','')}" } diff --git a/netty-handler-codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java b/netty-handler-codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java index bf8396a..f6bcf95 100644 --- a/netty-handler-codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java +++ b/netty-handler-codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java @@ -444,7 +444,7 @@ public class HttpContentCompressor extends HttpContentEncoder { @Override public MessageToByteEncoder createEncoder() { - return new BrotliEncoder(brotliOptions.parameters()); + return new BrotliEncoder(brotliOptions); } } diff --git a/netty-handler-codec-http/src/main/java/module-info.java b/netty-handler-codec-http/src/main/java/module-info.java index c5fb298..9531566 100644 --- a/netty-handler-codec-http/src/main/java/module-info.java +++ b/netty-handler-codec-http/src/main/java/module-info.java @@ -13,6 +13,5 @@ module org.xbib.io.netty.handler.codec.http { requires org.xbib.io.netty.handler.ssl; requires org.xbib.io.netty.util; requires org.xbib.io.netty.zlib; - requires com.aayushatharva.brotli4j; - + //requires com.aayushatharva.brotli4j; } diff --git a/netty-handler-codec-http2/build.gradle b/netty-handler-codec-http2/build.gradle index c09f846..6651465 100644 --- a/netty-handler-codec-http2/build.gradle +++ b/netty-handler-codec-http2/build.gradle @@ -1,15 +1,8 @@ dependencies { api project(':netty-handler-codec-http') - implementation libs.brotli4j // accessing com.aayushatharva.brotli4j.encoder.Encoder testImplementation testLibs.gson testImplementation testLibs.assertj testImplementation testLibs.mockito.core - testRuntimeOnly(variantOf(testLibs.netty.tcnative.boringssl.static) { - classifier('linux-x86_64') - }) - testRuntimeOnly testLibs.brotli4j.native.linux.x8664 - testRuntimeOnly testLibs.brotli4j.native.linux.aarch64 - testRuntimeOnly testLibs.brotli4j.native.osx.x8664 - testRuntimeOnly testLibs.brotli4j.native.osx.aarch64 - testRuntimeOnly testLibs.brotli4j.native.windows.x8664 + testRuntimeOnly project(path: ':netty-tcnative-boringssl-static', configuration: osdetector.classifier) + testRuntimeOnly libs.brotli4j.native."${osdetector.os}"."${osdetector.arch.replace('_','')}" } diff --git a/netty-handler-codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java b/netty-handler-codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java index 262c8ad..e566e2f 100644 --- a/netty-handler-codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java +++ b/netty-handler-codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java @@ -87,10 +87,14 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE StandardCompressionOptions.brotli(), StandardCompressionOptions.snappy(), StandardCompressionOptions.gzip(), - StandardCompressionOptions.deflate() }; + StandardCompressionOptions.deflate() + }; } - return new CompressionOptions[] { StandardCompressionOptions.snappy(), - StandardCompressionOptions.gzip(), StandardCompressionOptions.deflate() }; + return new CompressionOptions[] { + StandardCompressionOptions.snappy(), + StandardCompressionOptions.gzip(), + StandardCompressionOptions.deflate() + }; } /** @@ -284,7 +288,7 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE } if (Brotli.isAvailable() && brotliOptions != null && BR.contentEqualsIgnoreCase(contentEncoding)) { return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(), - ctx.channel().config(), new BrotliEncoder(brotliOptions.parameters())); + ctx.channel().config(), new BrotliEncoder(brotliOptions)); } if (zstdOptions != null && ZSTD.contentEqualsIgnoreCase(contentEncoding)) { return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(), diff --git a/netty-handler-codec-http2/src/main/java/module-info.java b/netty-handler-codec-http2/src/main/java/module-info.java index 9a9a809..7008eea 100644 --- a/netty-handler-codec-http2/src/main/java/module-info.java +++ b/netty-handler-codec-http2/src/main/java/module-info.java @@ -8,5 +8,4 @@ module org.xbib.io.netty.handler.codec.httptwo { requires org.xbib.io.netty.handler.codec.http; requires org.xbib.io.netty.handler.ssl; requires org.xbib.io.netty.util; - requires com.aayushatharva.brotli4j; } diff --git a/netty-handler-codec-quic-native/build.gradle b/netty-handler-codec-quic-native/build.gradle new file mode 100644 index 0000000..19542b9 --- /dev/null +++ b/netty-handler-codec-quic-native/build.gradle @@ -0,0 +1,70 @@ + +task nettyQuicLinuxX8664(type: Jar) { + archiveBaseName.set('netty-handler-codec-quic-native') + archiveClassifier.set('linux-x86_64') + version rootProject.version + from (sourceSets.main.output) { + include 'META-INF/native/libnetty_quiche_linux_x86_64.so' + } +} +assemble.dependsOn(nettyQuicLinuxX8664) + +configurations { + 'linux-x86_64' { + canBeConsumed = true + canBeResolved = false + extendsFrom runtimeOnly + } +} + +artifacts { + 'linux-x86_64'(nettyQuicLinuxX8664) +} + +publishing { + publications { + publishNettyQuicLinuxX8664(MavenPublication) { + groupId rootProject.group + artifactId project.name + version rootProject.version + artifact nettyQuicLinuxX8664 + pom { + artifactId = project.name + name = project.name + version = project.version + description = rootProject.ext.description + url = rootProject.ext.url + inceptionYear = rootProject.ext.inceptionYear + packaging = 'jar' + organization { + name = rootProject.ext.organizationName + url = rootProject.ext.organizationUrl + } + developers { + developer { + id = 'jprante' + name = 'Jörg Prante' + email = 'joergprante@gmail.com' + url = 'https://xbib.org/joerg' + } + } + scm { + url = rootProject.ext.scmUrl + connection = rootProject.ext.scmConnection + developerConnection = rootProject.ext.scmDeveloperConnection + } + issueManagement { + system = rootProject.ext.issueManagementSystem + url = rootProject.ext.issueManagementUrl + } + licenses { + license { + name = rootProject.ext.licenseName + url = rootProject.ext.licenseUrl + distribution = 'repo' + } + } + } + } + } +} \ No newline at end of file diff --git a/netty-handler-codec-quic/src/main/resources/META-INF/native/libnetty_quiche_linux_x86_64.so b/netty-handler-codec-quic-native/src/main/resources/META-INF/native/libnetty_quiche_linux_x86_64.so similarity index 100% rename from netty-handler-codec-quic/src/main/resources/META-INF/native/libnetty_quiche_linux_x86_64.so rename to netty-handler-codec-quic-native/src/main/resources/META-INF/native/libnetty_quiche_linux_x86_64.so diff --git a/netty-handler-codec-quic/build.gradle b/netty-handler-codec-quic/build.gradle index 8e88e18..6f206b4 100644 --- a/netty-handler-codec-quic/build.gradle +++ b/netty-handler-codec-quic/build.gradle @@ -2,4 +2,5 @@ dependencies { api project(':netty-handler-ssl') implementation project(':netty-channel-epoll') implementation project(':netty-channel-unix') + runtimeOnly project(path: ':netty-handler-codec-quic-native', configuration: osdetector.classifier) } diff --git a/netty-handler-ssl/build.gradle b/netty-handler-ssl/build.gradle index 9f6a9ca..33c579b 100644 --- a/netty-handler-ssl/build.gradle +++ b/netty-handler-ssl/build.gradle @@ -1,3 +1,6 @@ + +apply plugin: 'com.google.osdetector' + dependencies { api project(':netty-handler-codec') api project(':netty-internal-tcnative') @@ -9,10 +12,8 @@ dependencies { testImplementation project(':netty-handler') testImplementation (testLibs.amazonCorrettoCrypt) { artifact { - classifier = 'linux-x86_64' + classifier = osdetector.classifier } } - testRuntimeOnly(variantOf(testLibs.netty.tcnative.boringssl.static) { - classifier('linux-x86_64') - }) + testRuntimeOnly project(path: ':netty-tcnative-boringssl-static', configuration: osdetector.classifier) } diff --git a/netty-tcnative-boringssl-static/build.gradle b/netty-tcnative-boringssl-static/build.gradle new file mode 100644 index 0000000..e3b82da --- /dev/null +++ b/netty-tcnative-boringssl-static/build.gradle @@ -0,0 +1,158 @@ + +task nettyTcNativeBoringSslStaticLinuxX8664(type: Jar) { + archiveBaseName.set('netty-tcnative-boringssl-static') + archiveClassifier.set('linux-x86_64') + version rootProject.version + from (sourceSets.main.output) { + include 'META-INF/native/libnetty_tcnative_linux_x86_64.so' + } +} +assemble.dependsOn(nettyTcNativeBoringSslStaticLinuxX8664) + +task nettyTcNativeBoringSslStaticLinuxAarch64(type: Jar) { + archiveBaseName.set('netty-tcnative-boringssl-static') + archiveClassifier.set('linux-aarch_64') + version rootProject.version + from (sourceSets.main.output) { + include 'META-INF/native/libnetty_tcnative_linux_aarch_64.so' + } +} +assemble.dependsOn(nettyTcNativeBoringSslStaticLinuxAarch64) + +task nettyTcNativeBoringSslStaticOsxX8664(type: Jar) { + archiveBaseName.set('netty-tcnative-boringssl-static') + archiveClassifier.set('osx-x86_64') + version rootProject.version + from (sourceSets.main.output) { + include 'META-INF/native/libnetty_tcnative_osx_x86_64.jnilib' + } +} +assemble.dependsOn(nettyTcNativeBoringSslStaticOsxX8664) + +task nettyTcNativeBoringSslStaticOsxAarch64(type: Jar) { + archiveBaseName.set('netty-tcnative-boringssl-static') + archiveClassifier.set('osx-aarch_64') + version rootProject.version + from (sourceSets.main.output) { + include 'META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib' + } +} +assemble.dependsOn(nettyTcNativeBoringSslStaticOsxAarch64) + +task nettyTcNativeBoringSslStaticWindowsX8664(type: Jar) { + archiveBaseName.set('netty-tcnative-boringssl-static') + archiveClassifier.set('windows-x86_64') + version rootProject.version + from (sourceSets.main.output) { + include 'META-INF/native/libnetty_tcnative_windows_x86_64.dll' + } +} +assemble.dependsOn(nettyTcNativeBoringSslStaticWindowsX8664) + +configurations { + 'linux-x86_64' { + canBeConsumed = true + canBeResolved = false + extendsFrom runtimeOnly + } + 'linux-aarch64' { + canBeConsumed = true + canBeResolved = false + extendsFrom runtimeOnly + } + 'osx-x86_64' { + canBeConsumed = true + canBeResolved = false + extendsFrom runtimeOnly + } + 'osx-aarch64' { + canBeConsumed = true + canBeResolved = false + extendsFrom runtimeOnly + } + 'windows-x86_64' { + canBeConsumed = true + canBeResolved = false + extendsFrom runtimeOnly + } +} + +artifacts { + 'linux-x86_64'(nettyTcNativeBoringSslStaticLinuxX8664) + 'linux-aarch64'(nettyTcNativeBoringSslStaticLinuxAarch64) + 'osx-x86_64'(nettyTcNativeBoringSslStaticOsxX8664) + 'osx-aarch64'(nettyTcNativeBoringSslStaticOsxAarch64) + 'windows-x86_64'(nettyTcNativeBoringSslStaticWindowsX8664) +} + +publishing { + publications { + publishNettyTcNaticeBoringSslStaticLinuxX8664(MavenPublication) { + groupId rootProject.group + artifactId project.name + version rootProject.version + artifact nettyTcNativeBoringSslStaticLinuxX8664 + pom { + artifactId = project.name + name = project.name + version = project.version + description = rootProject.ext.description + url = rootProject.ext.url + inceptionYear = rootProject.ext.inceptionYear + packaging = 'jar' + organization { + name = rootProject.ext.organizationName + url = rootProject.ext.organizationUrl + } + developers { + developer { + id = 'jprante' + name = 'Jörg Prante' + email = 'joergprante@gmail.com' + url = 'https://xbib.org/joerg' + } + } + scm { + url = rootProject.ext.scmUrl + connection = rootProject.ext.scmConnection + developerConnection = rootProject.ext.scmDeveloperConnection + } + issueManagement { + system = rootProject.ext.issueManagementSystem + url = rootProject.ext.issueManagementUrl + } + licenses { + license { + name = rootProject.ext.licenseName + url = rootProject.ext.licenseUrl + distribution = 'repo' + } + } + } + } + publishNettyTcNativeBoringSslStaticLinuxAarch64(MavenPublication) { + groupId rootProject.group + artifactId project.name + version rootProject.version + artifact nettyTcNativeBoringSslStaticLinuxAarch64 + } + publishNettyTcNaticeBoringSslStaticOsxX8664(MavenPublication) { + groupId rootProject.group + artifactId project.name + version rootProject.version + artifact nettyTcNativeBoringSslStaticOsxX8664 + } + publishNettyTcNativeBoringSslStaticOsxAarch64(MavenPublication) { + groupId rootProject.group + artifactId project.name + version rootProject.version + artifact nettyTcNativeBoringSslStaticOsxAarch64 + } + publishNettyTcNaticeBoringSslStaticWindowsX8664(MavenPublication) { + groupId rootProject.group + artifactId project.name + version rootProject.version + artifact nettyTcNativeBoringSslStaticWindowsX8664 + } + } +} diff --git a/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_linux_aarch_64.so b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_linux_aarch_64.so new file mode 100644 index 0000000..2349b27 Binary files /dev/null and b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_linux_aarch_64.so differ diff --git a/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_linux_x86_64.so b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_linux_x86_64.so new file mode 100644 index 0000000..e79772b Binary files /dev/null and b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_linux_x86_64.so differ diff --git a/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib new file mode 100644 index 0000000..73e6f3d Binary files /dev/null and b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib differ diff --git a/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib new file mode 100644 index 0000000..7c1b374 Binary files /dev/null and b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib differ diff --git a/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/netty_tcnative_windows_x86_64.dll b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/netty_tcnative_windows_x86_64.dll new file mode 100644 index 0000000..a9d606d Binary files /dev/null and b/netty-tcnative-boringssl-static/src/main/resources/META-INF/native/netty_tcnative_windows_x86_64.dll differ diff --git a/settings.gradle b/settings.gradle index 4aac97e..f1d74d8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -24,10 +24,15 @@ dependencyResolutionManagement { library('lzf', 'com.ning', 'compress-lzf').version('1.1.2') library('zstd', 'com.github.luben', 'zstd-jni').version('1.5.5-11') library('protobuf', 'com.google.protobuf', 'protobuf-java').version('4.0.0-rc-2') + library('brotli4j-native-linux-x8664', 'com.aayushatharva.brotli4j', 'native-linux-x86_64').versionRef('brotli4j') + library('brotli4j-native-linux-aarch64', 'com.aayushatharva.brotli4j', 'native-linux-aarch64').versionRef('brotli4j') + library('brotli4j-native-linux-riscv64', 'com.aayushatharva.brotli4j', 'native-linux-riscv64').versionRef('brotli4j') + library('brotli4j-native-osx-x8664', 'com.aayushatharva.brotli4j', 'native-osx-x86_64').versionRef('brotli4j') + library('brotli4j-native-osx-aarch64', 'com.aayushatharva.brotli4j', 'native-osx-aarch64').versionRef('brotli4j') + library('brotli4j-native-windows-x8664', 'com.aayushatharva.brotli4j', 'native-windows-x86_64').versionRef('brotli4j') } testLibs { version('junit', '5.10.1') - version('brotli4j', '1.15.0') library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit') library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit') library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit') @@ -45,13 +50,6 @@ dependencyResolutionManagement { library('reflections', 'org.reflections', 'reflections').version('0.10.2') library('amazonCorrettoCrypt', 'software.amazon.cryptools', 'AmazonCorrettoCryptoProvider').version('2.3.2') library('commons-compress', 'org.apache.commons', 'commons-compress').version('1.25.0') - library('brotli4j-native-linux-x8664', 'com.aayushatharva.brotli4j', 'native-linux-x86_64').versionRef('brotli4j') - library('brotli4j-native-linux-aarch64', 'com.aayushatharva.brotli4j', 'native-linux-aarch64').versionRef('brotli4j') - library('brotli4j-native-linux-riscv64', 'com.aayushatharva.brotli4j', 'native-linux-riscv64').versionRef('brotli4j') - library('brotli4j-native-osx-x8664', 'com.aayushatharva.brotli4j', 'native-osx-x86_64').versionRef('brotli4j') - library('brotli4j-native-osx-aarch64', 'com.aayushatharva.brotli4j', 'native-osx-aarch64').versionRef('brotli4j') - library('brotli4j-native-windows-x8664', 'com.aayushatharva.brotli4j', 'native-windows-x86_64').versionRef('brotli4j') - library('netty.tcnative.boringssl.static', 'io.netty', 'netty-tcnative-boringssl-static').version('2.0.62.Final') } } } @@ -69,11 +67,13 @@ include 'netty-handler-codec-http2' include 'netty-handler-codec-http3' include 'netty-handler-codec-protobuf' include 'netty-handler-codec-quic' +include 'netty-handler-codec-quic-native' include 'netty-handler-codec-rtsp' include 'netty-handler-codec-spdy' include 'netty-handler-ssl' include 'netty-internal-tcnative' include 'netty-jctools' include 'netty-resolver' +include 'netty-tcnative-boringssl-static' include 'netty-util' include 'netty-zlib'