diff --git a/build.gradle.kts b/build.gradle.kts index 4588896..f64aded 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,29 +1,14 @@ import korlibs.korge.gradle.* -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { - //alias(libs.plugins.korge) - //id("com.soywiz.korge") version "999.0.0.999" - id("com.soywiz.korge") version "4.0.8" + alias(libs.plugins.korge) } korge { id = "org.korge.samples.mymodule" -// To enable all targets at once - - //targetAll() - -// To enable targets based on properties/environment variables - //targetDefault() - -// To selectively enable targets - targetJvm() targetJs() - targetDesktop() - targetDesktopCross() targetIos() targetAndroidDirect() serializationJson() @@ -33,20 +18,6 @@ dependencies { add("commonMainApi", project(":deps")) } -// @TODO: Remove after KorGE 4.0.1 is used -project.tasks.withType(org.gradle.api.tasks.testing.AbstractTestTask::class.java).all { - testLogging { - events = mutableSetOf( - //TestLogEvent.STARTED, TestLogEvent.PASSED, - TestLogEvent.SKIPPED, - TestLogEvent.FAILED, - TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR - ) - exceptionFormat = TestExceptionFormat.FULL - showStackTraces = true - showStandardStreams = true - } -} subprojects { if (this.name == "luak") { apply(plugin = "maven-publish") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..9e07fb5 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,3 @@ +[plugins] +korge = { id = "com.soywiz.korge", version = "5.0.2" } +#korge = { id = "com.soywiz.korge", version = "999.0.0.999" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 774fae8..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index dabd850..19ae73f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,10 +1,23 @@ -pluginManagement { repositories { mavenLocal(); mavenCentral(); google(); gradlePluginPortal() } } - -plugins { - //id("com.soywiz.kproject.settings") version "0.0.1-SNAPSHOT" - id("com.soywiz.kproject.settings") version "0.3.1" +pluginManagement { + repositories { mavenLocal(); mavenCentral(); google(); gradlePluginPortal() } } -rootProject.name = "${rootDir.name}-example" +buildscript { + val libsTomlFile = File(this.sourceFile?.parentFile, "gradle/libs.versions.toml").readText() + var plugins = false + var version = "" + for (line in libsTomlFile.lines().map { it.trim() }) { + if (line.startsWith("#")) continue + if (line.startsWith("[plugins]")) plugins = true + if (plugins && line.startsWith("korge") && Regex("^korge\\s*=.*").containsMatchIn(line)) version = Regex("version\\s*=\\s*\"(.*?)\"").find(line)?.groupValues?.get(1) ?: error("Can't find korge version") + } + if (version.isEmpty()) error("Can't find korge version in $libsTomlFile") + + repositories { mavenLocal(); mavenCentral(); google(); gradlePluginPortal() } + + dependencies { + classpath("com.soywiz.korge.settings:com.soywiz.korge.settings.gradle.plugin:$version") + } +} -kproject("./deps") +apply(plugin = "com.soywiz.korge.settings") diff --git a/src/commonMain/kotlin/Main.kt b/src/commonMain/kotlin/Main.kt index f0ea787..db26170 100644 --- a/src/commonMain/kotlin/Main.kt +++ b/src/commonMain/kotlin/Main.kt @@ -20,7 +20,7 @@ class MainLuaScene : Scene() { override suspend fun SContainer.sceneMain() { val globals = createLuaGlobals() - val textStack = uiVerticalStack(padding = 8f, adjustSize = false).xy(10, 10) + val textStack = uiVerticalStack(padding = 8.0, adjustSize = false).xy(10, 10) fun luaprintln(str: String) { println("LUA_PRINTLN: $str")