Skip to content

Commit

Permalink
Merge pull request #636 from hexagonkt/develop
Browse files Browse the repository at this point in the history
Minor API adjustments
  • Loading branch information
jaguililla authored Jun 20, 2023
2 parents e38e1c9 + 6a8c902 commit 0898782
Show file tree
Hide file tree
Showing 33 changed files with 248 additions and 478 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ jobs:
os: ${{ matrix.os }}
ref: develop
check_directory: core/build
tasks: publishToMavenLocal -x test
tasks: publishToMavenLocal -x test -x apiDump
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ 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
permissions: read-all
uses: hexagonkt/.github/.github/workflows/graalvm_gradle.yml@master
with:
check_directory: core/build
tasks: publishToMavenLocal -x test
tasks: publishToMavenLocal -x test -x apiDump
2 changes: 1 addition & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '' }}
Expand Down
17 changes: 13 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -130,16 +130,25 @@ gradle.taskGraph.whenReady(closureOf<TaskExecutionGraph> {
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",
"rest_tools",
"web",
)
)
validationDisabled = !file("api").isDirectory
}
4 changes: 3 additions & 1 deletion core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -406,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 {
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/kotlin/com/hexagonkt/core/ClasspathHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, URLStreamHandler> = mapOf("classpath" to this)
private val classLoader: ClassLoader by lazy { Thread.currentThread().contextClassLoader }
private val protocolHandlers: Map<String, URLStreamHandler> by lazy {
mapOf("classpath" to this)
}

override fun openConnection(url: URL): URLConnection =
classLoader.getResource(url.path)?.openConnection()
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/kotlin/com/hexagonkt/core/Network.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/kotlin/com/hexagonkt/core/Strings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
Expand Down
Loading

0 comments on commit 0898782

Please sign in to comment.