Skip to content

Commit 90eb483

Browse files
piierthoCedNaru
andauthored
Bugfix/ios lib path and graal jni config (#840)
* fix: Set right ios static user library path and adapt graal jni config for new bootstrap * Update and fix graal jni config --------- Co-authored-by: CedNaru <cednaru.dev@gmail.com>
1 parent a11c563 commit 90eb483

File tree

7 files changed

+44
-18
lines changed

7 files changed

+44
-18
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package godot.common
2+
3+
const val GODOT_KOTLIN_VERSION = "0.13.1-4.4.1"

kt/godot-library/godot-core-library/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ java {
2626
dependencies {
2727
api("com.utopia-rise:common:$fullGodotKotlinJvmVersion")
2828
implementation(project(":godot-internal-library"))
29-
implementation(project(":godot-build-props"))
3029

3130
testImplementation("junit", "junit", "4.12")
3231
testImplementation("com.utopia-rise:common:$fullGodotKotlinJvmVersion")

kt/godot-library/godot-core-library/src/main/kotlin/godot/runtime/Bootstrap.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package godot.runtime
22

3+
import godot.common.GODOT_KOTLIN_VERSION
34
import godot.core.KtClass
45
import godot.core.VariantParser
56
import godot.core.variantMapper
67
import godot.internal.logging.JVMLogging
78
import godot.internal.reflection.TypeManager
89
import godot.registration.ClassRegistry
910
import godot.registration.Entry
10-
import godot.utils.GodotBuildProperties
1111
import java.util.*
1212

1313

@@ -25,11 +25,11 @@ internal class Bootstrap {
2525
initializeUsingEntry()
2626
}
2727

28-
fun getVersion(): String{
28+
fun getVersion(): String {
2929
// we cannot use the assembled version here as it includes the git hash on local dev builds which is not present
3030
// on the cpp side
3131
// hence we assemble it manually here
32-
return "${GodotBuildProperties.godotKotlinJvmVersion}-${GodotBuildProperties.godotVersion}"
32+
return GODOT_KOTLIN_VERSION
3333
}
3434

3535
fun finish() {

kt/plugins/godot-gradle-plugin/src/main/resources/godot/gradle/godot-kotlin-graal-jni-config.json

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
{ "name" : "INSTANCE" }
6060
],
6161
"methods" : [
62-
{ "name" : "getMethodBindPtr$godot_library", "parameterTypes" : ["java.lang.String", "java.lang.String", "long"] }
62+
{ "name" : "getMethodBindPtr", "parameterTypes" : ["java.lang.String", "java.lang.String", "long"] }
6363
]
6464
},
6565
{
@@ -331,7 +331,10 @@
331331
{ "name" : "engine_call_to_float64_array", "parameterTypes" : ["long"] },
332332
{ "name" : "engine_call_to_int32_array", "parameterTypes" : ["long"] },
333333
{ "name" : "engine_call_to_int64_array", "parameterTypes" : ["long"] },
334-
{ "name" : "engine_call_size", "parameterTypes" : ["long"] }
334+
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
335+
336+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["byte[]"] },
337+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
335338
]
336339
},
337340
{
@@ -399,7 +402,10 @@
399402
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
400403
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
401404
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
402-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
405+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
406+
407+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["float[]"] },
408+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
403409
]
404410
},
405411
{
@@ -433,7 +439,10 @@
433439
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
434440
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
435441
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
436-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
442+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
443+
444+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["double[]"] },
445+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
437446
]
438447
},
439448
{
@@ -467,7 +476,10 @@
467476
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
468477
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
469478
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
470-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
479+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
480+
481+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["int[]"] },
482+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
471483
]
472484
},
473485
{
@@ -501,7 +513,10 @@
501513
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
502514
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
503515
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
504-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
516+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
517+
518+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["long[]"] },
519+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
505520
]
506521
},
507522
{
@@ -569,7 +584,10 @@
569584
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
570585
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
571586
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
572-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
587+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
588+
589+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["float[]"] },
590+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
573591
]
574592
},
575593
{
@@ -603,7 +621,10 @@
603621
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
604622
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
605623
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
606-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
624+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
625+
626+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["float[]"] },
627+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
607628
]
608629
},
609630
{
@@ -637,7 +658,10 @@
637658
{ "name" : "engine_call_size", "parameterTypes" : ["long"] },
638659
{ "name" : "engine_call_slice", "parameterTypes" : ["long"] },
639660
{ "name" : "engine_call_sort", "parameterTypes" : ["long"] },
640-
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] }
661+
{ "name" : "engine_call_to_byte_array", "parameterTypes" : ["long"] },
662+
663+
{ "name" : "engine_convert_to_godot", "parameterTypes" : ["float[]"] },
664+
{ "name" : "engine_convert_to_jvm", "parameterTypes" : ["long"] }
641665
]
642666
},
643667
{
@@ -683,7 +707,9 @@
683707
{ "name" : "<init>", "parameterTypes" : [] },
684708
{ "name" : "loadClasses", "parameterTypes" : ["godot.core.KtClass[]"] },
685709
{ "name" : "registerManagedEngineTypes", "parameterTypes" : ["java.lang.String[]", "java.lang.String[]"] },
686-
{ "name" : "init", "parameterTypes": ["java.lang.String", "java.lang.String", "java.lang.ClassLoader"]},
710+
{ "name" : "initJar", "parameterTypes": ["java.lang.ClassLoader"]},
711+
{ "name" : "initNativeImage", "parameterTypes": []},
712+
{ "name" : "getVersion", "parameterTypes": []},
687713
{ "name" : "finish", "parameterTypes" : [] }
688714
]
689715
},
@@ -716,7 +742,6 @@
716742
{"name":"invokeNoReturn","parameterTypes":[] },
717743
{"name":"invokeWithReturn","parameterTypes":[] },
718744
{"name":"getReturnVariantType","parameterTypes":[] },
719-
{"name":"hashCode","parameterTypes":[] },
720745
{"name":"onCancel","parameterTypes":[] }
721746
]
722747
},

