-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
102 lines (82 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import dev.architectury.plugin.ArchitectPluginExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import net.fabricmc.loom.task.RemapJarTask
plugins {
java
id("com.teamresourceful.resourcefulgradle")
id("dev.architectury.loom") version "1.6-SNAPSHOT" apply false
id("architectury-plugin") version "3.4-SNAPSHOT" apply false
}
version = project.extensions.getByType<VersionCatalogsExtension>()
.named("libs")
.findVersion("mod-version").get()
.requiredVersion
subprojects {
apply(plugin = "dev.architectury.loom")
apply(plugin = "architectury-plugin")
val minecraftVersion: String by project
val modName = rootProject.name
val modLoader = project.name
val isCommon = modLoader == rootProject.projects.common.name
val loom: LoomGradleExtensionAPI by project
version = rootProject.version
base {
archivesName.set("$modName-$modLoader-$minecraftVersion")
}
loom.silentMojangMappingsLicense()
repositories {
maven(url = "https://maven.teamresourceful.com/repository/maven-public/")
maven(url = "https://maven.neoforged.net/releases/")
}
dependencies {
val resourcefulLibVersion: String by project
"minecraft"("::${minecraftVersion}")
"mappings"(loom.officialMojangMappings())
val rlib = "modImplementation"(group = "com.teamresourceful.resourcefullib", name = "resourcefullib-$modLoader-$minecraftVersion", version = resourcefulLibVersion)
if (!isCommon) {
"include"(rlib)
}
}
java {
withSourcesJar()
}
tasks.jar {
archiveClassifier.set("dev")
}
tasks.named<RemapJarTask>("remapJar") {
archiveClassifier.set(null as String?)
}
if (!isCommon) {
configure<ArchitectPluginExtension> {
platformSetupLoomIde()
}
sourceSets.main {
val main = this
rootProject.projects.common.dependencyProject.sourceSets.main {
main.java.source(java)
main.resources.source(resources)
}
}
dependencies {
compileOnly(rootProject.projects.common)
}
}
}
resourcefulGradle {
templates {
val minecraftVersion: String by rootProject
register("discordEmbed") {
val fabricLink: String? = System.getenv("FABRIC_RELEASE_URL")
val forgeLink: String? = System.getenv("FORGE_RELEASE_URL")
source.set(file("templates/release_embed.json.template"))
injectedValues.set(mapOf(
"version" to version,
"mc_version" to minecraftVersion,
"neoforge_version" to "20.5.3-beta",
"fabric_version" to "0.15.9",
"fabric_link" to fabricLink,
"forge_link" to forgeLink
))
}
}
}