-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.gradle.kts
23 lines (19 loc) · 965 Bytes
/
settings.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pluginManagement {
repositories { mavenLocal(); mavenCentral(); google(); gradlePluginPortal()}
}
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")
}
}
apply(plugin = "com.soywiz.korge.settings")