-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
46 lines (41 loc) · 1.19 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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")
rootProject.name = "korge-hello-world"