-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore/cherry pick from godot 3 version (#457)
* Fix typo in your-first-class doc (#378) * Generate `.gdignore` files for the `build` and the `gradle` directories (#366) * Add task to generate `.gdignore` files for the `build` and the `gradle` directories * Improve task setup and add jre folders to ignored folders * Implement generics check (#375) This check verifies that the user does not try to register any generic types as these won't compile * enh: Move jvm types registration code from GDKotlin to TypeManager (#357) * Export android x86_64 target (#381) * Export android x86_64 target * Fix path for debug builds (cherry picked from commit b57ab94) # Conflicts: # .github/actions/create-android-export-template/action.yaml # .github/workflows/check-pr-engine-export-template-debug.yaml # .github/workflows/check-pr-engine-export-template-release.yaml # .github/workflows/deploy-export-template.yaml * Improve changelog header to be more explict about which files are for what (#392) (cherry picked from commit c741582) * Fix constructor with generic args registration (#396) * Fix registration of constructors with multiple args * Add test class (cherry picked from commit 6384dc4) * Fix reflection usage in usercode (#452) * Add `kotlin-reflect` dependency to godot-library * Temporarily fix scons version * Add graal reflection configuration file option and update comment on existing option * Add additional graal options needed for reflection to work and also commit the standard configuration for kotlin-reflection (cherry picked from commit c273de5) --------- Co-authored-by: Cristian Heitt <[email protected]> Co-authored-by: Pierre-Thomas Meisels <[email protected]>
- Loading branch information
1 parent
8d8970b
commit d9484a6
Showing
38 changed files
with
448 additions
and
90 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
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
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
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
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
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
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
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
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,22 @@ | ||
[ | ||
{ | ||
"name": "kotlin.reflect.jvm.internal.ReflectionFactoryImpl", | ||
"allDeclaredConstructors":true | ||
}, | ||
{ | ||
"name": "kotlin.KotlinVersion", | ||
"allPublicMethods": true, | ||
"allDeclaredFields":true, | ||
"allDeclaredMethods":true, | ||
"allDeclaredConstructors":true | ||
}, | ||
{ | ||
"name": "kotlin.KotlinVersion[]" | ||
}, | ||
{ | ||
"name": "kotlin.KotlinVersion$Companion" | ||
}, | ||
{ | ||
"name": "kotlin.KotlinVersion$Companion[]" | ||
} | ||
] |
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,7 @@ | ||
{ | ||
"resources":[ | ||
{"pattern":"META-INF/.*.kotlin_module$"}, | ||
{"pattern":"META-INF/services/.*"}, | ||
{"pattern":".*.kotlin_builtins"} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
harness/tests/src/main/kotlin/godot/tests/constructor/ConstructorRegistrationTest.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,14 @@ | ||
package godot.tests.constructor | ||
|
||
import godot.Node | ||
import godot.annotation.RegisterClass | ||
import godot.annotation.RegisterConstructor | ||
import godot.core.Dictionary | ||
import godot.core.VariantArray | ||
|
||
@RegisterClass | ||
class ConstructorRegistrationTest(): Node() { | ||
|
||
@RegisterConstructor | ||
constructor(param1: Dictionary<Any, Any?>, param2: VariantArray<Long>): this() | ||
} |
15 changes: 15 additions & 0 deletions
15
harness/tests/src/main/kotlin/godot/tests/reflection/BaseReflectionTest.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,15 @@ | ||
package godot.tests.reflection | ||
|
||
import godot.Node | ||
import godot.annotation.RegisterClass | ||
import godot.annotation.RegisterFunction | ||
import kotlin.reflect.full.hasAnnotation | ||
|
||
@RegisterClass | ||
class BaseReflectionTest: Node() { | ||
|
||
@RegisterFunction | ||
fun hasRegisterClassAnnotation(): Boolean { | ||
return BaseReflectionTest::class.hasAnnotation<RegisterClass>() | ||
} | ||
} |
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,7 @@ | ||
extends "res://addons/gut/test.gd" | ||
|
||
|
||
func test_reflection_working() -> void: | ||
var reflection_test_script = load("res://src/main/kotlin/godot/tests/reflection/BaseReflectionTest.kt").new() | ||
assert_true(reflection_test_script.has_register_class_annotation(), "Should return true without throwing an exception") | ||
reflection_test_script.free() |
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
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
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
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
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
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
Oops, something went wrong.