-
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.
* Create common module used by godot-library and common-tools
- Loading branch information
Showing
806 changed files
with
13,941 additions
and
13,923 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
5 changes: 0 additions & 5 deletions
5
kt/api-generator/src/main/kotlin/godot/codegen/constants/GodotClassNames.kt
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSingleton.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
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,32 @@ | ||
import versioninfo.fullGodotKotlinJvmVersion | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.grgit) | ||
id("com.utopia-rise.godot-publish") | ||
id("com.utopia-rise.versioninfo") | ||
} | ||
|
||
// the version is not inherited from the root build.gradle.kts as this here is a separate gradle project. Hence, we set it | ||
// through the godot-dependencies plugin | ||
version = fullGodotKotlinJvmVersion | ||
group = "com.utopia-rise" | ||
|
||
kotlin { | ||
jvmToolchain(11) | ||
} | ||
|
||
publishing { | ||
publications { | ||
@Suppress("UNUSED_VARIABLE") | ||
val godotCommonGenerator by creating(MavenPublication::class) { | ||
pom { | ||
name.set(project.name) | ||
description.set("Godot common module other libraries.") | ||
} | ||
artifactId = project.name | ||
description = "Godot common module other libraries." | ||
from(components.getByName("java")) | ||
} | ||
} | ||
} |
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,30 @@ | ||
|
||
pluginManagement { | ||
includeBuild("../build-logic") | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
google() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
@Suppress("UnstableApiUsage") | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
plugins { | ||
// to automatically download the toolchain jdk if missing | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0" | ||
} |
4 changes: 2 additions & 2 deletions
4
...dot/tools/common/constants/Constraints.kt → ...lin/godot/common/constants/Constraints.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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package godot.tools.common.constants | ||
package godot.common.constants | ||
|
||
// when changed; also update constraints.h! | ||
// Since Godot 4, an unlimited amount of parameters is supported. Limits should be increased when appropriate. | ||
object Constraints { | ||
const val MAX_CONSTRUCTOR_ARG_COUNT = 8 | ||
const val MAX_FUNCTION_ARG_COUNT = 16 | ||
const val MAX_SIGNAL_ARG_COUNT = 8 | ||
const val MAX_SIGNAL_ARG_COUNT = 16 | ||
} |
2 changes: 1 addition & 1 deletion
2
...ols/common/extensions/StringExtensions.kt → ...dot/common/extensions/StringExtensions.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package godot.tools.common.extensions | ||
package godot.common.extensions | ||
|
||
import java.util.* | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
kt/common/src/main/kotlin/godot/common/interop/NativePointer.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,12 @@ | ||
package godot.common.interop | ||
|
||
typealias VoidPtr = Long | ||
const val nullptr: VoidPtr = 0L | ||
|
||
interface ValuePointer { | ||
val ptr: VoidPtr | ||
} | ||
|
||
interface IdentityPointer: ValuePointer { | ||
val objectID: ObjectID | ||
} |
4 changes: 3 additions & 1 deletion
4
...ry/src/main/kotlin/godot/core/ObjectID.kt → ...n/kotlin/godot/common/interop/ObjectID.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
4 changes: 2 additions & 2 deletions
4
...brary/src/main/kotlin/godot/util/Cache.kt → ...rc/main/kotlin/godot/common/util/Cache.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
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,3 @@ | ||
package godot.common.util | ||
|
||
inline fun <reified T> isNullable(): Boolean = null is T |
6 changes: 3 additions & 3 deletions
6
...kotlin/godot/util/ThreadLocalDelegates.kt → ...godot/common/util/ThreadLocalDelegates.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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package godot.util | ||
package godot.common.util | ||
|
||
import kotlin.reflect.KProperty | ||
|
||
internal class ThreadLocalDelegate<T>(val provider: () -> T) { | ||
class ThreadLocalDelegate<T>(val provider: () -> T) { | ||
private val threadLocal = ThreadLocal.withInitial { provider() } | ||
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = threadLocal.get() | ||
} | ||
|
||
internal fun <T> threadLocal(provider: () -> T) = ThreadLocalDelegate(provider) | ||
fun <T> threadLocal(provider: () -> T) = ThreadLocalDelegate(provider) |
Oops, something went wrong.