-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - add RuntimeHints, and reflection bindings.
nativeRun
still fa…
…iling. Readings: - https://www.graalvm.org/22.2/reference-manual/native-image/guides/use-native-image-gradle-plugin/ - https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.advanced.custom-hints - https://github.com/oracle/graalvm-reachability-metadata - spring-projects/spring-boot#34157 - https://docs.spring.io/spring-framework/reference/core/aot.html#aot.hints.register-reflection-for-binding - https://docs.spring.io/spring-framework/reference/core/aot.html - https://betterprogramming.pub/experience-in-migrating-an-application-to-native-image-with-spring-boot-3-422d15efa31
- Loading branch information
1 parent
a3eecb1
commit fa152a4
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/main/kotlin/io/github/reactivecircus/kstreamlined/backend/KSConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/kotlin/io/github/reactivecircus/kstreamlined/backend/KStreamlinedRuntimeHints.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.github.reactivecircus.kstreamlined.backend | ||
|
||
import org.springframework.aot.hint.ExecutableMode | ||
import org.springframework.aot.hint.RuntimeHints | ||
import org.springframework.aot.hint.RuntimeHintsRegistrar | ||
import org.springframework.aot.hint.TypeReference | ||
|
||
object KStreamlinedRuntimeHints : RuntimeHintsRegistrar { | ||
override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) { | ||
hints.reflection() | ||
.registerType( | ||
TypeReference.of("com.github.benmanes.caffeine.cache.SSA") | ||
) { builder -> | ||
builder.withConstructor( | ||
listOf( | ||
TypeReference.of("com.github.benmanes.caffeine.cache.Caffeine"), | ||
TypeReference.of("com.github.benmanes.caffeine.cache.AsyncCacheLoader"), | ||
TypeReference.of("boolean"), | ||
), | ||
ExecutableMode.INVOKE, | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters