forked from liplum/CyberIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
79 lines (76 loc) · 2.09 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import io.github.liplum.mindustry.minGameVersion
import net.liplum.gradle.settings.Settings.localConfig
plugins {
id("io.github.liplum.mgpp") version "1.1.9"
}
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://www.jitpack.io")
}
}
}
val settings = localConfig
allprojects {
group = "net.liplum"
version = "4.1"
repositories {
mavenCentral()
maven {
url = uri("https://www.jitpack.io")
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform {
excludeTags("slow")
}
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showStandardStreams = true
}
}
tasks.whenTaskAdded {
tasks.whenTaskAdded {
when (name) {
"kspKotlin" -> if (settings.env == "dev") enabled = false
}
}
}
}
mindustry {
dependency {
mindustry mirror "v136"
arc on "v136.1"
}
client {
/*mindustry from Foo(
version = "v8.0.0",
release = "erekir-client.jar"
)*/
mindustry official "v137"
clearUp
}
server {
mindustry official "v137"
}
}
tasks.register("retrieveMeta") {
doLast {
println("::set-output name=header::Cyber IO v$version on Mindustry v${mindustry.meta.minGameVersion}")
println("::set-output name=version::v$version")
try {
val releases = java.net.URL("https://api.github.com/repos/liplum/CyberIO/releases").readText()
val gson = com.google.gson.Gson()
val info = gson.fromJson<List<Map<String, Any>>>(releases, List::class.java)
val tagExisted = info.any {
it["tag_name"] == "v$version"
}
println("::set-output name=tag_exist::$tagExisted")
} catch (e: Exception) {
println("::set-output name=tag_exist::false")
logger.warn("Can't fetch the releases", e)
}
}
}