diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 73b01f8c93..6c02158164 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -106,4 +106,4 @@ jobs: os: ${{ matrix.os }} ref: develop check_directory: core/build - tasks: publishToMavenLocal -x test -x apiDump + tasks: publishToMavenLocal -x test diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6ab20f6a29..6770200c7c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -29,4 +29,4 @@ jobs: uses: hexagonkt/.github/.github/workflows/graalvm_gradle.yml@master with: check_directory: core/build - tasks: publishToMavenLocal -x test -x apiDump + tasks: publishToMavenLocal -x test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b3335a6b9..33eea7b359 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: git remote set-url origin "$REMOTE" git clone "$REMOTE" --branch gh-pages build/gh-pages ./gradlew --info build - ./gradlew --info -x build -x apiDump buildSite + ./gradlew --info -x build buildSite ls -AlF site/build/site - name: Publish Packages @@ -50,7 +50,7 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - run: ./gradlew --info --no-daemon -x test -x apiDump release + run: ./gradlew --info --no-daemon -x test release - name: Publish Site run: | diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 4b32007121..79a5fc257c 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -58,7 +58,7 @@ jobs: run: ./gradlew --info --stacktrace build - name: Build Site - run: ./gradlew --info --stacktrace -x build buildSite -x apiDump + run: ./gradlew --info --stacktrace -x build buildSite - name: Check Build if: ${{ inputs.check_directory != '' }} diff --git a/build.gradle.kts b/build.gradle.kts index e35055e8ff..1d2941291b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,7 @@ plugins { id("eclipse") id("project-report") id("org.jetbrains.dokka") version("1.8.20") - id("com.github.jk1.dependency-license-report") version("2.4") + id("com.github.jk1.dependency-license-report") version("2.5") id("org.jetbrains.kotlinx.binary-compatibility-validator") version("0.13.2") id("org.graalvm.buildtools.native") version("0.9.23") apply(false) id("io.gitlab.arturbosch.detekt") version("1.23.0") apply(false) diff --git a/core/api/core.api b/core/api/core.api index 09c5db896a..8d0e8fb383 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -135,11 +135,12 @@ public final class com/hexagonkt/core/Jvm { public static final field INSTANCE Lcom/hexagonkt/core/Jvm; public final fun getCharset ()Ljava/nio/charset/Charset; public final fun getCpuCount ()I - public final fun getHostname ()Ljava/lang/String; + public final fun getHostName ()Ljava/lang/String; public final fun getIp ()Ljava/lang/String; public final fun getLocale ()Ljava/util/Locale; public final fun getLocaleCode ()Ljava/lang/String; public final fun getName ()Ljava/lang/String; + public final fun getRuntime ()Ljava/lang/Runtime; public final fun getTimeZone ()Ljava/util/TimeZone; public final fun getVersion ()Ljava/lang/String; public final fun getZoneId ()Ljava/time/ZoneId; diff --git a/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandlerProvider.kt b/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandlerProvider.kt index f2156db386..dc62a419b7 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandlerProvider.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandlerProvider.kt @@ -3,9 +3,6 @@ package com.hexagonkt.core import java.net.URLStreamHandler import java.net.spi.URLStreamHandlerProvider -/** - * JDK 11 only - */ internal class ClasspathHandlerProvider : URLStreamHandlerProvider() { override fun createURLStreamHandler(protocol: String): URLStreamHandler? { diff --git a/core/src/main/kotlin/com/hexagonkt/core/Jvm.kt b/core/src/main/kotlin/com/hexagonkt/core/Jvm.kt index bc83977e9d..1ddb6c1e98 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/Jvm.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/Jvm.kt @@ -11,7 +11,8 @@ import kotlin.reflect.KClass * Object with utilities to gather information about the running JVM. */ object Jvm { - private val runtime: Runtime by lazy { Runtime.getRuntime() } + /** Current JVM runtime. */ + val runtime: Runtime by lazy { Runtime.getRuntime() } /** Default timezone. */ val timeZone: TimeZone by lazy { TimeZone.getDefault() } @@ -25,8 +26,8 @@ object Jvm { /** Default locale for this instance of the Java Virtual Machine. */ val locale: Locale by lazy { Locale.getDefault() } - /** The hostname of the machine running this program. */ - val hostname: String by lazy { InetAddress.getLocalHost().hostName } + /** The host name of the machine running this program. */ + val hostName: String by lazy { InetAddress.getLocalHost().hostName } /** The IP address of the machine running this program. */ val ip: String by lazy { InetAddress.getLocalHost().hostAddress } diff --git a/core/src/test/kotlin/com/hexagonkt/core/JvmTest.kt b/core/src/test/kotlin/com/hexagonkt/core/JvmTest.kt index b344309a41..538f143dc9 100644 --- a/core/src/test/kotlin/com/hexagonkt/core/JvmTest.kt +++ b/core/src/test/kotlin/com/hexagonkt/core/JvmTest.kt @@ -35,8 +35,8 @@ internal class JvmTest { val ipv4Regex = Regex("\\d{1,3}(\\.\\d{1,3}){3}") assert(Jvm.ip.matches(ipv4Regex) || Jvm.ip.matches(ipv6Regex)) - assert(Jvm.hostname.isNotBlank()) - assert(Inet4Address.getAllByName(Jvm.hostname).isNotEmpty()) + assert(Jvm.hostName.isNotBlank()) + assert(Inet4Address.getAllByName(Jvm.hostName).isNotEmpty()) assert(Inet4Address.getAllByName(Jvm.ip).isNotEmpty()) } diff --git a/gradle.properties b/gradle.properties index bf73018b06..6b7823b7c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.warning.mode=all org.gradle.console=plain # Gradle -version=3.0.0-B5 +version=3.0.0-B6 group=com.hexagonkt description=The atoms of your platform @@ -51,7 +51,7 @@ jettyVersion=11.0.15 # rest_tools vertxVersion=4.4.4 -swaggerParserVersion=2.1.15 +swaggerParserVersion=2.1.16 # logging slf4jVersion=2.0.7 diff --git a/gradle/dokka.gradle b/gradle/dokka.gradle index 3f32fe943f..9af54c5e98 100644 --- a/gradle/dokka.gradle +++ b/gradle/dokka.gradle @@ -33,9 +33,7 @@ private void setUpDokka(final Object dokkaTask) { "compileKotlin", "compileTestKotlin", "processResources", - "processTestResources", - "apiCheck", - "apiDump" + "processTestResources" ) dokkaTask.moduleName.set(project.name) diff --git a/http/http_client/README.md b/http/http_client/README.md index 4b77d73cd3..e5a9614dce 100644 --- a/http/http_client/README.md +++ b/http/http_client/README.md @@ -63,7 +63,7 @@ Check the details in the following code fragment: You can also check the [full test] for more details. -[full test]: https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt +[full test]: https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt # Multipart (forms and files) Using the HTTP client you can send MIME multipart parts to the server. You can use it to post forms diff --git a/http/http_server/src/main/kotlin/com/hexagonkt/http/server/HttpServer.kt b/http/http_server/src/main/kotlin/com/hexagonkt/http/server/HttpServer.kt index 335662973e..cb4b48fe92 100644 --- a/http/http_server/src/main/kotlin/com/hexagonkt/http/server/HttpServer.kt +++ b/http/http_server/src/main/kotlin/com/hexagonkt/http/server/HttpServer.kt @@ -3,7 +3,7 @@ package com.hexagonkt.http.server import com.hexagonkt.core.logging.Logger import com.hexagonkt.core.Jvm.charset import com.hexagonkt.core.Jvm.cpuCount -import com.hexagonkt.core.Jvm.hostname +import com.hexagonkt.core.Jvm.hostName import com.hexagonkt.core.Jvm.name import com.hexagonkt.core.Jvm.version import com.hexagonkt.core.Jvm.localeCode @@ -159,7 +159,7 @@ data class HttpServer( .map { (k, v) -> "$k($v)" } .joinToString("$RESET, $CYAN", CYAN, RESET) - val hostnameValue = "$BLUE$hostname$RESET" + val hostnameValue = "$BLUE$hostName$RESET" val cpuCountValue = "$BLUE$cpuCount$RESET" val javaVersionValue = "$BOLD${BLUE}Java $version$RESET [$BLUE$name$RESET]" diff --git a/http/http_server_async/src/main/kotlin/com/hexagonkt/http/server/async/HttpServer.kt b/http/http_server_async/src/main/kotlin/com/hexagonkt/http/server/async/HttpServer.kt index d01f489921..70e7a8bad3 100644 --- a/http/http_server_async/src/main/kotlin/com/hexagonkt/http/server/async/HttpServer.kt +++ b/http/http_server_async/src/main/kotlin/com/hexagonkt/http/server/async/HttpServer.kt @@ -3,7 +3,6 @@ package com.hexagonkt.http.server.async import com.hexagonkt.core.logging.Logger import com.hexagonkt.core.Jvm.charset import com.hexagonkt.core.Jvm.cpuCount -import com.hexagonkt.core.Jvm.hostname import com.hexagonkt.core.Jvm.ip import com.hexagonkt.core.Jvm.name import com.hexagonkt.core.Jvm.version @@ -19,6 +18,7 @@ import com.hexagonkt.core.Ansi.DEFAULT import com.hexagonkt.core.Ansi.MAGENTA import com.hexagonkt.core.Ansi.RESET import com.hexagonkt.core.Ansi.UNDERLINE +import com.hexagonkt.core.Jvm import com.hexagonkt.core.Jvm.timeZone import com.hexagonkt.core.Jvm.totalMemory import com.hexagonkt.core.Jvm.usedMemory @@ -166,7 +166,7 @@ data class HttpServer( .map { (k, v) -> "$k($v)" } .joinToString("$RESET, $CYAN", CYAN, RESET) - val hostnameValue = "$BLUE$hostname$RESET" + val hostnameValue = "$BLUE${Jvm.hostName}$RESET" val cpuCountValue = "$BLUE$cpuCount$RESET" val javaVersionValue = "$BOLD${BLUE}Java $version$RESET [$BLUE$name$RESET]" diff --git a/http/http_server_servlet/src/main/kotlin/com/hexagonkt/http/server/servlet/ServletServer.kt b/http/http_server_servlet/src/main/kotlin/com/hexagonkt/http/server/servlet/ServletServer.kt index 2453a4db8a..c08316d251 100644 --- a/http/http_server_servlet/src/main/kotlin/com/hexagonkt/http/server/servlet/ServletServer.kt +++ b/http/http_server_servlet/src/main/kotlin/com/hexagonkt/http/server/servlet/ServletServer.kt @@ -74,7 +74,7 @@ abstract class ServletServer( val serverAdapterValue = "$BOLD$CYAN${javaClass.simpleName}$RESET" - val hostnameValue = "$BLUE${Jvm.hostname}$RESET" + val hostnameValue = "$BLUE${Jvm.hostName}$RESET" val cpuCountValue = "$BLUE${Jvm.cpuCount}$RESET" val jvmMemoryValue = "$BLUE$jvmMemory$RESET" diff --git a/site/pages/examples/http_client_examples.md b/site/pages/examples/http_client_examples.md index e6606de688..b6726274c3 100644 --- a/site/pages/examples/http_client_examples.md +++ b/site/pages/examples/http_client_examples.md @@ -1,7 +1,7 @@ # HTTP Client Creation Example This example shows how to create HTTP Client instances. Check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ClientTest.kt) +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ClientTest.kt) for more information. ## Without setting parameters @@ -12,7 +12,7 @@ for more information. # Send Requests Example This example shows send HTTP requests to a server. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ClientTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ClientTest.kt). ## Generic request @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ClientTest.kt?genericRequest @@ -27,12 +27,12 @@ This example shows send HTTP requests to a server. Here you can check the @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ClientTest.kt?bodyAndContentTypeRequests # Use Cookies Example -Check the details at the [full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt). +Check the details at the [full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt?clientCookies # Multipart Requests Example -Refer to the [full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FilesTest.kt) +Refer to the [full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FilesTest.kt) for more details. ## Send form fields @@ -43,7 +43,7 @@ for more details. # Mutual TLS Example This example shows how make requests using mutual TLS between the client and the server. You can -check the [full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/HttpsTest.kt) +check the [full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/HttpsTest.kt) for more details. @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/HttpsTest.kt?https diff --git a/site/pages/examples/http_server_examples.md b/site/pages/examples/http_server_examples.md index 7eedda0656..72765e66db 100644 --- a/site/pages/examples/http_server_examples.md +++ b/site/pages/examples/http_server_examples.md @@ -1,42 +1,42 @@ # Books Example A simple CRUD example showing how to manage book resources. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/BooksTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/BooksTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/BooksTest.kt?books # Cookies Example Demo server to show the use of cookies. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CookiesTest.kt?cookies # Error Handling Example Code to show how to handle callback exceptions and HTTP error codes. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ErrorsTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ErrorsTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ErrorsTest.kt?errors # Filters Example This example shows how to add filters before and after route execution. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FiltersTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FiltersTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FiltersTest.kt?filters # Files Example The following code shows how to serve resources and receive files. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FilesTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FilesTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FilesTest.kt?files # CORS Example This example shows how to set up CORS for REST APIs used from the browser. Here you can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CorsTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CorsTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/CorsTest.kt?cors # HTTPS Example The snippet below shows how to set up your server to use HTTPS and HTTP/2. You can check the -[full test](https://github.com/hexagonkt/hexagon/blob/master/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/HttpsTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/HttpsTest.kt). @code http/http_test/src/main/kotlin/com/hexagonkt/http/test/examples/HttpsTest.kt?https diff --git a/site/pages/examples/templates_examples.md b/site/pages/examples/templates_examples.md index 1020fe90c5..3f48a99046 100644 --- a/site/pages/examples/templates_examples.md +++ b/site/pages/examples/templates_examples.md @@ -1,7 +1,7 @@ # Register Template Adapters Example to show how to register template adapters. -[full test](https://github.com/hexagonkt/hexagon/blob/master/templates/src/test/kotlin/com/hexagonkt/templates/examples/TemplatesTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/templates/templates/src/test/kotlin/com/hexagonkt/templates/examples/TemplatesTest.kt). ## Using regular Expressions @code templates/templates/src/test/kotlin/com/hexagonkt/templates/examples/TemplatesTest.kt?templateRegex @@ -11,6 +11,6 @@ Example to show how to register template adapters. # Process Templates Simple example to show how to process templates. -[full test](https://github.com/hexagonkt/hexagon/blob/master/templates/src/test/kotlin/com/hexagonkt/templates/examples/TemplatesTest.kt). +[full test](https://github.com/hexagonkt/hexagon/blob/master/templates/templates/src/test/kotlin/com/hexagonkt/templates/examples/TemplatesTest.kt). @code templates/templates/src/test/kotlin/com/hexagonkt/templates/examples/TemplatesTest.kt?templateUsage