This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle.kts
116 lines (103 loc) · 3.16 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.minecraftforge.gradle.user.IReobfuscator
import net.minecraftforge.gradle.user.ReobfMappingType.SEARGE
import net.minecraftforge.gradle.user.TaskSingleReobf
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("net.minecraftforge.gradle.forge") version "6f5327"
id("com.github.johnrengelman.shadow") version "6.1.0"
java
}
version = "1.1.0"
group = "mynameisjeff"
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_22"
makeObfSourceJar = false
isGitVersion = false
}
val shadowMe: Configuration by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}
repositories {
mavenCentral()
}
dependencies {
shadowMe(kotlin("stdlib-jdk8"))
//shadowMe(kotlin("reflect"))
shadowMe("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
shadowMe("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
}
sourceSets {
main {
output.setResourcesDir(file("${buildDir}/classes/kotlin/main"))
}
}
configure<NamedDomainObjectContainer<IReobfuscator>> {
clear()
create("shadowJar") {
mappingType = SEARGE
classpath = sourceSets.main.get().compileClasspath
}
}
tasks {
processResources {
inputs.property("version", project.version)
inputs.property("mcversion", project.minecraft.version)
filesMatching("mcmod.info") {
expand(mapOf("version" to project.version, "mcversion" to project.minecraft.version))
}
}
named<Jar>("jar") {
archiveBaseName.set("SkyblockClient-Updater")
manifest {
attributes(
mapOf(
"ModSide" to "CLIENT"
)
)
}
enabled = false
}
named<ShadowJar>("shadowJar") {
archiveFileName.set(jar.get().archiveFileName)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = listOf(shadowMe)
relocate("kotlinx.coroutines", "mynameisjeff.skyblockclientupdater.coroutines")
relocate("kotlinx.serialization", "mynameisjeff.skyblockclientupdater.json")
exclude(
"dummyThing",
"**/module-info.class",
"META-INF/versions/**"
)
mergeServiceFiles()
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
kotlinDaemonJvmArguments.set(
listOf(
"-Xmx2G",
"-Dkotlin.enableCacheBuilding=true",
"-Dkotlin.useParallelTasks=true",
"-Dkotlin.enableFastIncremental=true"
)
)
}
named<TaskSingleReobf>("reobfJar") {
enabled = false
}
named<TaskSingleReobf>("reobfShadowJar") {
mustRunAfter(shadowJar)
}
}
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8