-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
157 lines (132 loc) · 5.08 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
@file:Suppress("UNCHECKED_CAST")
import groovy.lang.Closure
import io.github.pacifistmc.forgix.plugin.ForgixMergeExtension.FabricContainer
import io.github.pacifistmc.forgix.plugin.ForgixMergeExtension.ForgeContainer
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.launcher.daemon.protocol.Build
plugins {
`java-library`
alias(libs.plugins.architectury.plugin)
alias(libs.plugins.dev.architectury.loom).apply(false)
alias(libs.plugins.shadow).apply(false)
`maven-publish`
alias(libs.plugins.forgix)
}
architectury {
minecraft = libs.versions.minecraft.version.get()
}
var lib: LibrariesForLibs = libs
var lib__ = extensions.getByType<VersionCatalogsExtension>().named("libs")
subprojects {
apply {
plugin(lib.plugins.dev.architectury.loom.get().pluginId)
plugin(lib.plugins.shadow.get().pluginId)
plugin(lib.plugins.maven.publish.get().pluginId)
}
val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom")
loom.silentMojangMappingsLicense()
dependencies {
"minecraft"("com.mojang:minecraft:${lib.versions.minecraft.version.get()}")
@Suppress("UnstableApiUsage")
"mappings"(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${lib.versions.minecraft.version.get()}:${lib.versions.parchment.get()}@zip")
})
}
publishing {
publications.create<MavenPublication>(project.name + "Maven") {
artifactId = lib.versions.archives.base.name.get()
from(components["java"])
}
repositories {
mavenLocal()
}
}
}
allprojects {
apply(plugin = "java-library")
apply(plugin = lib.plugins.architectury.plugin.get().pluginId)
repositories {
maven { url = uri("https://jitpack.io/") } // Mixin Extras, Fabric ASM
maven { url = uri("https://api.modrinth.com/maven") }
maven { url = uri("https://maven.jamieswhiteshirt.com/libs-release") } // Reach Entity Attributes
maven { url = uri("https://cursemaven.com") } // Forge Config API Port
maven { url = uri("https://maven.cafeteria.dev/releases") } // Fake Player API
maven { url = uri("https://maven.terraformersmc.com/releases/") }
maven {
url = uri("https://maven.parchmentmc.org")
name = "parchment mc"
}
maven {
// location of the maven that hosts JEI files before January 2023
name = "Progwml6's maven"
url = uri("https://dvs1.progwml6.com/files/maven/")
}
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = uri("https://maven.blamejared.com/")
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = uri("https://modmaven.dev")
}
maven { url = uri("https://mvn.devos.one/snapshots/") } // create fabric
maven { url = uri("https://maven.theillusivec4.top/") } // Curios
maven { // Create Forge and Registrate Forge
url = uri("https://maven.tterrag.com/")
content {
includeGroup("com.tterrag.registrate")
includeGroup("com.simibubi.create")
}
}
maven {
// Shedaniel's maven (Architectury API)
url = uri("https://maven.architectury.dev")
content {
includeGroupByRegex("me.shedaniel.*")
includeGroup("dev.architectury")
includeGroup("me.shedaniel")
}
}
maven {
// saps.dev Maven (KubeJS and Rhino)
url = uri("https://maven.saps.dev/releases")
content {
includeGroup("dev.latvian.mods")
}
}
}
base.archivesName.set(lib.versions.archives.base.name.get())
group = lib.versions.maven.group.get()
version = lib.versions.mod.version.get()
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(17)
}
java {
withSourcesJar()
}
}
forgix {
group = libs.versions.maven.group.get()
outputDir = "build/libs/forgix"
mergedJarName = "${libs.versions.archives.base.name.get()}-${libs.versions.minecraft.version.get()}-${project.version}.jar"
val closureOf: Closure<Any?> = closureOf<ForgeContainer> {
projectName = "forge"
jarLocation = "build/libs/${libs.versions.archives.base.name.get()}-${project.version}.jar"
}
forge(closureOf as Closure<ForgeContainer>)
val fabricClosure: Closure<Any?> = closureOf<FabricContainer> {
projectName = "fabric"
jarLocation = "build/libs/${libs.versions.archives.base.name.get()}-${project.version}.jar"
}
fabric(fabricClosure as Closure<FabricContainer>)
}
tasks.build {
dependsOn(project(":fabric").tasks.build.get())
dependsOn(project(":forge").tasks.build.get())
dependsOn(tasks.mergeJars)
}