generated from SmushyTaco/Example-Mod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
80 lines (76 loc) · 2.83 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
plugins {
id("fabric-loom")
val kotlinVersion: String by System.getProperties()
kotlin("jvm").version(kotlinVersion)
kotlin("plugin.serialization").version(kotlinVersion)
}
base {
val archivesBaseName: String by project
archivesName.set(archivesBaseName)
}
val modVersion: String by project
version = modVersion
val mavenGroup: String by project
group = mavenGroup
repositories {
maven {
name = "CottonMC"
url = uri("https://server.bbkr.space/artifactory/libs-release")
}
}
dependencies {
val minecraftVersion: String by project
minecraft("com.mojang", "minecraft", minecraftVersion)
val yarnMappings: String by project
mappings("net.fabricmc", "yarn", yarnMappings, null, "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)
val libGuiVersion: String by project
// 3rd party mods, UI
modImplementation(include("io.github.cottonmc", "LibGui", libGuiVersion))
// Web libs
val okhttpVersion: String by project
implementation(include("com.squareup.okhttp3", "okhttp", okhttpVersion))
implementation(include("com.squareup.okhttp3", "logging-interceptor", okhttpVersion))
val retrofitVersion: String by project
implementation(include("com.squareup.retrofit2", "retrofit", retrofitVersion))
val ktConverterVersion: String by project
implementation(include("com.jakewharton.retrofit", "retrofit2-kotlinx-serialization-converter", ktConverterVersion))
val okioVersion: String by project
implementation(include("com.squareup.okio", "okio-jvm", okioVersion))
}
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() }
}
jar { from("LICENSE") { rename { "${it}_${base.archivesName}" } } }
processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") { expand(mutableMapOf("version" to project.version)) }
}
java {
toolchain { languageVersion.set(JavaLanguageVersion.of(javaVersion.toString())) }
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
withSourcesJar()
}
}
sourceSets {
main {
java {
srcDir("src/main/kotlin")
srcDir("src/main/java")
}
}
}