forked from Avanatiker/WorldTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (74 loc) · 2.61 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.RemapJarTask
plugins {
kotlin("jvm") version ("1.9.22")
id("architectury-plugin") version "3.4-SNAPSHOT"
id("dev.architectury.loom") version "1.5-SNAPSHOT" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
}
architectury {
minecraft = project.properties["minecraft_version"]!! as String
}
subprojects {
apply(plugin = "dev.architectury.loom")
dependencies {
"minecraft"("com.mojang:minecraft:${project.properties["minecraft_version"]!!}")
"mappings"("net.fabricmc:yarn:${project.properties["yarn_mappings"]}:v2")
}
if (path != ":common") {
apply(plugin = "com.github.johnrengelman.shadow")
val shadowCommon by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
}
val versionWithMCVersion = "${project.properties["mod_version"]!!}+${project.properties["minecraft_version"]!!}"
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 17
}
tasks {
val shadowJarTask = named("shadowJar", ShadowJar::class)
shadowJarTask {
archiveVersion = versionWithMCVersion
archiveClassifier.set("shadow")
configurations = listOf(shadowCommon)
}
"remapJar"(RemapJarTask::class) {
dependsOn(shadowJarTask)
inputFile = shadowJarTask.flatMap { it.archiveFile }
archiveVersion = versionWithMCVersion
archiveClassifier = ""
}
jar {
enabled = false
}
}
}
}
allprojects {
apply(plugin = "java")
apply(plugin = "architectury-plugin")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.kotlin.jvm")
base.archivesName.set(project.properties["archives_base_name"]!! as String)
group = project.properties["maven_group"]!!
version = project.properties["mod_version"]!!
repositories {
maven("https://api.modrinth.com/maven")
maven("https://jitpack.io")
maven("https://server.bbkr.space/artifactory/libs-release") {
name = "CottonMC"
}
maven("https://maven.shedaniel.me/")
maven("https://maven.terraformersmc.com/releases/")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
}
tasks.withType(JavaCompile::class.java) {
options.encoding = "UTF-8"
options.release = 17
}
}