Skip to content

Commit

Permalink
Add Internal module (#729)
Browse files Browse the repository at this point in the history
* Rename godot-library to godot-core-library
* Create godot internal library module and move several classes to it
* Change interaction between MemoryManager and KtObject
* Move some methods from MemoryManager to KtObject
  • Loading branch information
CedNaru authored Nov 6, 2024
1 parent 925dcf8 commit baba396
Show file tree
Hide file tree
Showing 1,071 changed files with 3,039 additions and 2,935 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build_jvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: jvm_godot-bootstrap_release
path: modules/kotlin_jvm/kt/godot-library/build/libs/godot-bootstrap.jar
path: modules/kotlin_jvm/kt/godot-core-library/build/libs/godot-bootstrap.jar

- name: Upload debug bootstrap artifact
uses: actions/upload-artifact@v4
with:
name: jvm_godot-bootstrap_debug
path: modules/kotlin_jvm/kt/godot-core-library/build/libs/godot-bootstrap.jar

- name: Upload entry-generator artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -95,12 +101,6 @@ jobs:
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ build -Pdebug
- name: Upload debug bootstrap artifact
uses: actions/upload-artifact@v4
with:
name: jvm_godot-bootstrap_debug
path: modules/kotlin_jvm/kt/godot-library/build/libs/godot-bootstrap.jar

- name: Verify ide plugin
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ verifyPlugin
18 changes: 14 additions & 4 deletions .github/workflows/deploy_jvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,25 @@ jobs:
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-kotlin-symbol-processor:publish
- name: Publish godot-library debug
- name: Publish godot-internal-library debug
shell: sh
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-library:publish -Pdebug
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-internal-library:publish -Pdebug
- name: Publish godot-library release
- name: Publish godot-internal-library release
shell: sh
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-library:publish -Prelease
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-internal-library:publish -Prelease
- name: Publish godot-core-library debug
shell: sh
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-core-library:publish -Pdebug
- name: Publish godot-core-library release
shell: sh
run: |
modules/kotlin_jvm/kt/gradlew -p modules/kotlin_jvm/kt/ :godot-core-library:publish -Prelease
- name: Publish godot-coroutine-library debug
shell: sh
Expand Down
4 changes: 2 additions & 2 deletions docs/src/doc/contribution/knowledge-base/memory-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ the counter of the C++ `RefCounted` and free it.

### Cyclical references

`Wrapper` and `Script Instance` all holds references to each other, linking their lifetimes to each other.
`Wrapper` and `Script Instance` can hold references to each other, linking their lifetimes.
Even if the manager can freely switch between wrapper and script instance when necessary, this is not the case for regular user code.
Someone can hold a reference to a wrapper when another part of the code is going to set a script on the native object, creating a script instance in the process.
In such case, we need to make sure that this wrapper reference can also keep the script alive.
In such case, we need to make sure that this older wrapper reference can also keep the new script alive.
3 changes: 2 additions & 1 deletion harness/flattened-library-tests/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-core-library-debug")).using(project(":godot-core-library"))
substitute(module("com.utopia-rise:godot-core-library-release")).using(project(":godot-core-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
3 changes: 2 additions & 1 deletion harness/fqname-library-tests/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-core-library-debug")).using(project(":godot-core-library"))
substitute(module("com.utopia-rise:godot-core-library-release")).using(project(":godot-core-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
3 changes: 2 additions & 1 deletion harness/hierarchical-library-tests/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-core-library-debug")).using(project(":godot-core-library"))
substitute(module("com.utopia-rise:godot-core-library-release")).using(project(":godot-core-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
2 changes: 2 additions & 0 deletions harness/tests/FreeformRegistrationFileTestClass.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-Bold.ttf-9d8fef4d357af5b52cd60af
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-BoldItalic.ttf-4274bf704d3d6b9cd
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-Italic.ttf-9989590b02137b799e13d
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-Regular.ttf-856c843fd6f89964d2ca
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-Bold.ttf-1f003c66d63ebed70964e77
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-BoldItalic.ttf-65ebcc61dd5e1dfa8
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-Italic.ttf-baa9156a73770735a0f72
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-Regular.ttf-3babe7e4a7a588dfc9a8
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
1 change: 1 addition & 0 deletions harness/tests/addons/gut/fonts/LobsterTwo-Bold.ttf.import
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-Bold.ttf-7c7f734103b58a32491a47881
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-BoldItalic.ttf-227406a33e84448e6aa
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-Italic.ttf-f93abf6c25390c85ad5fb6c
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-Regular.ttf-f3fcfa01cd671c8da433dd
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/CopyModificationCheckTestClass.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/CoreTypePropertyChecks.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/ScriptInOtherSourceDir.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/godot/tests/CoreTypesIdentityTest.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/godot/tests/FuncRefTest.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
3 changes: 3 additions & 0 deletions harness/tests/scripts/godot/tests/Invocation.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down Expand Up @@ -40,6 +42,7 @@ properties = [
nav_meshes_dictionary,
nullable_dictionary,
color,
rid,
packed_byte_array,
packed_int32_array,
packed_float64_array,
Expand Down
5 changes: 4 additions & 1 deletion harness/tests/scripts/godot/tests/JavaTestClass.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand All @@ -30,7 +32,8 @@ properties = [
dictionary
]
functions = [
greeting,
_ready,
greeting,
connect_and_trigger_signal,
signal_callback
]
2 changes: 2 additions & 0 deletions harness/tests/scripts/godot/tests/LambdaCallableTest.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/godot/tests/binding/BindingA.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/godot/tests/binding/BindingB.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
2 changes: 2 additions & 0 deletions harness/tests/scripts/godot/tests/binding/BindingTest.gdj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ baseType = Object
supertypes = [
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ supertypes = [
godot.Node,
godot.Object,
godot.core.KtObject,
godot.common.interop.NativeWrapper,
godot.common.interop.NativePointer,
kotlin.Any
]
signals = [
Expand Down
Loading

0 comments on commit baba396

Please sign in to comment.