-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
117 lines (113 loc) · 3.71 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
117
plugins {
id("fabric-loom")
val kotlinVersion: String by System.getProperties()
kotlin("jvm").version(kotlinVersion)
}
base {
val archivesBaseName: String by project
archivesName.set(archivesBaseName)
}
val log: File = file("changelog.md")
val modVersion: String by project
version = modVersion
val mavenGroup: String by project
group = mavenGroup
println("## Changelog for ${base.archivesName.get()} $modVersion \n\n" + log.readText())
println(base.archivesName.get().replace('_','-'))
repositories {
/*maven {
name = "TerraformersMC"
url = uri("https://maven.terraformersmc.com/")
}*/
/*maven {
name = "REI"
url = uri("https://maven.shedaniel.me")
}*/
/*maven {
name = "Progwml6 maven"
url = uri("https://dvs1.progwml6.com/files/maven/")
}*/
/*maven {
name = "Ladysnake Libs"
url = uri("https://maven.ladysnake.org/releases")
content {
includeGroup("io.github.ladysnake")
includeGroupByRegex("io\\.github\\.onyxstudios.*")
}
}*/
/*maven {
name = "Patchouli Lib"
url = uri("https://maven.blamejared.com")
}*/
/*maven {
name = "Jitpack"
url = uri("https://jitpack.io")
}*/
/*flatDir {
dirs("E:\\Documents\\Mod Libraries\\ac\\build\\libs")
}*/
/*flatDir {
dirs("E:\\Documents\\Mod Libraries\\fc\\build\\libs")
}*/
/*flatDir {
dirs("E:\\Documents\\Mod Libraries\\gc\\build\\libs")
}*/
/*flatDir {
dirs("E:\\Documents\\Mod Development\\ai\\build\\libs")
}*/
mavenCentral()
}
dependencies {
val minecraftVersion: String by project
minecraft("com.mojang:minecraft:$minecraftVersion")
val yarnMappings: String by project
mappings("net.fabricmc:yarn:$yarnMappings:v2")
val loaderVersion: String by project
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
val fabricVersion: String by project
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricVersion")
val fabricKotlinVersion: String by project
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")
}
tasks {
val javaVersion = JavaVersion.VERSION_17
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
options.release.set(javaVersion.toString().toInt())
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions { jvmTarget = javaVersion.toString() }
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
}
jar {
from("LICENSE") { rename { "${base.archivesName.get()}_${it}" } }
}
jar {
from( "credits.txt") { rename { "${base.archivesName.get()}_${it}" } }
}
processResources {
val loaderVersion: String by project
val fabricKotlinVersion: String by project
inputs.property("version", project.version)
inputs.property("id", base.archivesName.get())
inputs.property("loaderVersion", loaderVersion)
inputs.property("fabricKotlinVersion", fabricKotlinVersion)
filesMatching("fabric.mod.json") {
expand(mutableMapOf(
"version" to project.version,
"id" to base.archivesName.get(),
"loaderVersion" to loaderVersion,
"fabricKotlinVersion" to fabricKotlinVersion)
)
}
}
java {
toolchain { languageVersion.set(JavaLanguageVersion.of(javaVersion.toString())) }
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
withSourcesJar()
}
}