src/jvm_wrapper/kotlin_callable_custom.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ JVM_INSTANCE_WRAPPER(LambdaCallable, "godot.core.LambdaCallable") {
1111
JNI_VOID_METHOD(INVOKE_NO_RETURN)
1212
JNI_OBJECT_METHOD(INVOKE_WITH_RETURN)
1313
JNI_INT_METHOD(GET_RETURN_VARIANT_TYPE)
14-
JNI_INT_METHOD(HASH_CODE)
1514
JNI_VOID_METHOD(ON_CANCEL)
1615

1716
INIT_JNI_BINDINGS(
1817
INIT_JNI_METHOD(INVOKE_NO_RETURN, "invokeNoReturn", "()V")
1918
INIT_JNI_METHOD(INVOKE_WITH_RETURN, "invokeWithReturn", "()Ljava/lang/Object;")
2019
INIT_JNI_METHOD(GET_RETURN_VARIANT_TYPE, "getReturnVariantType", "()I")
21-
INIT_JNI_METHOD(HASH_CODE, "hashCode", "()I")
2220
INIT_JNI_METHOD(ON_CANCEL, "onCancel", "()V")
2321
)
2422

src/lifecycle/paths.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static constexpr const char* ANDROID_RELATIVE_JVM_LIB_PATH {""};
3636

3737
static constexpr const char* IOS_BOOTSTRAP_FILE {""};
3838
static constexpr const char* IOS_USER_CODE_FILE {""};
39-
static constexpr const char* IOS_GRAAL_NATIVE_IMAGE_FILE {JVM_DIRECTORY "usercode.a"};
39+
static constexpr const char* IOS_GRAAL_NATIVE_IMAGE_FILE {"usercode.a"};
4040
static constexpr const char* IOS_RELATIVE_JVM_LIB_PATH {""};
4141

4242
#ifdef X11_ENABLED

versionBumpGuide.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
When updating this project version, here the list of strings to changes:
22
- src/version.h: GODOT_KOTLIN_VERSION.
3+
- kt/common/src/main/kotlin/Version.kt: GODOT_KOTLIN_VERSION.
34
- kt/gradle/libs.versions.toml: godotKotlinJvm, kotlin and godot variables.
45
- docs/src/index.md: kotlin version, Full version, Module Version and Supported Godot Version fields in "Versioning" block.
56
- config.py: Change the String to "jvm-x.x.x".

0 commit comments

Comments
 (0)