forked from cookies-mod/mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (84 loc) · 2.87 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
import org.gradle.jvm.tasks.Jar
plugins {
id("fabric-loom") version "1.9-SNAPSHOT"
id("maven-publish")
id("dev.morazzer.cookies.internal.classified-jars")
}
version = project.properties["mod_version"]!!
group = project.properties["maven_group"]!!
repositories {
mavenCentral()
maven("https://api.modrinth.com/maven")
maven("https://repo.hypixel.net/repository/Hypixel/")
maven("https://repo.cookies.codes/releases")
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1")
}
fabricApi {
configureDataGeneration {
createSourceSet = true
}
}
loom {
accessWidenerPath.set(rootProject.rootDir.resolve("src/main/resources/cookies.accesswidener"))
}
val includeInJar: Configuration = configurations.create("includeInJar") {
isCanBeResolved = true
}
configurations.implementation.get().extendsFrom(includeInJar)
dependencies {
annotationProcessor(compileOnly("org.projectlombok:lombok:1.18.36")!!)
compileOnly("org.jetbrains:annotations:26.0.1")
includeInJar("dev.morazzer.cookies:entities:0.2.0")
// Hypixel mod api fabric
include(modImplementation("maven.modrinth:hypixel-mod-api:1.0.1+build.1+mc1.21") {
isTransitive = false
})
implementation("net.hypixel:mod-api:1.0.1")
minecraft("com.mojang:minecraft:${project.properties["minecraft_version"]}")
mappings("net.fabricmc:yarn:${project.properties["yarn_mappings"]}:v2")
modImplementation("net.fabricmc:fabric-loader:${project.properties["loader_version"]}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.properties["fabric_version"]}")
modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:1.2.1")
}
tasks.withType<Jar>().configureEach {
from(includeInJar.resolve().map { if (it.isDirectory) it else zipTree(it) })
}
tasks.withType<ProcessResources> {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand("version" to version)
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<Jar> {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
}
}
tasks.withType<JavaCompile> {
options.release = 21
sourceCompatibility = "21"
targetCompatibility = "21"
}
tasks.register("generateDatacomponentAccessors", cm.tasks.GenerateDataComponentMethods::class) {
this.outputDir.set(this.project.layout.buildDirectory.dir("generated/data-component-accessors"))
}
tasks.register("generateBuildInfo", cm.tasks.CreateBuildInfo::class) {
this.outputDir.set(this.project.layout.buildDirectory.dir("generated/buildinfo"))
}
tasks.register("generateRegions", cm.tasks.CreateRegions::class) {
this.outputDir.set(this.project.layout.buildDirectory.dir("generated/regions"))
}
sourceSets {
main {
java {
srcDir(tasks.getByName("generateDatacomponentAccessors"))
srcDir(tasks.getByName("generateBuildInfo"))
srcDir(tasks.getByName("generateRegions"))
}
}
}