From e7abe4e5a27b97e991293b73c73555e80e58c038 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Sat, 17 Jun 2023 11:41:21 +0200 Subject: [PATCH 01/10] Set next release version --- build.gradle.kts | 2 +- gradle.properties | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fe7543e2e9..8b905298b9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,7 +26,7 @@ plugins { id("org.jetbrains.dokka") version("1.8.20") id("com.github.jk1.dependency-license-report") version("2.4") id("org.jetbrains.kotlinx.binary-compatibility-validator") version("0.13.2") - id("org.graalvm.buildtools.native") version("0.9.22") apply(false) + id("org.graalvm.buildtools.native") version("0.9.23") apply(false) id("io.gitlab.arturbosch.detekt") version("1.23.0") apply(false) id("me.champeau.jmh") version("0.7.1") apply(false) } diff --git a/gradle.properties b/gradle.properties index ae7874f8e8..54d47d0f3e 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-B3 +version=3.0.0-B4 group=com.hexagonkt description=The atoms of your platform @@ -37,9 +37,9 @@ mockkVersion=1.13.5 junitVersion=5.9.3 gatlingVersion=3.9.5 jmhVersion=1.36 -mkdocsMaterialVersion=9.1.15 +mkdocsMaterialVersion=9.1.16 mermaidDokkaVersion=0.4.4 -nativeToolsVersion=0.9.22 +nativeToolsVersion=0.9.23 # http_server_netty nettyVersion=4.1.93.Final From 61832d5bfc2fa1056c9aac54c2160dd165c474e7 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 17:17:20 +0200 Subject: [PATCH 02/10] Fix API checking --- build.gradle.kts | 13 +- core/api/core.api | 3 +- http/http_server/api/http_server.api | 1 + http/http_test/api/http_test.api | 245 ------------------ .../api/serialization_test.api | 8 - templates/templates/api/templates.api | 5 + .../api/templates_freemarker.api | 11 + .../templates_pebble/api/templates_pebble.api | 2 + .../templates_rocker/api/templates_rocker.api | 2 + .../templates_test/api/templates_test.api | 9 - 10 files changed, 34 insertions(+), 265 deletions(-) delete mode 100644 http/http_test/api/http_test.api delete mode 100644 serialization/serialization_test/api/serialization_test.api delete mode 100644 templates/templates_test/api/templates_test.api diff --git a/build.gradle.kts b/build.gradle.kts index 8b905298b9..a8fcf32307 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -130,16 +130,25 @@ gradle.taskGraph.whenReady(closureOf { apiValidation { ignoredProjects.addAll( listOf( + // Utility modules + "site", + "starters", + + // Test modules + "http_test", + "http_test_async", + "serialization_test", + "templates_test", + + // Experimental modules "handlers_async", "http_handlers_async", "http_server_async", "http_server_netty_async", "http_server_netty_epoll_async", - "http_test_async", "rest", "rest_test", "web", ) ) - validationDisabled = !file("api").isDirectory } diff --git a/core/api/core.api b/core/api/core.api index 9ac127ad10..aacd630aea 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -319,7 +319,8 @@ public final class com/hexagonkt/core/media/MediaTypeGroup : java/lang/Enum { } public final class com/hexagonkt/core/media/MediaTypesKt { - public static final fun getAPPLICATION_A7Z ()Lcom/hexagonkt/core/media/MediaType; + public static final fun extensionsOf (Lcom/hexagonkt/core/media/MediaType;)Ljava/util/List; + public static final fun getAPPLICATION_7Z ()Lcom/hexagonkt/core/media/MediaType; public static final fun getAPPLICATION_AVRO ()Lcom/hexagonkt/core/media/MediaType; public static final fun getAPPLICATION_BZIP ()Lcom/hexagonkt/core/media/MediaType; public static final fun getAPPLICATION_BZIP2 ()Lcom/hexagonkt/core/media/MediaType; diff --git a/http/http_server/api/http_server.api b/http/http_server/api/http_server.api index 5484928e4e..050057a4b6 100644 --- a/http/http_server/api/http_server.api +++ b/http/http_server/api/http_server.api @@ -58,6 +58,7 @@ public final class com/hexagonkt/http/server/HttpServerSettings { public static synthetic fun copy$default (Lcom/hexagonkt/http/server/HttpServerSettings;Ljava/net/InetAddress;ILjava/lang/String;Lcom/hexagonkt/http/model/HttpProtocol;Lcom/hexagonkt/http/SslSettings;Ljava/lang/String;ZILjava/lang/Object;)Lcom/hexagonkt/http/server/HttpServerSettings; public fun equals (Ljava/lang/Object;)Z public final fun getBanner ()Ljava/lang/String; + public final fun getBase ()Ljava/lang/String; public final fun getBindAddress ()Ljava/net/InetAddress; public final fun getBindPort ()I public final fun getContextPath ()Ljava/lang/String; diff --git a/http/http_test/api/http_test.api b/http/http_test/api/http_test.api deleted file mode 100644 index aadba41cb6..0000000000 --- a/http/http_test/api/http_test.api +++ /dev/null @@ -1,245 +0,0 @@ -public abstract class com/hexagonkt/http/test/BaseTest { - public fun ()V - protected final fun assertResponseContains (Lcom/hexagonkt/http/model/HttpResponsePort;Lcom/hexagonkt/http/model/HttpStatus;[Ljava/lang/String;)V - protected final fun assertResponseContains (Lcom/hexagonkt/http/model/HttpResponsePort;[Ljava/lang/String;)V - protected final fun assertResponseEquals (Lcom/hexagonkt/http/model/HttpResponsePort;Lcom/hexagonkt/http/model/HttpStatus;Ljava/lang/String;)V - public static synthetic fun assertResponseEquals$default (Lcom/hexagonkt/http/test/BaseTest;Lcom/hexagonkt/http/model/HttpResponsePort;Lcom/hexagonkt/http/model/HttpStatus;Ljava/lang/String;ILjava/lang/Object;)V - protected final fun basicAuth (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; - public static synthetic fun basicAuth$default (Lcom/hexagonkt/http/test/BaseTest;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String; - protected final fun getClient ()Lcom/hexagonkt/http/client/HttpClient; - protected abstract fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected abstract fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServer ()Lcom/hexagonkt/http/server/HttpServer; - protected abstract fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected abstract fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; - public final fun shutDown ()V - public final fun startUp ()V -} - -public abstract class com/hexagonkt/http/test/examples/BenchmarkIT : com/hexagonkt/http/test/examples/BooksTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Example benchmark ()V -} - -public final class com/hexagonkt/http/test/examples/BenchmarkSimulation : io/gatling/javaapi/core/Simulation { - public fun ()V -} - -public abstract class com/hexagonkt/http/test/examples/BooksTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Book not found returns a 404 ()V - public final fun Create book returns 201 and new book ID ()V - public final fun Create book returns 400 if a parameter is missing ()V - public final fun Delete book returns the deleted record ID ()V - public final fun Delete not found book returns a 404 ()V - public final fun Get book returns all book's fields ()V - public final fun Invalid method returns 405 ()V - public final fun List books contains all books IDs ()V - public final fun Not handled method returns 404 ()V - public final fun Update book overrides existing book data ()V - public final fun Update not found book returns a 404 ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public final class com/hexagonkt/http/test/examples/BooksTest$Book { - public fun (Ljava/lang/String;Ljava/lang/String;)V - public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Ljava/lang/String; - public final fun copy (Ljava/lang/String;Ljava/lang/String;)Lcom/hexagonkt/http/test/examples/BooksTest$Book; - public static synthetic fun copy$default (Lcom/hexagonkt/http/test/examples/BooksTest$Book;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/hexagonkt/http/test/examples/BooksTest$Book; - public fun equals (Ljava/lang/Object;)Z - public final fun getAuthor ()Ljava/lang/String; - public final fun getTitle ()Ljava/lang/String; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public abstract class com/hexagonkt/http/test/examples/ClientTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Ljava/util/List;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Ljava/util/List;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Cookies are sent correctly ()V - public final fun Create HTTP clients ()V - public final fun Exceptions are returned as internal server errors ()V - public final fun Form parameters are sent correctly ()V - public final fun HTTP generic requests work ok ()V - public final fun HTTP methods with body and content type work ok ()V - public final fun HTTP methods with body work ok ()V - public final fun HTTP methods without body work ok ()V - public final fun Integers are sent properly ()V - public final fun JSON requests works as expected ()V - public final fun Parameters are set properly ()V - public final fun Request HTTPS example ()V - public final fun Strings are sent properly ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; - public final fun resetHandler ()V - public final fun setUpSerializationFormats ()V -} - -public abstract class com/hexagonkt/http/test/examples/CookiesTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Create cookie adds a new cookie to the request ()V - public final fun Empty cookies assures there is no cookies ()V - public final fun Full cookie lifecycle ()V - public final fun Remove cookie deletes the given cookie ()V - public final fun Remove not available cookie does not fail ()V - public final fun clearCookies ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/CorsTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Allowed CORS pre-flight without origin ()V - public final fun Allowed origin is returned properly ()V - public final fun CORS full pre-flight ()V - public final fun CORS pre-flight ()V - public final fun CORS pre-flight with allowed headers ()V - public final fun CORS pre-flight with empty request method ()V - public final fun CORS pre-flight with mismatched origin ()V - public final fun CORS pre-flight with not allowed headers ()V - public final fun CORS pre-flight with not allowed method ()V - public final fun CORS pre-flight without origin ()V - public final fun CORS pre-flight without request method ()V - public final fun Request with not allowed origin is forbidden ()V - public final fun Request without origin continues as non CORS ()V - public final fun Simple CORS request ()V - public final fun Simple CORS request with exposed headers ()V - public final fun Simple CORS request with not allowed method ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - public final fun getPath ()Lcom/hexagonkt/http/handlers/PathHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/ErrorsTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun A runtime exception returns a 500 code ()V - public final fun Base error handler catch all exceptions that subclass a given one ()V - public final fun Halt stops request with 500 status code ()V - public final fun Handle exception allows to catch unhandled callback exceptions ()V - public final fun Handling status code allows to change the returned code ()V - public final fun Invalid body returns 500 status code ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public final class com/hexagonkt/http/test/examples/ErrorsTest$CustomException : java/lang/IllegalArgumentException { - public fun ()V -} - -public abstract class com/hexagonkt/http/test/examples/FilesTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun An static file from resources can be fetched ()V - public final fun Files content type is returned properly ()V - public final fun Files mounted on a path are returned properly ()V - public final fun Not found resources return 404 ()V - public final fun Parameters are separated from each other ()V - public final fun Requesting a folder with an existing file name returns 404 ()V - public final fun Sending files works properly ()V - public final fun Sending multi part content works properly ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/FiltersTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun After handlers can be chained ()V - public final fun HTTP request with valid credentials returns valid response ()V - public final fun Request with invalid password returns 403 ()V - public final fun Request with invalid user returns 403 ()V - public final fun Request without authorization returns 401 ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/HttpsTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Key stores contains the proper aliases ()V - public final fun Serve HTTP2 works properly ()V - public final fun Serve HTTPS example ()V - public final fun Serve HTTPS works properly ()V - public final fun Serve insecure HTTPS example ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/SamplesTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun callbacks ()V - public final fun errors ()V - public final fun files ()V - public final fun filters ()V - public final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - public final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - public final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; - public final fun mockRequest ()V - public final fun routeGroups ()V - public final fun routers ()V - public final fun routesCreation ()V - public final fun serverCreation ()V - public final fun shutDown ()V - public final fun startUp ()V - public final fun test ()V -} - -public abstract class com/hexagonkt/http/test/examples/SseTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun SSE requests get published events on the server ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/WebSocketsTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Serve WS works properly ()V - public final fun Serve WSS over HTTP2 works properly ()V - public final fun Serve WSS works properly ()V - public final fun WebSockets client check start and stop states ()V - public final fun WebSockets connections can be checked before session is created ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - -public abstract class com/hexagonkt/http/test/examples/ZipTest : com/hexagonkt/http/test/BaseTest { - public fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;)V - public synthetic fun (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/hexagonkt/http/server/HttpServerSettings;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun Use ZIP encoding example ()V - public final fun Use ZIP encoding without enabling the feature example ()V - protected final fun getClientAdapter ()Lkotlin/jvm/functions/Function0; - protected fun getHandler ()Lcom/hexagonkt/http/handlers/HttpHandler; - protected final fun getServerAdapter ()Lkotlin/jvm/functions/Function0; - protected final fun getServerSettings ()Lcom/hexagonkt/http/server/HttpServerSettings; -} - diff --git a/serialization/serialization_test/api/serialization_test.api b/serialization/serialization_test/api/serialization_test.api deleted file mode 100644 index 83687e3d7d..0000000000 --- a/serialization/serialization_test/api/serialization_test.api +++ /dev/null @@ -1,8 +0,0 @@ -public abstract class com/hexagonkt/serialization/test/SerializationTest { - public fun ()V - public final fun Parse URLs works ok ()V - public abstract fun getFormat ()Lcom/hexagonkt/serialization/SerializationFormat; - public abstract fun getUrls ()Ljava/util/List; - public final fun serializationUsage ()V -} - diff --git a/templates/templates/api/templates.api b/templates/templates/api/templates.api index 0db416078c..02ec15ac02 100644 --- a/templates/templates/api/templates.api +++ b/templates/templates/api/templates.api @@ -9,10 +9,15 @@ public final class com/hexagonkt/templates/TemplateManager { } public abstract interface class com/hexagonkt/templates/TemplatePort { + public abstract fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; + public abstract fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; public abstract fun render (Ljava/net/URL;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; } public final class com/hexagonkt/templates/TemplatePort$DefaultImpls { + public static fun render (Lcom/hexagonkt/templates/TemplatePort;Ljava/lang/String;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; + public static synthetic fun render$default (Lcom/hexagonkt/templates/TemplatePort;Ljava/lang/String;Ljava/util/Map;Ljava/util/Locale;ILjava/lang/Object;)Ljava/lang/String; + public static synthetic fun render$default (Lcom/hexagonkt/templates/TemplatePort;Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/util/Locale;ILjava/lang/Object;)Ljava/lang/String; public static synthetic fun render$default (Lcom/hexagonkt/templates/TemplatePort;Ljava/net/URL;Ljava/util/Map;Ljava/util/Locale;ILjava/lang/Object;)Ljava/lang/String; } diff --git a/templates/templates_freemarker/api/templates_freemarker.api b/templates/templates_freemarker/api/templates_freemarker.api index 348d88f81a..e55ccc7a98 100644 --- a/templates/templates_freemarker/api/templates_freemarker.api +++ b/templates/templates_freemarker/api/templates_freemarker.api @@ -1,5 +1,16 @@ public final class com/hexagonkt/templates/freemarker/FreeMarkerAdapter : com/hexagonkt/templates/TemplatePort { public fun ()V + public fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; + public fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; public fun render (Ljava/net/URL;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; } +public final class com/hexagonkt/templates/freemarker/FreeMarkerAdapter$AdapterTemplateLoader : freemarker/cache/URLTemplateLoader { + public static final field INSTANCE Lcom/hexagonkt/templates/freemarker/FreeMarkerAdapter$AdapterTemplateLoader; +} + +public final class com/hexagonkt/templates/freemarker/FreeMarkerAdapter$AdapterTemplateLookupStrategy : freemarker/cache/TemplateLookupStrategy { + public static final field INSTANCE Lcom/hexagonkt/templates/freemarker/FreeMarkerAdapter$AdapterTemplateLookupStrategy; + public fun lookup (Lfreemarker/cache/TemplateLookupContext;)Lfreemarker/cache/TemplateLookupResult; +} + diff --git a/templates/templates_pebble/api/templates_pebble.api b/templates/templates_pebble/api/templates_pebble.api index a06ef1ae03..655806a9c7 100644 --- a/templates/templates_pebble/api/templates_pebble.api +++ b/templates/templates_pebble/api/templates_pebble.api @@ -2,6 +2,8 @@ public final class com/hexagonkt/templates/pebble/PebbleAdapter : com/hexagonkt/ public fun ()V public fun (ZI)V public synthetic fun (ZIILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; + public fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; public fun render (Ljava/net/URL;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; } diff --git a/templates/templates_rocker/api/templates_rocker.api b/templates/templates_rocker/api/templates_rocker.api index 0c5ff391fc..3eb6988d55 100644 --- a/templates/templates_rocker/api/templates_rocker.api +++ b/templates/templates_rocker/api/templates_rocker.api @@ -2,6 +2,8 @@ public final class com/hexagonkt/templates/rocker/RockerAdapter : com/hexagonkt/ public fun ()V public fun (Z)V public synthetic fun (ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; + public fun render (Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; public fun render (Ljava/net/URL;Ljava/util/Map;Ljava/util/Locale;)Ljava/lang/String; } diff --git a/templates/templates_test/api/templates_test.api b/templates/templates_test/api/templates_test.api deleted file mode 100644 index 3cb3fee77e..0000000000 --- a/templates/templates_test/api/templates_test.api +++ /dev/null @@ -1,9 +0,0 @@ -public abstract class com/hexagonkt/templates/test/TemplateAdapterTest { - public fun (Ljava/net/URL;Lcom/hexagonkt/templates/TemplatePort;)V - public final fun A static template is rendered properly ()V - public final fun A static template with missing properties is rendered properly ()V - public final fun Invalid resource path will return empty map ()V - public final fun Set up adapter ()V - public final fun Template with not proper properties is rendered ()V -} - From 9c27c983405c8f9c0cf38b24c31a6f55f84702e9 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 17:17:56 +0200 Subject: [PATCH 03/10] :Fix :test in :Windows --- .../kotlin/com/hexagonkt/http/server/HttpServerSettingsTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/http_server/src/test/kotlin/com/hexagonkt/http/server/HttpServerSettingsTest.kt b/http/http_server/src/test/kotlin/com/hexagonkt/http/server/HttpServerSettingsTest.kt index 2f986e615d..46464c24b1 100644 --- a/http/http_server/src/test/kotlin/com/hexagonkt/http/server/HttpServerSettingsTest.kt +++ b/http/http_server/src/test/kotlin/com/hexagonkt/http/server/HttpServerSettingsTest.kt @@ -17,7 +17,7 @@ internal class HttpServerSettingsTest { assertNull(it.sslSettings) assertEquals(HttpServer.banner, it.banner) assertEquals(false, it.zip) - assertEquals("http://localhost", it.base) + assert(it.base == "http://localhost" || it.base == "http://127.0.0.1") } } From ce4c2f52624789bfbb419f4fd4d3298ea1142a61 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 17:25:53 +0200 Subject: [PATCH 04/10] Rename 'rest_test' module to 'rest_tools' --- build.gradle.kts | 2 +- gradle.properties | 4 +--- http/{rest_test => rest_tools}/build.gradle.kts | 0 .../src/main/kotlin/com/hexagonkt/http/test/DynamicServer.kt | 0 .../src/main/kotlin/com/hexagonkt/http/test/Http.kt | 0 .../kotlin/com/hexagonkt/http/test/openapi/OpenApiHandler.kt | 0 .../test/kotlin/com/hexagonkt/http/test/DynamicServerTest.kt | 0 .../com/hexagonkt/http/test/openapi/OpenApiHandlerTest.kt | 0 .../src/test/resources/openapi_test.json | 0 .../src/test/resources/petstore_openapi.json | 0 site/build.gradle.kts | 2 +- starters/hexagon_bom.xml | 2 +- 12 files changed, 4 insertions(+), 6 deletions(-) rename http/{rest_test => rest_tools}/build.gradle.kts (100%) rename http/{rest_test => rest_tools}/src/main/kotlin/com/hexagonkt/http/test/DynamicServer.kt (100%) rename http/{rest_test => rest_tools}/src/main/kotlin/com/hexagonkt/http/test/Http.kt (100%) rename http/{rest_test => rest_tools}/src/main/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandler.kt (100%) rename http/{rest_test => rest_tools}/src/test/kotlin/com/hexagonkt/http/test/DynamicServerTest.kt (100%) rename http/{rest_test => rest_tools}/src/test/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandlerTest.kt (100%) rename http/{rest_test => rest_tools}/src/test/resources/openapi_test.json (100%) rename http/{rest_test => rest_tools}/src/test/resources/petstore_openapi.json (100%) diff --git a/build.gradle.kts b/build.gradle.kts index a8fcf32307..e35055e8ff 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -147,7 +147,7 @@ apiValidation { "http_server_netty_async", "http_server_netty_epoll_async", "rest", - "rest_test", + "rest_tools", "web", ) ) diff --git a/gradle.properties b/gradle.properties index 54d47d0f3e..c8439832d5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,10 +49,8 @@ nettyTcNativeVersion=2.0.61.Final servletVersion=5.0.0 jettyVersion=11.0.15 -# rest_test +# rest_tools vertxVersion=4.4.3 - -# rest_test swaggerParserVersion=2.1.15 # logging diff --git a/http/rest_test/build.gradle.kts b/http/rest_tools/build.gradle.kts similarity index 100% rename from http/rest_test/build.gradle.kts rename to http/rest_tools/build.gradle.kts diff --git a/http/rest_test/src/main/kotlin/com/hexagonkt/http/test/DynamicServer.kt b/http/rest_tools/src/main/kotlin/com/hexagonkt/http/test/DynamicServer.kt similarity index 100% rename from http/rest_test/src/main/kotlin/com/hexagonkt/http/test/DynamicServer.kt rename to http/rest_tools/src/main/kotlin/com/hexagonkt/http/test/DynamicServer.kt diff --git a/http/rest_test/src/main/kotlin/com/hexagonkt/http/test/Http.kt b/http/rest_tools/src/main/kotlin/com/hexagonkt/http/test/Http.kt similarity index 100% rename from http/rest_test/src/main/kotlin/com/hexagonkt/http/test/Http.kt rename to http/rest_tools/src/main/kotlin/com/hexagonkt/http/test/Http.kt diff --git a/http/rest_test/src/main/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandler.kt b/http/rest_tools/src/main/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandler.kt similarity index 100% rename from http/rest_test/src/main/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandler.kt rename to http/rest_tools/src/main/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandler.kt diff --git a/http/rest_test/src/test/kotlin/com/hexagonkt/http/test/DynamicServerTest.kt b/http/rest_tools/src/test/kotlin/com/hexagonkt/http/test/DynamicServerTest.kt similarity index 100% rename from http/rest_test/src/test/kotlin/com/hexagonkt/http/test/DynamicServerTest.kt rename to http/rest_tools/src/test/kotlin/com/hexagonkt/http/test/DynamicServerTest.kt diff --git a/http/rest_test/src/test/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandlerTest.kt b/http/rest_tools/src/test/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandlerTest.kt similarity index 100% rename from http/rest_test/src/test/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandlerTest.kt rename to http/rest_tools/src/test/kotlin/com/hexagonkt/http/test/openapi/OpenApiHandlerTest.kt diff --git a/http/rest_test/src/test/resources/openapi_test.json b/http/rest_tools/src/test/resources/openapi_test.json similarity index 100% rename from http/rest_test/src/test/resources/openapi_test.json rename to http/rest_tools/src/test/resources/openapi_test.json diff --git a/http/rest_test/src/test/resources/petstore_openapi.json b/http/rest_tools/src/test/resources/petstore_openapi.json similarity index 100% rename from http/rest_test/src/test/resources/petstore_openapi.json rename to http/rest_tools/src/test/resources/petstore_openapi.json diff --git a/site/build.gradle.kts b/site/build.gradle.kts index 3e02640db5..66a53f421f 100644 --- a/site/build.gradle.kts +++ b/site/build.gradle.kts @@ -17,7 +17,7 @@ tasks.register("jacocoRootReport") { .filterNot { it.absolutePath.contains("serialization_test") } .filterNot { it.absolutePath.contains("templates_test") } .filterNot { it.absolutePath.contains("rest") } - .filterNot { it.absolutePath.contains("rest_test") } + .filterNot { it.absolutePath.contains("rest_tools") } .filterNot { it.absolutePath.contains("web") } .toList() // TODO Include the filtered modules when they are ready diff --git a/starters/hexagon_bom.xml b/starters/hexagon_bom.xml index 61eff35d78..4e2218f8b4 100644 --- a/starters/hexagon_bom.xml +++ b/starters/hexagon_bom.xml @@ -104,7 +104,7 @@ com.hexagonkt - rest_test + rest_tools ${hexagon.version} From 2436d02c82198ca559414576c8a91faf9e646190 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 17:45:08 +0200 Subject: [PATCH 05/10] Initialize fields lazily to improve start up performance --- .../com/hexagonkt/core/ClasspathHandler.kt | 6 +- .../main/kotlin/com/hexagonkt/core/Network.kt | 4 +- .../main/kotlin/com/hexagonkt/core/Strings.kt | 4 +- .../com/hexagonkt/core/media/MediaTypes.kt | 214 +++++++++--------- 4 files changed, 117 insertions(+), 111 deletions(-) diff --git a/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandler.kt b/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandler.kt index d8fd9ea63a..4c1e9038b3 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandler.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/ClasspathHandler.kt @@ -5,8 +5,10 @@ import java.net.URLConnection import java.net.URLStreamHandler object ClasspathHandler : URLStreamHandler() { - private val classLoader: ClassLoader = Thread.currentThread().contextClassLoader - private val protocolHandlers: Map = mapOf("classpath" to this) + private val classLoader: ClassLoader by lazy { Thread.currentThread().contextClassLoader } + private val protocolHandlers: Map by lazy { + mapOf("classpath" to this) + } override fun openConnection(url: URL): URLConnection = classLoader.getResource(url.path)?.openConnection() diff --git a/core/src/main/kotlin/com/hexagonkt/core/Network.kt b/core/src/main/kotlin/com/hexagonkt/core/Network.kt index c7fd217f4c..7be35328f1 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/Network.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/Network.kt @@ -5,10 +5,10 @@ import java.net.* import java.util.* /** Internet address used to bind services to all local network interfaces. */ -val ALL_INTERFACES: InetAddress = inetAddress(0, 0, 0, 0) +val ALL_INTERFACES: InetAddress by lazy { inetAddress(0, 0, 0, 0) } /** Internet address used to bind services to the loopback interface. */ -val LOOPBACK_INTERFACE: InetAddress = inetAddress(127, 0, 0, 1) +val LOOPBACK_INTERFACE: InetAddress by lazy { inetAddress(127, 0, 0, 1) } /** * Syntactic sugar to create an Internet address. diff --git a/core/src/main/kotlin/com/hexagonkt/core/Strings.kt b/core/src/main/kotlin/com/hexagonkt/core/Strings.kt index ac1fe0a0bb..3b87c42623 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/Strings.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/Strings.kt @@ -16,8 +16,8 @@ import kotlin.reflect.KClass private const val VARIABLE_PREFIX = "{{" private const val VARIABLE_SUFFIX = "}}" -private val base64Encoder: Base64.Encoder = Base64.getEncoder().withoutPadding() -private val base64Decoder: Base64.Decoder = Base64.getDecoder() +private val base64Encoder: Base64.Encoder by lazy { Base64.getEncoder().withoutPadding() } +private val base64Decoder: Base64.Decoder by lazy { Base64.getDecoder() } /** Runtime specific end of line. */ val eol: String by lazy { getProperty("line.separator") } diff --git a/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt b/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt index dc6ed910af..6be9ca63e3 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt @@ -7,7 +7,7 @@ import java.net.URL import java.nio.file.Path import kotlin.io.path.extension -val MEDIA_TYPE_FORMAT: Regex = """\*|([\w+.-]+)""".toRegex() +val MEDIA_TYPE_FORMAT: Regex by lazy { """\*|([\w+.-]+)""".toRegex() } val APPLICATION_AVRO: MediaType = MediaType(APPLICATION, "avro") val APPLICATION_CBOR: MediaType = MediaType(APPLICATION, "cbor") @@ -90,110 +90,114 @@ val VIDEO_MP4: MediaType = MediaType(VIDEO, "mp4") val VIDEO_OGG: MediaType = MediaType(VIDEO, "ogg") val VIDEO_WEBM: MediaType = MediaType(VIDEO, "webm") -val DEFAULT_MEDIA_TYPE: MediaType = APPLICATION_OCTET_STREAM - -internal val MEDIA_TYPES_EXTENSIONS: Map = mapOf( - "avro" to APPLICATION_AVRO, - "cbor" to APPLICATION_CBOR, - "json" to APPLICATION_JSON, - "yaml" to APPLICATION_YAML, - "yml" to APPLICATION_YAML, - "xml" to APPLICATION_XML, - "bin" to APPLICATION_OCTET_STREAM, - "lha" to APPLICATION_OCTET_STREAM, - "lzh" to APPLICATION_OCTET_STREAM, - "exe" to APPLICATION_OCTET_STREAM, - "so" to APPLICATION_OCTET_STREAM, - "class" to APPLICATION_OCTET_STREAM, - "pdf" to APPLICATION_PDF, - "ai" to APPLICATION_POSTSCRIPT, - "eps" to APPLICATION_POSTSCRIPT, - "ps" to APPLICATION_POSTSCRIPT, - "rtf" to APPLICATION_RTF, - "z" to APPLICATION_COMPRESS, - "csh" to APPLICATION_X_CSH, - "gtar" to APPLICATION_X_GTAR, - "gz" to APPLICATION_GZIP, - "gzip" to APPLICATION_GZIP, - "latex" to APPLICATION_X_LATEX, - "sh" to APPLICATION_X_SH, - "tar" to APPLICATION_X_TAR, - "tcl" to APPLICATION_X_TCL, - "tex" to APPLICATION_X_TEX, - "texinfo" to APPLICATION_X_TEXINFO, - "texi" to APPLICATION_X_TEXINFO, - "zip" to APPLICATION_ZIP, - "epub" to APPLICATION_EPUB_ZIP, - "jar" to APPLICATION_JAVA_ARCHIVE, - "ogx" to APPLICATION_OGG, - "rar" to APPLICATION_RAR, - "7z" to APPLICATION_7Z, - "bz" to APPLICATION_BZIP, - "bz2" to APPLICATION_BZIP2, - "cda" to APPLICATION_CDF, - "php" to APPLICATION_PHP, - "xhtml" to APPLICATION_XHTML, - "webmanifest" to APPLICATION_WEB_MANIFEST, - "toml" to APPLICATION_TOML, - "au" to AUDIO_BASIC, - "snd" to AUDIO_BASIC, - "mpga" to AUDIO_MPEG, - "mp2" to AUDIO_MPEG, - "mp2a" to AUDIO_MPEG, - "mp3" to AUDIO_MPEG, - "m2a" to AUDIO_MPEG, - "m3a" to AUDIO_MPEG, - "wav" to AUDIO_WAV, - "aac" to AUDIO_AAC, - "mid" to AUDIO_MIDI, - "midi" to AUDIO_MIDI, - "oga" to AUDIO_OGG, - "opus" to AUDIO_OPUS, - "weba" to AUDIO_WEBM, - "otf" to FONT_OTF, - "ttf" to FONT_TTF, - "woff" to FONT_WOFF, - "woff2" to FONT_WOFF2, - "gif" to IMAGE_GIF, - "jpeg" to IMAGE_JPEG, - "jpg" to IMAGE_JPEG, - "png" to IMAGE_PNG, - "tiff" to IMAGE_TIFF, - "tif" to IMAGE_TIFF, - "svg" to IMAGE_SVG, - "ico" to IMAGE_ICO, - "webp" to IMAGE_WEBP, - "avif" to IMAGE_AVIF, - "csv" to TEXT_CSV, - "properties" to TEXT_X_JAVA_PROPERTIES, - "js" to TEXT_JAVASCRIPT, - "css" to TEXT_CSS, - "html" to TEXT_HTML, - "htm" to TEXT_HTML, - "md" to TEXT_MARKDOWN, - "txt" to TEXT_PLAIN, - "log" to TEXT_PLAIN, - "rtx" to TEXT_RICHTEXT, - "tsv" to TEXT_TAB_SEPARATED_VALUES, - "ics" to TEXT_CALENDAR, - "mpeg" to VIDEO_MPEG, - "mpg" to VIDEO_MPEG, - "mpe" to VIDEO_MPEG, - "m1v" to VIDEO_MPEG, - "m2v" to VIDEO_MPEG, - "qt" to VIDEO_QUICKTIME, - "mov" to VIDEO_QUICKTIME, - "avi" to VIDEO_X_MSVIDEO, - "mp4" to VIDEO_MP4, - "ogv" to VIDEO_OGG, - "webm" to VIDEO_WEBM, -) - -internal val EXTENSIONS_BY_MEDIA: Map> = MEDIA_TYPES_EXTENSIONS.entries - .groupBy { it.value } - .mapValues { - it.value.map { entry -> entry.key } - } +val DEFAULT_MEDIA_TYPE: MediaType by lazy { APPLICATION_OCTET_STREAM } + +internal val MEDIA_TYPES_EXTENSIONS: Map by lazy { + mapOf( + "avro" to APPLICATION_AVRO, + "cbor" to APPLICATION_CBOR, + "json" to APPLICATION_JSON, + "yaml" to APPLICATION_YAML, + "yml" to APPLICATION_YAML, + "xml" to APPLICATION_XML, + "bin" to APPLICATION_OCTET_STREAM, + "lha" to APPLICATION_OCTET_STREAM, + "lzh" to APPLICATION_OCTET_STREAM, + "exe" to APPLICATION_OCTET_STREAM, + "so" to APPLICATION_OCTET_STREAM, + "class" to APPLICATION_OCTET_STREAM, + "pdf" to APPLICATION_PDF, + "ai" to APPLICATION_POSTSCRIPT, + "eps" to APPLICATION_POSTSCRIPT, + "ps" to APPLICATION_POSTSCRIPT, + "rtf" to APPLICATION_RTF, + "z" to APPLICATION_COMPRESS, + "csh" to APPLICATION_X_CSH, + "gtar" to APPLICATION_X_GTAR, + "gz" to APPLICATION_GZIP, + "gzip" to APPLICATION_GZIP, + "latex" to APPLICATION_X_LATEX, + "sh" to APPLICATION_X_SH, + "tar" to APPLICATION_X_TAR, + "tcl" to APPLICATION_X_TCL, + "tex" to APPLICATION_X_TEX, + "texinfo" to APPLICATION_X_TEXINFO, + "texi" to APPLICATION_X_TEXINFO, + "zip" to APPLICATION_ZIP, + "epub" to APPLICATION_EPUB_ZIP, + "jar" to APPLICATION_JAVA_ARCHIVE, + "ogx" to APPLICATION_OGG, + "rar" to APPLICATION_RAR, + "7z" to APPLICATION_7Z, + "bz" to APPLICATION_BZIP, + "bz2" to APPLICATION_BZIP2, + "cda" to APPLICATION_CDF, + "php" to APPLICATION_PHP, + "xhtml" to APPLICATION_XHTML, + "webmanifest" to APPLICATION_WEB_MANIFEST, + "toml" to APPLICATION_TOML, + "au" to AUDIO_BASIC, + "snd" to AUDIO_BASIC, + "mpga" to AUDIO_MPEG, + "mp2" to AUDIO_MPEG, + "mp2a" to AUDIO_MPEG, + "mp3" to AUDIO_MPEG, + "m2a" to AUDIO_MPEG, + "m3a" to AUDIO_MPEG, + "wav" to AUDIO_WAV, + "aac" to AUDIO_AAC, + "mid" to AUDIO_MIDI, + "midi" to AUDIO_MIDI, + "oga" to AUDIO_OGG, + "opus" to AUDIO_OPUS, + "weba" to AUDIO_WEBM, + "otf" to FONT_OTF, + "ttf" to FONT_TTF, + "woff" to FONT_WOFF, + "woff2" to FONT_WOFF2, + "gif" to IMAGE_GIF, + "jpeg" to IMAGE_JPEG, + "jpg" to IMAGE_JPEG, + "png" to IMAGE_PNG, + "tiff" to IMAGE_TIFF, + "tif" to IMAGE_TIFF, + "svg" to IMAGE_SVG, + "ico" to IMAGE_ICO, + "webp" to IMAGE_WEBP, + "avif" to IMAGE_AVIF, + "csv" to TEXT_CSV, + "properties" to TEXT_X_JAVA_PROPERTIES, + "js" to TEXT_JAVASCRIPT, + "css" to TEXT_CSS, + "html" to TEXT_HTML, + "htm" to TEXT_HTML, + "md" to TEXT_MARKDOWN, + "txt" to TEXT_PLAIN, + "log" to TEXT_PLAIN, + "rtx" to TEXT_RICHTEXT, + "tsv" to TEXT_TAB_SEPARATED_VALUES, + "ics" to TEXT_CALENDAR, + "mpeg" to VIDEO_MPEG, + "mpg" to VIDEO_MPEG, + "mpe" to VIDEO_MPEG, + "m1v" to VIDEO_MPEG, + "m2v" to VIDEO_MPEG, + "qt" to VIDEO_QUICKTIME, + "mov" to VIDEO_QUICKTIME, + "avi" to VIDEO_X_MSVIDEO, + "mp4" to VIDEO_MP4, + "ogv" to VIDEO_OGG, + "webm" to VIDEO_WEBM, + ) +} + +internal val EXTENSIONS_BY_MEDIA: Map> by lazy { + MEDIA_TYPES_EXTENSIONS.entries + .groupBy { it.value } + .mapValues { + it.value.map { entry -> entry.key } + } +} fun parseMediaType(fullType: String): MediaType { val groupType = fullType.split("/") From 28efdcc44cc468a2872d527d86fcfabbfd160b13 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 17:48:17 +0200 Subject: [PATCH 06/10] Initialize fields lazily to improve start up performance --- .../com/hexagonkt/core/media/MediaTypes.kt | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt b/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt index 6be9ca63e3..2011293fa4 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt @@ -9,86 +9,86 @@ import kotlin.io.path.extension val MEDIA_TYPE_FORMAT: Regex by lazy { """\*|([\w+.-]+)""".toRegex() } -val APPLICATION_AVRO: MediaType = MediaType(APPLICATION, "avro") -val APPLICATION_CBOR: MediaType = MediaType(APPLICATION, "cbor") -val APPLICATION_JSON: MediaType = MediaType(APPLICATION, "json") -val APPLICATION_YAML: MediaType = MediaType(APPLICATION, "yaml") -val APPLICATION_XML: MediaType = MediaType(APPLICATION, "xml") -val APPLICATION_GZIP: MediaType = MediaType(APPLICATION, "gzip") -val APPLICATION_COMPRESS: MediaType = MediaType(APPLICATION, "compress") -val APPLICATION_OCTET_STREAM: MediaType = MediaType(APPLICATION, "octet-stream") -val APPLICATION_PDF: MediaType = MediaType(APPLICATION, "pdf") -val APPLICATION_POSTSCRIPT: MediaType = MediaType(APPLICATION, "postscript") -val APPLICATION_RTF: MediaType = MediaType(APPLICATION, "rtf") -val APPLICATION_X_CSH: MediaType = MediaType(APPLICATION, "x-csh") -val APPLICATION_X_GTAR: MediaType = MediaType(APPLICATION, "x-gtar") -val APPLICATION_X_LATEX: MediaType = MediaType(APPLICATION, "x-latex") -val APPLICATION_X_SH: MediaType = MediaType(APPLICATION, "x-sh") -val APPLICATION_X_TAR: MediaType = MediaType(APPLICATION, "x-tar") -val APPLICATION_X_TCL: MediaType = MediaType(APPLICATION, "x-tcl") -val APPLICATION_X_TEX: MediaType = MediaType(APPLICATION, "x-tex") -val APPLICATION_X_TEXINFO: MediaType = MediaType(APPLICATION, "x-texinfo") -val APPLICATION_ZIP: MediaType = MediaType(APPLICATION, "zip") -val APPLICATION_EPUB_ZIP: MediaType = MediaType(APPLICATION, "epub+zip") -val APPLICATION_JAVA_ARCHIVE: MediaType = MediaType(APPLICATION, "java-archive") -val APPLICATION_OGG: MediaType = MediaType(APPLICATION, "ogg") -val APPLICATION_RAR: MediaType = MediaType(APPLICATION, "vnd.rar") -val APPLICATION_XHTML: MediaType = MediaType(APPLICATION, "xhtml+xml") -val APPLICATION_WEB_MANIFEST: MediaType = MediaType(APPLICATION, "manifest+json") -val APPLICATION_TOML: MediaType = MediaType(APPLICATION, "toml") -val APPLICATION_7Z: MediaType = MediaType(APPLICATION, "x-7z-compressed") -val APPLICATION_BZIP: MediaType = MediaType(APPLICATION, "x-bzip") -val APPLICATION_BZIP2: MediaType = MediaType(APPLICATION, "x-bzip2") -val APPLICATION_CDF: MediaType = MediaType(APPLICATION, "x-cdf") -val APPLICATION_PHP: MediaType = MediaType(APPLICATION, "x-httpd-php") - -val AUDIO_BASIC: MediaType = MediaType(AUDIO, "basic") -val AUDIO_MPEG: MediaType = MediaType(AUDIO, "mpeg") -val AUDIO_WAV: MediaType = MediaType(AUDIO, "wav") -val AUDIO_AAC: MediaType = MediaType(AUDIO, "aac") -val AUDIO_MIDI: MediaType = MediaType(AUDIO, "midi") -val AUDIO_OGG: MediaType = MediaType(AUDIO, "ogg") -val AUDIO_OPUS: MediaType = MediaType(AUDIO, "opus") -val AUDIO_WEBM: MediaType = MediaType(AUDIO, "webm") - -val FONT_OTF: MediaType = MediaType(FONT, "otf") -val FONT_TTF: MediaType = MediaType(FONT, "ttf") -val FONT_WOFF: MediaType = MediaType(FONT, "woff") -val FONT_WOFF2: MediaType = MediaType(FONT, "woff2") - -val IMAGE_GIF: MediaType = MediaType(IMAGE, "gif") -val IMAGE_JPEG: MediaType = MediaType(IMAGE, "jpeg") -val IMAGE_PNG: MediaType = MediaType(IMAGE, "png") -val IMAGE_TIFF: MediaType = MediaType(IMAGE, "tiff") -val IMAGE_SVG: MediaType = MediaType(IMAGE, "svg+xml") -val IMAGE_ICO: MediaType = MediaType(IMAGE, "vnd.microsoft.icon") -val IMAGE_WEBP: MediaType = MediaType(IMAGE, "webp") -val IMAGE_AVIF: MediaType = MediaType(IMAGE, "avif") - -val MULTIPART_ALTERNATIVE: MediaType = MediaType(MULTIPART, "alternative") -val MULTIPART_APPLEDOUBLE: MediaType = MediaType(MULTIPART, "appledouble") -val MULTIPART_DIGEST: MediaType = MediaType(MULTIPART, "digest") -val MULTIPART_MIXED: MediaType = MediaType(MULTIPART, "mixed") -val MULTIPART_PARALLEL: MediaType = MediaType(MULTIPART, "parallel") - -val TEXT_CSV: MediaType = MediaType(TEXT, "csv") -val TEXT_X_JAVA_PROPERTIES: MediaType = MediaType(TEXT, "x-java-properties") -val TEXT_JAVASCRIPT: MediaType = MediaType(TEXT, "javascript") -val TEXT_CSS: MediaType = MediaType(TEXT, "css") -val TEXT_HTML: MediaType = MediaType(TEXT, "html") -val TEXT_MARKDOWN: MediaType = MediaType(TEXT, "markdown") -val TEXT_PLAIN: MediaType = MediaType(TEXT, "plain") -val TEXT_RICHTEXT: MediaType = MediaType(TEXT, "richtext") -val TEXT_TAB_SEPARATED_VALUES: MediaType = MediaType(TEXT, "tab-separated-values") -val TEXT_CALENDAR: MediaType = MediaType(TEXT, "calendar") -val TEXT_EVENT_STREAM: MediaType = MediaType(TEXT, "event-stream") - -val VIDEO_MPEG: MediaType = MediaType(VIDEO, "mpeg") -val VIDEO_QUICKTIME: MediaType = MediaType(VIDEO, "quicktime") -val VIDEO_X_MSVIDEO: MediaType = MediaType(VIDEO, "x-msvideo") -val VIDEO_MP4: MediaType = MediaType(VIDEO, "mp4") -val VIDEO_OGG: MediaType = MediaType(VIDEO, "ogg") -val VIDEO_WEBM: MediaType = MediaType(VIDEO, "webm") +val APPLICATION_AVRO: MediaType by lazy { MediaType(APPLICATION, "avro") } +val APPLICATION_CBOR: MediaType by lazy { MediaType(APPLICATION, "cbor") } +val APPLICATION_JSON: MediaType by lazy { MediaType(APPLICATION, "json") } +val APPLICATION_YAML: MediaType by lazy { MediaType(APPLICATION, "yaml") } +val APPLICATION_XML: MediaType by lazy { MediaType(APPLICATION, "xml") } +val APPLICATION_GZIP: MediaType by lazy { MediaType(APPLICATION, "gzip") } +val APPLICATION_COMPRESS: MediaType by lazy { MediaType(APPLICATION, "compress") } +val APPLICATION_OCTET_STREAM: MediaType by lazy { MediaType(APPLICATION, "octet-stream") } +val APPLICATION_PDF: MediaType by lazy { MediaType(APPLICATION, "pdf") } +val APPLICATION_POSTSCRIPT: MediaType by lazy { MediaType(APPLICATION, "postscript") } +val APPLICATION_RTF: MediaType by lazy { MediaType(APPLICATION, "rtf") } +val APPLICATION_X_CSH: MediaType by lazy { MediaType(APPLICATION, "x-csh") } +val APPLICATION_X_GTAR: MediaType by lazy { MediaType(APPLICATION, "x-gtar") } +val APPLICATION_X_LATEX: MediaType by lazy { MediaType(APPLICATION, "x-latex") } +val APPLICATION_X_SH: MediaType by lazy { MediaType(APPLICATION, "x-sh") } +val APPLICATION_X_TAR: MediaType by lazy { MediaType(APPLICATION, "x-tar") } +val APPLICATION_X_TCL: MediaType by lazy { MediaType(APPLICATION, "x-tcl") } +val APPLICATION_X_TEX: MediaType by lazy { MediaType(APPLICATION, "x-tex") } +val APPLICATION_X_TEXINFO: MediaType by lazy { MediaType(APPLICATION, "x-texinfo") } +val APPLICATION_ZIP: MediaType by lazy { MediaType(APPLICATION, "zip") } +val APPLICATION_EPUB_ZIP: MediaType by lazy { MediaType(APPLICATION, "epub+zip") } +val APPLICATION_JAVA_ARCHIVE: MediaType by lazy { MediaType(APPLICATION, "java-archive") } +val APPLICATION_OGG: MediaType by lazy { MediaType(APPLICATION, "ogg") } +val APPLICATION_RAR: MediaType by lazy { MediaType(APPLICATION, "vnd.rar") } +val APPLICATION_XHTML: MediaType by lazy { MediaType(APPLICATION, "xhtml+xml") } +val APPLICATION_WEB_MANIFEST: MediaType by lazy { MediaType(APPLICATION, "manifest+json") } +val APPLICATION_TOML: MediaType by lazy { MediaType(APPLICATION, "toml") } +val APPLICATION_7Z: MediaType by lazy { MediaType(APPLICATION, "x-7z-compressed") } +val APPLICATION_BZIP: MediaType by lazy { MediaType(APPLICATION, "x-bzip") } +val APPLICATION_BZIP2: MediaType by lazy { MediaType(APPLICATION, "x-bzip2") } +val APPLICATION_CDF: MediaType by lazy { MediaType(APPLICATION, "x-cdf") } +val APPLICATION_PHP: MediaType by lazy { MediaType(APPLICATION, "x-httpd-php") } + +val AUDIO_BASIC: MediaType by lazy { MediaType(AUDIO, "basic") } +val AUDIO_MPEG: MediaType by lazy { MediaType(AUDIO, "mpeg") } +val AUDIO_WAV: MediaType by lazy { MediaType(AUDIO, "wav") } +val AUDIO_AAC: MediaType by lazy { MediaType(AUDIO, "aac") } +val AUDIO_MIDI: MediaType by lazy { MediaType(AUDIO, "midi") } +val AUDIO_OGG: MediaType by lazy { MediaType(AUDIO, "ogg") } +val AUDIO_OPUS: MediaType by lazy { MediaType(AUDIO, "opus") } +val AUDIO_WEBM: MediaType by lazy { MediaType(AUDIO, "webm") } + +val FONT_OTF: MediaType by lazy { MediaType(FONT, "otf") } +val FONT_TTF: MediaType by lazy { MediaType(FONT, "ttf") } +val FONT_WOFF: MediaType by lazy { MediaType(FONT, "woff") } +val FONT_WOFF2: MediaType by lazy { MediaType(FONT, "woff2") } + +val IMAGE_GIF: MediaType by lazy { MediaType(IMAGE, "gif") } +val IMAGE_JPEG: MediaType by lazy { MediaType(IMAGE, "jpeg") } +val IMAGE_PNG: MediaType by lazy { MediaType(IMAGE, "png") } +val IMAGE_TIFF: MediaType by lazy { MediaType(IMAGE, "tiff") } +val IMAGE_SVG: MediaType by lazy { MediaType(IMAGE, "svg+xml") } +val IMAGE_ICO: MediaType by lazy { MediaType(IMAGE, "vnd.microsoft.icon") } +val IMAGE_WEBP: MediaType by lazy { MediaType(IMAGE, "webp") } +val IMAGE_AVIF: MediaType by lazy { MediaType(IMAGE, "avif") } + +val MULTIPART_ALTERNATIVE: MediaType by lazy { MediaType(MULTIPART, "alternative") } +val MULTIPART_APPLEDOUBLE: MediaType by lazy { MediaType(MULTIPART, "appledouble") } +val MULTIPART_DIGEST: MediaType by lazy { MediaType(MULTIPART, "digest") } +val MULTIPART_MIXED: MediaType by lazy { MediaType(MULTIPART, "mixed") } +val MULTIPART_PARALLEL: MediaType by lazy { MediaType(MULTIPART, "parallel") } + +val TEXT_CSV: MediaType by lazy { MediaType(TEXT, "csv") } +val TEXT_X_JAVA_PROPERTIES: MediaType by lazy { MediaType(TEXT, "x-java-properties") } +val TEXT_JAVASCRIPT: MediaType by lazy { MediaType(TEXT, "javascript") } +val TEXT_CSS: MediaType by lazy { MediaType(TEXT, "css") } +val TEXT_HTML: MediaType by lazy { MediaType(TEXT, "html") } +val TEXT_MARKDOWN: MediaType by lazy { MediaType(TEXT, "markdown") } +val TEXT_PLAIN: MediaType by lazy { MediaType(TEXT, "plain") } +val TEXT_RICHTEXT: MediaType by lazy { MediaType(TEXT, "richtext") } +val TEXT_TAB_SEPARATED_VALUES: MediaType by lazy { MediaType(TEXT, "tab-separated-values") } +val TEXT_CALENDAR: MediaType by lazy { MediaType(TEXT, "calendar") } +val TEXT_EVENT_STREAM: MediaType by lazy { MediaType(TEXT, "event-stream") } + +val VIDEO_MPEG: MediaType by lazy { MediaType(VIDEO, "mpeg") } +val VIDEO_QUICKTIME: MediaType by lazy { MediaType(VIDEO, "quicktime") } +val VIDEO_X_MSVIDEO: MediaType by lazy { MediaType(VIDEO, "x-msvideo") } +val VIDEO_MP4: MediaType by lazy { MediaType(VIDEO, "mp4") } +val VIDEO_OGG: MediaType by lazy { MediaType(VIDEO, "ogg") } +val VIDEO_WEBM: MediaType by lazy { MediaType(VIDEO, "webm") } val DEFAULT_MEDIA_TYPE: MediaType by lazy { APPLICATION_OCTET_STREAM } From 5a0fa4be3e97d1b0e98cb9202428b70db869d6ea Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 17:54:29 +0200 Subject: [PATCH 07/10] Add utility method --- core/api/core.api | 1 + core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/api/core.api b/core/api/core.api index aacd630aea..09c5db896a 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -407,6 +407,7 @@ public final class com/hexagonkt/core/media/MediaTypesKt { public static final fun mediaTypeOfOrNull (Ljava/net/URL;)Lcom/hexagonkt/core/media/MediaType; public static final fun mediaTypeOfOrNull (Ljava/nio/file/Path;)Lcom/hexagonkt/core/media/MediaType; public static final fun parseMediaType (Ljava/lang/String;)Lcom/hexagonkt/core/media/MediaType; + public static final fun pathExtension (Ljava/lang/String;)Ljava/lang/String; } public final class com/hexagonkt/core/security/CryptoKt { diff --git a/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt b/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt index 2011293fa4..b61a20bd09 100644 --- a/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt +++ b/core/src/main/kotlin/com/hexagonkt/core/media/MediaTypes.kt @@ -242,5 +242,5 @@ fun mediaTypeOf(extension: String): MediaType = fun extensionsOf(mediaType: MediaType): List = EXTENSIONS_BY_MEDIA[mediaType] ?: emptyList() -private fun pathExtension(path: String): String = +fun pathExtension(path: String): String = path.substringAfterLast('.') From 704499eb6a7dea58e08baad50f66ff3091a7d175 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 18:05:24 +0200 Subject: [PATCH 08/10] Disable not needed native tests --- http/http_test/build.gradle.kts | 1 - http/http_test_async/build.gradle.kts | 1 - serialization/serialization_test/build.gradle.kts | 1 - templates/templates_test/build.gradle.kts | 1 - 4 files changed, 4 deletions(-) diff --git a/http/http_test/build.gradle.kts b/http/http_test/build.gradle.kts index 9d58b097f5..8e3cc0e9e7 100644 --- a/http/http_test/build.gradle.kts +++ b/http/http_test/build.gradle.kts @@ -7,7 +7,6 @@ plugins { apply(from = "$rootDir/gradle/kotlin.gradle") apply(from = "$rootDir/gradle/publish.gradle") apply(from = "$rootDir/gradle/dokka.gradle") -apply(from = "$rootDir/gradle/native.gradle") apply(from = "$rootDir/gradle/detekt.gradle") apply(from = "$rootDir/gradle/jmh.gradle") diff --git a/http/http_test_async/build.gradle.kts b/http/http_test_async/build.gradle.kts index 7dc5b18470..5a76b0d7d4 100644 --- a/http/http_test_async/build.gradle.kts +++ b/http/http_test_async/build.gradle.kts @@ -7,7 +7,6 @@ plugins { apply(from = "$rootDir/gradle/kotlin.gradle") apply(from = "$rootDir/gradle/publish.gradle") apply(from = "$rootDir/gradle/dokka.gradle") -apply(from = "$rootDir/gradle/native.gradle") apply(from = "$rootDir/gradle/detekt.gradle") description = "Test cases for HTTP client and server adapters." diff --git a/serialization/serialization_test/build.gradle.kts b/serialization/serialization_test/build.gradle.kts index 12180efe5d..95e1dd591d 100644 --- a/serialization/serialization_test/build.gradle.kts +++ b/serialization/serialization_test/build.gradle.kts @@ -6,7 +6,6 @@ plugins { apply(from = "$rootDir/gradle/kotlin.gradle") apply(from = "$rootDir/gradle/publish.gradle") apply(from = "$rootDir/gradle/dokka.gradle") -apply(from = "$rootDir/gradle/native.gradle") apply(from = "$rootDir/gradle/detekt.gradle") description = "Hexagon serialization testing helpers." diff --git a/templates/templates_test/build.gradle.kts b/templates/templates_test/build.gradle.kts index 12ddf6da19..87f88d09da 100644 --- a/templates/templates_test/build.gradle.kts +++ b/templates/templates_test/build.gradle.kts @@ -6,7 +6,6 @@ plugins { apply(from = "$rootDir/gradle/kotlin.gradle") apply(from = "$rootDir/gradle/publish.gradle") apply(from = "$rootDir/gradle/dokka.gradle") -apply(from = "$rootDir/gradle/native.gradle") apply(from = "$rootDir/gradle/detekt.gradle") dependencies { From 4b6e5ddee01fde0bdc9b564f009cc043081abda3 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 19:09:14 +0200 Subject: [PATCH 09/10] Fix build --- .github/workflows/nightly.yml | 2 +- .github/workflows/pull_request.yml | 2 +- .github/workflows/site.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 79a06c7dd1..e7273bc299 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -95,4 +95,4 @@ jobs: os: ${{ matrix.os }} ref: develop check_directory: core/build - tasks: publishToMavenLocal -x test + tasks: publishToMavenLocal -x test -x apiDump diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8a004c49bf..e053233d58 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -30,4 +30,4 @@ jobs: uses: hexagonkt/.github/.github/workflows/graalvm_gradle.yml@master with: check_directory: core/build - tasks: publishToMavenLocal -x test + tasks: publishToMavenLocal -x test -x apiDump diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 9abb831580..a635ef6a15 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -57,7 +57,7 @@ jobs: run: ./gradlew --info --stacktrace build - name: Build Site - run: ./gradlew --info --stacktrace -x build buildSite + run: ./gradlew --info --stacktrace -x build buildSite -x apiDump - name: Check Build if: ${{ inputs.check_directory != '' }} From 6a8c9024789410cff14d72cb2f82950af34b010d Mon Sep 17 00:00:00 2001 From: jaguililla Date: Mon, 19 Jun 2023 19:36:50 +0200 Subject: [PATCH 10/10] Fix build --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e053233d58..0e3183ae44 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -22,7 +22,7 @@ jobs: build_site: name: Build Site permissions: read-all - uses: hexagonkt/hexagon/.github/workflows/site.yml@master + uses: hexagonkt/hexagon/.github/workflows/site.yml@develop test_publishing: name: Test Publishing