This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
106 lines (86 loc) · 2.62 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("fabric-loom") version "1.6-SNAPSHOT"
val kotlinVersion: String by System.getProperties()
kotlin("jvm").version(kotlinVersion)
id("maven-publish")
id("signing")
}
val modVersion: String by project
val mavenGroup: String by project
val minecraftVersion: String by project
val minecraftTargetVersion: String by project
val yarnMappings: String by project
val loaderVersion: String by project
val fabricKotlinVersion: String by project
val fabricVersion: String by project
val archivesBaseName = "sc-text"
version = modVersion
group = mavenGroup
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "17"
apiVersion = "1.9"
languageVersion = "1.9"
}
}
repositories {
}
dependencies {
minecraft("com.mojang", "minecraft", minecraftVersion)
mappings("net.fabricmc", "yarn", yarnMappings, null, "v2")
modImplementation("net.fabricmc", "fabric-loader", loaderVersion)
modImplementation("net.fabricmc.fabric-api", "fabric-api", fabricVersion) {
exclude("net.fabricmc.fabric-api", "fabric-gametest-api-v1")
}
modImplementation("net.fabricmc", "fabric-language-kotlin", fabricKotlinVersion)
}
tasks {
processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") { expand(mutableMapOf(
"version" to project.version,
"minecraft_target_version" to minecraftTargetVersion,
"fabric_kotlin_version" to fabricKotlinVersion,
"loader_version" to loaderVersion
)) }
}
jar {
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")
}
remapJar {
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")
destinationDirectory.set(file("${rootDir}/build/final"))
}
loom {
accessWidenerPath.set(file("src/main/resources/sc-text.accesswidener"))
}
}
publishing {
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
}
}
repositories {
maven {
name = "lemmmyRepo"
url = uri("https://repo.lem.sh/releases")
if (!System.getenv("MAVEN_USERNAME").isNullOrEmpty()) {
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
} else {
credentials(PasswordCredentials::class)
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
}