-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
75 lines (65 loc) · 2.47 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
plugins {
`maven-publish`
kotlin("jvm") version "2.0.0"
kotlin("plugin.serialization") version "2.0.0"
id("com.github.johnrengelman.shadow") version "8+"
}
val kotlinVersion: String by project
val coroutinesVersion: String by project
val serializationVersion: String by project
val kteVer: String by project
val shadow: Configuration = configurations["shadow"]
group = "team.0mods"
version = kteVer
repositories {
mavenCentral()
}
configurations {
implementation.get().extendsFrom(this["shadow"])
}
dependencies {
shadow(kotlin("stdlib", kotlinVersion))
shadow(kotlin("stdlib-jdk7", kotlinVersion))
shadow(kotlin("stdlib-jdk8", kotlinVersion))
shadow(kotlin("stdlib-common", kotlinVersion))
shadow(kotlinx("coroutines-core", coroutinesVersion))
shadow(kotlinx("coroutines-core-jvm", coroutinesVersion))
shadow(kotlinx("coroutines-jdk8", coroutinesVersion))
shadow(kotlinx("serialization-core", serializationVersion))
shadow(kotlinx("serialization-json", serializationVersion))
shadow(kotlinx("serialization-json-jvm", serializationVersion))
shadow(kotlinx("serialization-json-okio", serializationVersion))
shadow(kotlinx("serialization-hocon", serializationVersion))
shadow(kotlinx("serialization-protobuf", serializationVersion))
shadow(kotlinx("serialization-cbor", serializationVersion))
shadow(kotlinx("serialization-properties", serializationVersion))
}
tasks.shadowJar {
archiveClassifier.set("")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = listOf(shadow)
exclude(
"LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**",
"META-INF/*.RSA", "META-INF/*.SF", "META-INF/versions/**"
)
}
tasks.build.get().finalizedBy("shadowJar")
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components.getByName("java"))
artifactId = project.base.archivesName.get()
}
}
repositories {
maven {
url = uri("https://maven.0mods.team/releases")
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
fun DependencyHandler.kotlinx(module: String, version: String? = null): Any = kotlinxModule("kotlinx-$module", version)
fun DependencyHandler.kotlinxModule(module: String, version: String? = null): Any = "org.jetbrains.kotlinx:$module${version?.let { ":$version" } ?: ""}"