From 599eebe996aa6e06737c0531144c0961089b0913 Mon Sep 17 00:00:00 2001 From: Ellen Arteca Date: Tue, 17 Sep 2024 14:02:56 -0700 Subject: [PATCH] Fixing hardcoded library path in some kotlin templates (#691) Co-authored-by: Ellen Arteca --- tool/templates/kotlin/Enum.kt.jinja | 2 +- tool/templates/kotlin/Struct.kt.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/templates/kotlin/Enum.kt.jinja b/tool/templates/kotlin/Enum.kt.jinja index 0fa311a68..331c3ca9f 100644 --- a/tool/templates/kotlin/Enum.kt.jinja +++ b/tool/templates/kotlin/Enum.kt.jinja @@ -42,7 +42,7 @@ enum class {{type_name}} companion object { internal val libClass: Class<{{type_name}}Lib> = {{type_name}}Lib::class.java - internal val lib: {{type_name}}Lib = Native.load("somelib", libClass) + internal val lib: {{type_name}}Lib = Native.load("{{lib_name}}", libClass) {%- match (variants_for_native) %} {%- when EnumVariants::NonContiguous with (variants) %} diff --git a/tool/templates/kotlin/Struct.kt.jinja b/tool/templates/kotlin/Struct.kt.jinja index 37dfec54d..e8c75f2b6 100644 --- a/tool/templates/kotlin/Struct.kt.jinja +++ b/tool/templates/kotlin/Struct.kt.jinja @@ -51,7 +51,7 @@ class {{type_name}} internal constructor ( {% if !fields.is_empty() -%} companion object { internal val libClass: Class<{{type_name}}Lib> = {{type_name}}Lib::class.java - internal val lib: {{type_name}}Lib = Native.load("somelib", libClass) + internal val lib: {{type_name}}Lib = Native.load("{{lib_name}}", libClass) val NATIVESIZE: Long = Native.getNativeSize({{type_name}}Native::class.java).toLong() {%- for m in companion_methods %} {{m|indent(8)}}