Skip to content

Commit

Permalink
Update to kotlin 2.0 (#641)
Browse files Browse the repository at this point in the history
* Update project to kotlin 2.0

* add .kotlin to gitignore files

* Fix compiler warnings

* Add missing gdj file

* Fix dependencySubstitutions

* Add missing files

* Add missing files
  • Loading branch information
chippmann committed Jun 5, 2024
1 parent ccef2c5 commit 993e0a3
Show file tree
Hide file tree
Showing 77 changed files with 300 additions and 111 deletions.
2 changes: 1 addition & 1 deletion docs/src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The main language supported is Kotlin. We do however support Java experimentally

This module relies on a Kotlin *compiler plugin* for registering your classes and members to Godot. As the compiler API from Kotlin is not stable yet, at the moment we can only support specific Kotlin version per release.

The current latest release is compatible with Kotlin version `1.9.23`.
The current latest release is compatible with Kotlin version `2.0.0`.

!!! info
It is possible to use this module with other Kotlin versions as well but we do not provide any guarantees for it. You find more infos in the [Gradle Plugin configuration](user-guide/advanced/gradle-plugin-configuration.md#disable-build-failure-on-kotlin-version-mismatch) section.
Expand Down
1 change: 1 addition & 0 deletions harness/benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle
.kotlin

# Ignore Gradle build output directory
build
Expand Down
27 changes: 27 additions & 0 deletions harness/benchmarks/gdj/godot/benchmark/Memory.gdj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = Memory
fqName = godot.benchmark.Memory
relativeSourcePath = src/main/kotlin/godot/benchmark/Memory.kt
baseType = Object
supertypes = [
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [

]
properties = [

]
functions = [
benchmark_access_obj,
benchmark_access_ref,
benchmark_access_core,
benchmark_stress_object,
benchmark_stress_reference,
benchmark_stress_core,
benchmark_stress_z_mix
]
27 changes: 27 additions & 0 deletions harness/benchmarks/gdj/godot/benchmark/Simple.gdj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = Simple
fqName = godot.benchmark.Simple
relativeSourcePath = src/main/kotlin/godot/benchmark/Simple.kt
baseType = Object
supertypes = [
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [

]
properties = [

]
functions = [
benchmark_simple_add,
benchmark_avg,
benchmark_vectors,
benchmark_vectors2_only,
benchmark_icall,
benchmark_icall_with_loop,
benchmark_method_call
]
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion harness/benchmarks/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ includeBuild("../../kt/api-generator") {
includeBuild("../../kt") {
dependencySubstitution {
substitute(module("com.utopia-rise:godot-gradle-plugin")).using(project(":godot-gradle-plugin"))
substitute(module("com.utopia-rise:godot-library")).using(project(":godot-library"))
substitute(module("com.utopia-rise:godot-library-debug")).using(project(":godot-library"))
substitute(module("com.utopia-rise:godot-library-release")).using(project(":godot-library"))
substitute(module("com.utopia-rise:godot-kotlin-symbol-processor")).using(project(":godot-kotlin-symbol-processor"))
substitute(module("com.utopia-rise:godot-entry-generator")).using(project(":godot-entry-generator"))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
godot.entry.EezGnCWebIfzEtNbhlSK.Entry
3 changes: 2 additions & 1 deletion harness/bunnymark/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ hs_err_pid*

build/

/.gradle/
/.gradle
.kotlin/

graal/godot-kotlin-graal-jni-config.json
Empty file.
2 changes: 1 addition & 1 deletion harness/bunnymark/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = BunnymarkV1DrawTexture
fqName = godot.benchmark.bunnymark.BunnymarkV1DrawTexture
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV1DrawTexture.kt
baseType = Node2D
supertypes = [
godot.Node2D,
godot.CanvasItem,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [
benchmark_finished
]
properties = [

]
functions = [
_ready,
_draw,
_process,
add_bunny,
remove_bunny,
finish
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = BunnymarkV1Sprites
fqName = godot.benchmark.bunnymark.BunnymarkV1Sprites
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV1Sprites.kt
baseType = Node2D
supertypes = [
godot.Node2D,
godot.CanvasItem,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [
benchmark_finished
]
properties = [

]
functions = [
_ready,
_process,
add_bunny,
remove_bunny,
finish
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = BunnymarkV2
fqName = godot.benchmark.bunnymark.BunnymarkV2
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV2.kt
baseType = Node2D
supertypes = [
godot.Node2D,
godot.CanvasItem,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [
benchmark_finished
]
properties = [

]
functions = [
_ready,
_process,
add_bunny,
remove_bunny,
finish
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = BunnymarkV3
fqName = godot.benchmark.bunnymark.BunnymarkV3
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV3.kt
baseType = Node2D
supertypes = [
godot.Node2D,
godot.CanvasItem,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [
benchmark_finished
]
properties = [

]
functions = [
_ready,
_process,
add_bunny,
remove_bunny,
finish
]
26 changes: 26 additions & 0 deletions harness/bunnymark/scripts/godot/benchmark/bunnymark/v3/Bunny.gdj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.

registeredName = Bunny
fqName = godot.benchmark.bunnymark.v3.Bunny
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/v3/Bunny.kt
baseType = Sprite2D
supertypes = [
godot.Sprite2D,
godot.Node2D,
godot.CanvasItem,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [

]
properties = [

]
functions = [
_ready,
_process
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
godot.entry.QWgLGqwxuGjRtFsdKSlL.Entry
1 change: 1 addition & 0 deletions harness/flattened-library-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle
.kotlin

# Ignore Gradle build output directory
build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions harness/fqname-library-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle
.kotlin

# Ignore Gradle build output directory
build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions harness/hierarchical-library-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle
.kotlin

# Ignore Gradle build output directory
build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions harness/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle
.kotlin

# Ignore Gradle build output directory
build
Expand Down
2 changes: 1 addition & 1 deletion harness/tests/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions harness/tests/scripts/ScriptInOtherSourceDir.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ fqName = ScriptInOtherSourceDir
relativeSourcePath = otherSourceDir/ScriptInOtherSourceDir.kt
baseType = Node
supertypes = [
godot.Node,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [
]
properties = [
]
functions = [
greeting
]
greeting
]
10 changes: 5 additions & 5 deletions harness/tests/scripts/godot/tests/FuncRefTest.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ fqName = godot.tests.FuncRefTest
relativeSourcePath = src/main/kotlin/godot/tests/FuncRefTest.kt
baseType = Node
supertypes = [
godot.Node,
godot.Node,
godot.Object,
godot.core.KtObject,
kotlin.Any
]
signals = [
test
test
]
properties = [
blubb,
blubb,
call_flag,
call_with_param_flag,
signal_call_flag
]
functions = [
_ready,
_ready,
test_signal_callback,
test_signal_call,
without_param_callback,
Expand All @@ -30,4 +30,4 @@ functions = [
with_param_callback,
test_call_with_param,
test_call_deferred_with_param
]
]
Loading

0 comments on commit 993e0a3

Please sign in to comment.