diff --git a/build.gradle b/build.gradle index 34c9265..8d8c283 100644 --- a/build.gradle +++ b/build.gradle @@ -1,248 +1,29 @@ plugins { - id "com.github.spotbugs" version "2.0.1" + id "de.marcphilipp.nexus-publish" version "0.4.0" id "io.codearte.nexus-staging" version "0.21.1" - id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1" } -apply plugin: 'org.xbib.gradle.plugin.asciidoctor' -apply plugin: "io.codearte.nexus-staging" +ext { + user = 'jprante' + name = 'netty-http' + description = 'HTTP client and server for Netty' + inceptionYear = '2012' + url = 'https://github.com/' + user + '/' + name + scmUrl = 'https://github.com/' + user + '/' + name + scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git' + scmDeveloperConnection = 'scm:git:ssh://git@github.com:' + user + '/' + name + '.git' + issueManagementSystem = 'Github' + issueManagementUrl = ext.scmUrl + '/issues' + licenseName = 'The Apache License, Version 2.0' + licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' +} subprojects { - apply plugin: 'java' - apply plugin: "com.github.spotbugs" - - dependencies { - testCompile "org.junit.jupiter:junit-jupiter-api:${project.property('junit.version')}" - testCompile "org.junit.jupiter:junit-jupiter-params:${project.property('junit.version')}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${project.property('junit.version')}" - testCompile "org.junit.vintage:junit-vintage-engine:${project.property('junit.version')}" - testCompile "junit:junit:${project.property('junit4.version')}" - } - - compileJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - compileTestJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:all,-fallthrough" - if (!options.compilerArgs.contains("-processor")) { - options.compilerArgs << '-proc:none' - } - } - - jar { - manifest { - attributes('Implementation-Title': project.name) - attributes('Implementation-Version': project.version) - attributes('Implementation-Vendor': 'Jörg Prante') - } - } - - test { - useJUnitPlatform() - failFast = false - testLogging { - events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED' - showStandardStreams = false - } - afterSuite { desc, result -> - if (!desc.parent) { - println "\nTest result: ${result.resultType}" - println "Test summary: ${result.testCount} tests, " + - "${result.successfulTestCount} succeeded, " + - "${result.failedTestCount} failed, " + - "${result.skippedTestCount} skipped" - } - } - } - - clean { - delete 'out' - } - - asciidoctor { - attributes toc: 'left', - doctype: 'book', - icons: 'font', - encoding: 'utf-8', - sectlink: true, - sectanchors: true, - linkattrs: true, - imagesdir: 'img', - 'source-highlighter': 'coderay' - } - - spotbugs { - toolVersion = '3.1.12' - sourceSets = [sourceSets.main] - ignoreFailures = true - effort = "max" - reportLevel = "high" - // includeFilter = file("config/findbugs/findbugs-include.xml") - // excludeFilter = file("config/findbugs/findbugs-excludes.xml") - } - - tasks.withType(com.github.spotbugs.SpotBugsTask) { - reports.xml.enabled = false - reports.html.enabled = true - } - - /*javadoc { - options.docletpath = configurations.asciidoclet.files.asType(List) - options.doclet = "org.xbib.asciidoclet.Asciidoclet" - options.overview = "src/docs/asciidoclet/overview.adoc" - options.addStringOption "-base-dir", "${projectDir}" - options.addStringOption "-attribute", - "name=${project.name},version=${project.version},title-link=https://github.com/jprante/${project.name}" - configure(options) { - noTimestamp = true - } - }*/ - - task javadocJar(type: Jar, dependsOn: classes) { - from javadoc - into "build/tmp" - archiveClassifier.set('javadoc') - } - - task sourcesJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - into "build/tmp" - archiveClassifier.set('sources') - } - - artifacts { - archives javadocJar, sourcesJar - } - - ext { - user = 'jprante' - name = 'netty-http' - projectDescription = 'HTTP client and server for Netty' - scmUrl = 'https://github.com/jprante/netty-http' - scmConnection = 'scm:git:git://github.com/jprante/netty-http.git' - scmDeveloperConnection = 'scm:git:git://github.com/jprante/netty-http.git' - inceptionDate = '2012' - organizationName = 'xbib' - organizationUrl = 'http://xbib.org' - licenseName = 'The Apache License, Version 2.0' - licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - - /*publishing { - publications { - mavenJava(MavenPublication) { - from components.java - groupId project.group - artifactId project.name - version project.version - artifact sourcesJar - artifact javadocJar - pom { - name = project.name - description = projectDescription - inceptionYear = inceptionDate - url = scmUrl - organization { - name = organizationName - url = organizationUrl - } - scm { - url = scmUrl - connection = scmConnection - developerConnection = scmDeveloperConnection - } - licenses { - license { - name = licenseName - url = licenseUrl - } - } - developers { - developer { - id = user - name = 'Jörg Prante' - email = 'joergprante@gmail.com' - url = 'https://github.com/jprante' - } - } - } - } - } - repositories { - maven { - url "https://oss.sonatype.org/service/local/staging/deploy/maven2" - credentials { - username ossrhUsername - password ossrhPassword - } - } - } - } - - signing { - sign publishing.publications.mavenJava - }*/ - - - task sonaTypeUpload(type: Upload) { - group = 'publish' - configuration = configurations.archives - uploadDescriptor = true - repositories { - if (project.hasProperty('ossrhUsername')) { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - pom.project { - groupId project.group - artifactId project.name - version project.version - name project.name - description description - packaging 'jar' - inceptionYear inceptionDate - url scmUrl - organization { - name organizationName - url organizationUrl - } - developers { - developer { - id user - name 'Jörg Prante' - email 'joergprante@gmail.com' - url 'https://github.com/jprante' - } - } - scm { - url scmUrl - connection scmConnection - developerConnection scmDeveloperConnection - } - licenses { - license { - name licenseName - url licenseUrl - } - } - } - } - } - } - } - nexusStaging { - packageGroup = "org.xbib" - } + apply plugin: 'java-library' + apply from: rootProject.file('gradle/ide/idea.gradle') + apply from: rootProject.file('gradle/compile/java.gradle') + apply from: rootProject.file('gradle/test/junit5.gradle') + apply from: rootProject.file('gradle/publishing/publication.gradle') } + +apply from: rootProject.file('gradle/publishing/sonatype.gradle') diff --git a/gradle.properties b/gradle.properties index 6abee79..9d9bb49 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,34 +1,19 @@ group = org.xbib name = netty-http -version = 4.1.49.0 +version = 4.1.49.1 -# netty +gradle.wrapper.version = 6.4.1 netty.version = 4.1.49.Final tcnative.version = 2.0.29.Final tcnative-legacy-macosx.version = 2.0.26.Final - -# for netty-http-common -xbib-net-url.version = 2.0.3 - -# for netty-http-server +xbib.net.version = 2.0.4 bouncycastle.version = 1.64 - -# for netty-http-server-reactive reactivestreams.version = 1.0.2 - -# for netty-http-server-rest xbib-guice.version = 4.0.4 - -# for rx -reactivex.version = 1.2.10 - -# for test -junit.version = 5.5.2 -junit4.version = 4.12 +reactivex.version = 1.3.8 conscrypt.version = 2.2.1 jackson.version = 2.9.10 -hamcrest.version = 2.1 mockito.version = 3.1.0 - -# doc asciidoclet.version = 1.5.6 +junit.version = 5.6.2 +junit4.version = 4.13 diff --git a/gradle/compile/java.gradle b/gradle/compile/java.gradle new file mode 100644 index 0000000..3b74bfc --- /dev/null +++ b/gradle/compile/java.gradle @@ -0,0 +1,37 @@ + +apply plugin: 'java-library' + +java { + modularity.inferModulePath.set(true) +} + +compileJava { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +compileTestJava { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +jar { + manifest { + attributes('Implementation-Title': project.name) + attributes('Implementation-Version': project.version) + attributes('Implementation-Vendor': 'Jörg Prante') + } +} + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier 'javadoc' +} + +artifacts { + archives sourcesJar, javadocJar +} \ No newline at end of file diff --git a/gradle/documentation/asciidoc.gradle b/gradle/documentation/asciidoc.gradle new file mode 100644 index 0000000..87ba22e --- /dev/null +++ b/gradle/documentation/asciidoc.gradle @@ -0,0 +1,55 @@ +apply plugin: 'org.xbib.gradle.plugin.asciidoctor' + +configurations { + asciidoclet +} + +dependencies { + asciidoclet "org.asciidoctor:asciidoclet:${project.property('asciidoclet.version')}" +} + + +asciidoctor { + backends 'html5' + outputDir = file("${rootProject.projectDir}/docs") + separateOutputDirs = false + attributes 'source-highlighter': 'coderay', + idprefix: '', + idseparator: '-', + toc: 'left', + doctype: 'book', + icons: 'font', + encoding: 'utf-8', + sectlink: true, + sectanchors: true, + linkattrs: true, + imagesdir: 'img', + stylesheet: "${projectDir}/src/docs/asciidoc/css/foundation.css" +} + + +/*javadoc { +options.docletpath = configurations.asciidoclet.files.asType(List) +options.doclet = 'org.asciidoctor.Asciidoclet' +//options.overview = "src/docs/asciidoclet/overview.adoc" +options.addStringOption "-base-dir", "${projectDir}" +options.addStringOption "-attribute", + "name=${project.name},version=${project.version},title-link=https://github.com/xbib/${project.name}" +configure(options) { + noTimestamp = true +} +}*/ + + +/*javadoc { + options.docletpath = configurations.asciidoclet.files.asType(List) + options.doclet = 'org.asciidoctor.Asciidoclet' + options.overview = "${rootProject.projectDir}/src/docs/asciidoclet/overview.adoc" + options.addStringOption "-base-dir", "${projectDir}" + options.addStringOption "-attribute", + "name=${project.name},version=${project.version},title-link=https://github.com/xbib/${project.name}" + options.destinationDirectory(file("${projectDir}/docs/javadoc")) + configure(options) { + noTimestamp = true + } +}*/ diff --git a/gradle/ide/idea.gradle b/gradle/ide/idea.gradle new file mode 100644 index 0000000..64e2167 --- /dev/null +++ b/gradle/ide/idea.gradle @@ -0,0 +1,13 @@ +apply plugin: 'idea' + +idea { + module { + outputDir file('build/classes/java/main') + testOutputDir file('build/classes/java/test') + } +} + +if (project.convention.findPlugin(JavaPluginConvention)) { + //sourceSets.main.output.classesDirs = file("build/classes/java/main") + //sourceSets.test.output.classesDirs = file("build/classes/java/test") +} diff --git a/gradle/publishing/publication.gradle b/gradle/publishing/publication.gradle new file mode 100644 index 0000000..c35fcb9 --- /dev/null +++ b/gradle/publishing/publication.gradle @@ -0,0 +1,64 @@ + +apply plugin: "de.marcphilipp.nexus-publish" + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + pom { + name = project.name + description = rootProject.ext.description + url = rootProject.ext.url + inceptionYear = rootProject.ext.inceptionYear + packaging = 'jar' + organization { + name = 'xbib' + url = 'https://xbib.org' + } + developers { + developer { + id = 'jprante' + name = 'Jörg Prante' + email = 'joergprante@gmail.com' + url = 'https://github.com/jprante' + } + } + 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' + } + } + } + } + } +} + +if (project.hasProperty("signing.keyId")) { + apply plugin: 'signing' + signing { + sign publishing.publications.mavenJava + } +} + +nexusPublishing { + repositories { + sonatype { + username = project.property('ossrhUsername') + password = project.property('ossrhPassword') + packageGroup = "org.xbib" + } + } +} diff --git a/gradle/publishing/sonatype.gradle b/gradle/publishing/sonatype.gradle new file mode 100644 index 0000000..e1813f3 --- /dev/null +++ b/gradle/publishing/sonatype.gradle @@ -0,0 +1,11 @@ + +if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { + + apply plugin: 'io.codearte.nexus-staging' + + nexusStaging { + username = project.property('ossrhUsername') + password = project.property('ossrhPassword') + packageGroup = "org.xbib" + } +} diff --git a/gradle/test/junit5.gradle b/gradle/test/junit5.gradle new file mode 100644 index 0000000..cfef972 --- /dev/null +++ b/gradle/test/junit5.gradle @@ -0,0 +1,27 @@ + +def junitVersion = project.hasProperty('junit.version')?project.property('junit.version'):'5.6.2' +def hamcrestVersion = project.hasProperty('hamcrest.version')?project.property('hamcrest.version'):'2.2' + +dependencies { + testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}" + testImplementation "org.hamcrest:hamcrest-library:${hamcrestVersion}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}" +} + +test { + useJUnitPlatform() + failFast = true + testLogging { + events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED' + } + afterSuite { desc, result -> + if (!desc.parent) { + println "\nTest result: ${result.resultType}" + println "Test summary: ${result.testCount} tests, " + + "${result.successfulTestCount} succeeded, " + + "${result.failedTestCount} failed, " + + "${result.skippedTestCount} skipped" + } + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf..62d4c05 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e65dbed..b42eb3a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ -#Mon Mar 09 11:04:01 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +#Wed May 20 11:53:57 CEST 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acf..fbd7c51 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 24467a1..a9f778a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -81,6 +84,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% diff --git a/netty-http-bouncycastle/build.gradle b/netty-http-bouncycastle/build.gradle index c984729..c9797b3 100644 --- a/netty-http-bouncycastle/build.gradle +++ b/netty-http-bouncycastle/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile project(":netty-http-common") - compile "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" + api project(":netty-http-common") + api "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" } diff --git a/netty-http-client-api/build.gradle b/netty-http-client-api/build.gradle index 34cdeeb..578e8ec 100644 --- a/netty-http-client-api/build.gradle +++ b/netty-http-client-api/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(":netty-http-common") -} \ No newline at end of file + api project(":netty-http-common") +} diff --git a/netty-http-client-api/src/main/java/module-info.java b/netty-http-client-api/src/main/java/module-info.java new file mode 100644 index 0000000..36a7408 --- /dev/null +++ b/netty-http-client-api/src/main/java/module-info.java @@ -0,0 +1,10 @@ +module org.xbib.netty.http.client.api { + exports org.xbib.netty.http.client.api; + requires org.xbib.netty.http.common; + requires org.xbib.net.url; + requires io.netty.transport; + requires io.netty.buffer; + requires io.netty.common; + requires io.netty.codec.http; + requires io.netty.codec.http2; +} diff --git a/netty-http-client-rest/build.gradle b/netty-http-client-rest/build.gradle index e04c2a3..31341a1 100644 --- a/netty-http-client-rest/build.gradle +++ b/netty-http-client-rest/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(':netty-http-client') -} \ No newline at end of file + api project(':netty-http-client') +} diff --git a/netty-http-client-rest/src/main/java/module-info.java b/netty-http-client-rest/src/main/java/module-info.java new file mode 100644 index 0000000..adbb525 --- /dev/null +++ b/netty-http-client-rest/src/main/java/module-info.java @@ -0,0 +1,9 @@ +module org.xbib.netty.http.client.rest { + exports org.xbib.netty.http.client.rest; + requires org.xbib.netty.http.client.api; + requires org.xbib.netty.http.client; + requires org.xbib.netty.http.common; + requires org.xbib.net.url; + requires io.netty.buffer; + requires io.netty.codec.http; +} diff --git a/netty-http-client/build.gradle b/netty-http-client/build.gradle index 204406c..5a38513 100644 --- a/netty-http-client/build.gradle +++ b/netty-http-client/build.gradle @@ -1,16 +1,14 @@ import org.apache.tools.ant.taskdefs.condition.Os dependencies { - compile project(":netty-http-client-api") - compile "io.netty:netty-handler-proxy:${project.property('netty.version')}" - runtime "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" + api project(":netty-http-client-api") + implementation "io.netty:netty-handler-proxy:${project.property('netty.version')}" + testImplementation "com.fasterxml.jackson.core:jackson-databind:${project.property('jackson.version')}" + testImplementation "org.conscrypt:conscrypt-openjdk-uber:${project.property('conscrypt.version')}" + testRuntimeOnly "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" if (Os.isFamily(Os.FAMILY_MAC)) { - runtime "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative-legacy-macosx.version')}" - //runtime project(':netty-http-kqueue') + testRuntimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative-legacy-macosx.version')}" } else if (Os.isFamily(Os.FAMILY_UNIX)) { - runtime "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" - //runtime project(':netty-http-epoll') + testRuntimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" } - testCompile "org.conscrypt:conscrypt-openjdk-uber:${project.property('conscrypt.version')}" - testCompile "com.fasterxml.jackson.core:jackson-databind:${project.property('jackson.version')}" } diff --git a/netty-http-client/src/main/java/module-info.java b/netty-http-client/src/main/java/module-info.java new file mode 100644 index 0000000..f1f7be9 --- /dev/null +++ b/netty-http-client/src/main/java/module-info.java @@ -0,0 +1,23 @@ +module org.xbib.netty.http.client { + exports org.xbib.netty.http.client; + exports org.xbib.netty.http.client.cookie; + exports org.xbib.netty.http.client.handler.http; + exports org.xbib.netty.http.client.handler.http2; + exports org.xbib.netty.http.client.pool; + exports org.xbib.netty.http.client.retry; + exports org.xbib.netty.http.client.transport; + requires org.xbib.netty.http.client.api; + requires org.xbib.netty.http.common; + requires org.xbib.net.url; + requires io.netty.transport; + requires io.netty.buffer; + requires io.netty.common; + requires io.netty.handler; + requires io.netty.handler.proxy; + requires io.netty.codec.http; + requires io.netty.codec.http2; + requires java.logging; + provides org.xbib.netty.http.client.api.ProtocolProvider with + org.xbib.netty.http.client.Http1Provider, + org.xbib.netty.http.client.Http2Provider; +} diff --git a/netty-http-client/src/test/java/org/xbib/netty/http/client/test/cookie/CookieSetterHttpBinTest.java b/netty-http-client/src/test/java/org/xbib/netty/http/client/test/cookie/CookieSetterHttpBinTest.java index b1dc0ef..8c680f0 100644 --- a/netty-http-client/src/test/java/org/xbib/netty/http/client/test/cookie/CookieSetterHttpBinTest.java +++ b/netty-http-client/src/test/java/org/xbib/netty/http/client/test/cookie/CookieSetterHttpBinTest.java @@ -1,6 +1,6 @@ package org.xbib.netty.http.client.test.cookie; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.xbib.netty.http.client.Client; diff --git a/netty-http-client/src/test/java/org/xbib/netty/http/client/test/http1/GoogleTest.java b/netty-http-client/src/test/java/org/xbib/netty/http/client/test/http1/GoogleTest.java index 05ad670..25a940e 100644 --- a/netty-http-client/src/test/java/org/xbib/netty/http/client/test/http1/GoogleTest.java +++ b/netty-http-client/src/test/java/org/xbib/netty/http/client/test/http1/GoogleTest.java @@ -1,7 +1,7 @@ package org.xbib.netty.http.client.test.http1; import io.netty.handler.codec.http.HttpMethod; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.xbib.netty.http.client.Client; diff --git a/netty-http-common/build.gradle b/netty-http-common/build.gradle index e77932d..240e8a6 100644 --- a/netty-http-common/build.gradle +++ b/netty-http-common/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile "org.xbib:net-url:${project.property('xbib-net-url.version')}" - compile "io.netty:netty-codec-http2:${project.property('netty.version')}" + api "org.xbib:net-url:${project.property('xbib.net.version')}" + api "io.netty:netty-codec-http2:${project.property('netty.version')}" } diff --git a/netty-http-common/src/main/java/module-info.java b/netty-http-common/src/main/java/module-info.java new file mode 100644 index 0000000..9974dc4 --- /dev/null +++ b/netty-http-common/src/main/java/module-info.java @@ -0,0 +1,12 @@ +module org.xbib.netty.http.common { + exports org.xbib.netty.http.common; + exports org.xbib.netty.http.common.cookie; + exports org.xbib.netty.http.common.net; + exports org.xbib.netty.http.common.mime; + exports org.xbib.netty.http.common.security; + exports org.xbib.netty.http.common.util; + requires io.netty.transport; + requires io.netty.handler; + requires org.xbib.net.url; + requires java.logging; +} diff --git a/netty-http-epoll/build.gradle b/netty-http-epoll/build.gradle index 5a7aaf1..550ac78 100644 --- a/netty-http-epoll/build.gradle +++ b/netty-http-epoll/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile project(":netty-http-common") - compile "io.netty:netty-transport-native-epoll:${project.property('netty.version')}:linux-x86_64" + api project(":netty-http-common") + implementation "io.netty:netty-transport-native-epoll:${project.property('netty.version')}:linux-x86_64" } diff --git a/netty-http-epoll/src/main/java/module-info.java b/netty-http-epoll/src/main/java/module-info.java new file mode 100644 index 0000000..befd805 --- /dev/null +++ b/netty-http-epoll/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module org.xbib.netty.http.epoll { + exports org.xbib.netty.http.epoll; + requires org.xbib.netty.http.common; + requires io.netty.transport; + requires io.netty.transport.epoll; + provides org.xbib.netty.http.common.TransportProvider with + org.xbib.netty.http.epoll.EpollTransportProvider; +} diff --git a/netty-http-kqueue/build.gradle b/netty-http-kqueue/build.gradle index aa95862..9692ada 100644 --- a/netty-http-kqueue/build.gradle +++ b/netty-http-kqueue/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile project(":netty-http-common") - compile "io.netty:netty-transport-native-kqueue:${project.property('netty.version')}:osx-x86_64" + api project(":netty-http-common") + api "io.netty:netty-transport-native-kqueue:${project.property('netty.version')}:osx-x86_64" } diff --git a/netty-http-kqueue/src/main/java/module-info.java b/netty-http-kqueue/src/main/java/module-info.java new file mode 100644 index 0000000..625f496 --- /dev/null +++ b/netty-http-kqueue/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module org.xbib.netty.http.kqueue { + exports org.xbib.netty.http.kqueue; + requires org.xbib.netty.http.common; + requires io.netty.transport; + requires io.netty.transport.kqueue; + provides org.xbib.netty.http.common.TransportProvider with + org.xbib.netty.http.kqueue.KqueueTransportProvider; +} diff --git a/netty-http-rx/build.gradle b/netty-http-rx/build.gradle index 4da74cb..08d771f 100644 --- a/netty-http-rx/build.gradle +++ b/netty-http-rx/build.gradle @@ -1,7 +1,8 @@ dependencies { - compile "io.netty:netty-codec-http:${project.property('netty.version')}" - compile "io.netty:netty-transport-native-epoll:${project.property('netty.version')}" - compile "io.reactivex:rxjava:${project.property('reactivex.version')}" - testCompile "org.hamcrest:hamcrest-library:${project.property('hamcrest.version')}" - testCompile "org.mockito:mockito-core:${project.property('mockito.version')}" + api "io.reactivex:rxjava:${project.property('reactivex.version')}" + implementation "io.netty:netty-codec-http:${project.property('netty.version')}" + implementation "io.netty:netty-transport-native-epoll:${project.property('netty.version')}" + testImplementation "org.mockito:mockito-core:${project.property('mockito.version')}" + testImplementation "org.junit.vintage:junit-vintage-engine:${project.property('junit.version')}" + testImplementation "junit:junit:${project.property('junit4.version')}" } diff --git a/netty-http-server-api/build.gradle b/netty-http-server-api/build.gradle index 34cdeeb..578e8ec 100644 --- a/netty-http-server-api/build.gradle +++ b/netty-http-server-api/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile project(":netty-http-common") -} \ No newline at end of file + api project(":netty-http-common") +} diff --git a/netty-http-server-api/src/main/java/module-info.java b/netty-http-server-api/src/main/java/module-info.java new file mode 100644 index 0000000..3cdd793 --- /dev/null +++ b/netty-http-server-api/src/main/java/module-info.java @@ -0,0 +1,12 @@ +module org.xbib.netty.http.server.api { + exports org.xbib.netty.http.server.api; + exports org.xbib.netty.http.server.api.annotation; + requires org.xbib.net.url; + requires org.xbib.netty.http.common; + requires io.netty.buffer; + requires io.netty.common; + requires io.netty.handler; + requires io.netty.transport; + requires io.netty.codec.http; + requires io.netty.codec.http2; +} diff --git a/netty-http-server-reactive/build.gradle b/netty-http-server-reactive/build.gradle index 6f5430a..dce05f7 100644 --- a/netty-http-server-reactive/build.gradle +++ b/netty-http-server-reactive/build.gradle @@ -1,7 +1,7 @@ dependencies { - compile project(':netty-http-server') - compile "org.reactivestreams:reactive-streams:${project.property('reactivestreams.version')}" - testCompile("org.reactivestreams:reactive-streams-tck:${project.property('reactivestreams.version')}") { + api "org.reactivestreams:reactive-streams:${project.property('reactivestreams.version')}" + api project(':netty-http-server') + testImplementation("org.reactivestreams:reactive-streams-tck:${project.property('reactivestreams.version')}") { exclude module: 'testng' } } \ No newline at end of file diff --git a/netty-http-server-rest/build.gradle b/netty-http-server-rest/build.gradle index 971f929..31fe05b 100644 --- a/netty-http-server-rest/build.gradle +++ b/netty-http-server-rest/build.gradle @@ -1,4 +1,4 @@ dependencies { - compile project(":netty-http-server") - compile "org.xbib:guice:${project.property('xbib-guice.version')}" + api project(":netty-http-server") + implementation "org.xbib:guice:${project.property('xbib-guice.version')}" } diff --git a/netty-http-server-rest/src/main/java/module-info.java b/netty-http-server-rest/src/main/java/module-info.java new file mode 100644 index 0000000..c9b1810 --- /dev/null +++ b/netty-http-server-rest/src/main/java/module-info.java @@ -0,0 +1,6 @@ +module org.xbib.netty.http.server.rest { + exports org.xbib.netty.http.server.rest; + exports org.xbib.netty.http.server.rest.util; + requires org.xbib.netty.http.server; + requires io.netty.transport; +} diff --git a/netty-http-server/build.gradle b/netty-http-server/build.gradle index f7237a1..d90f9c1 100644 --- a/netty-http-server/build.gradle +++ b/netty-http-server/build.gradle @@ -1,15 +1,13 @@ import org.apache.tools.ant.taskdefs.condition.Os dependencies { - compile project(":netty-http-common") - compile project(":netty-http-server-api") + api project(":netty-http-server-api") + testImplementation project(":netty-http-client") + testImplementation project(":netty-http-bouncycastle") + testRuntimeOnly "org.bouncycastle:bcpkix-jdk15on:${project.property('bouncycastle.version')}" if (Os.isFamily(Os.FAMILY_MAC)) { - testRuntime "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative-legacy-macosx.version')}" - //runtime project(':netty-http-kqueue') + testRuntimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative-legacy-macosx.version')}" } else if (Os.isFamily(Os.FAMILY_UNIX)) { - testRuntime "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" - //testRuntime project(':netty-http-epoll') + testRuntimeOnly "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}" } - testCompile project(":netty-http-client") - testCompile project(":netty-http-bouncycastle") } diff --git a/netty-http-server/src/main/java/module-info.java b/netty-http-server/src/main/java/module-info.java new file mode 100644 index 0000000..6b70833 --- /dev/null +++ b/netty-http-server/src/main/java/module-info.java @@ -0,0 +1,24 @@ +module org.xbib.netty.http.server { + exports org.xbib.netty.http.server; + exports org.xbib.netty.http.server.cookie; + exports org.xbib.netty.http.server.endpoint; + exports org.xbib.netty.http.server.endpoint.service; + exports org.xbib.netty.http.server.handler; + exports org.xbib.netty.http.server.handler.http; + exports org.xbib.netty.http.server.handler.http2; + exports org.xbib.netty.http.server.handler.stream; + exports org.xbib.netty.http.server.transport; + exports org.xbib.netty.http.server.util; + requires org.xbib.netty.http.server.api; + requires org.xbib.netty.http.common; + requires org.xbib.net.url; + requires io.netty.buffer; + requires io.netty.common; + requires io.netty.handler; + requires io.netty.transport; + requires io.netty.codec.http; + requires java.logging; + provides org.xbib.netty.http.server.api.ProtocolProvider with + org.xbib.netty.http.server.Http1Provider, + org.xbib.netty.http.server.Http2Provider; +}