-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle
More file actions
150 lines (132 loc) · 4.4 KB
/
Copy pathbuild.gradle
File metadata and controls
150 lines (132 loc) · 4.4 KB
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
plugins {
id "java-library"
id "idea"
id "maven-publish"
id "net.neoforged.gradle.userdev" version "7.0.182"
id "me.modmuss50.mod-publish-plugin" version "1.0.0"
}
version = "${project.mc_version}-${project.mod_version}"
group = "com.teamabnormals"
base {
archivesName = project.mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
minecraft.accessTransformers.file rootProject.file("src/main/resources/META-INF/accesstransformer.cfg")
runs {
configureEach {
systemProperty "forge.logging.markers", "REGISTRIES"
systemProperty "forge.logging.console.level", "debug"
}
client {
modSources {
add project.sourceSets.main
}
}
server {
modSources {
add project.sourceSets.main
}
}
data {
modSources {
add project.sourceSets.main
}
arguments.addAll "--mod", project.mod_id, "--all", "--output", file("src/generated/resources/").getAbsolutePath(), "--existing", file("src/main/resources/").getAbsolutePath(), "--existing-mod", "blueprint"
}
}
sourceSets.main.resources {
srcDir "src/generated/resources"
}
dependencies {
implementation "net.neoforged:neoforge:${project.neoforge}"
implementation "com.teamabnormals:blueprint:${project.mc_version}-${project.blueprint}"
implementation "com.teamabnormals:gallery:${project.mc_version}-${project.gallery}"
implementation "mezz.jei:jei-${project.mc_version}-neoforge:${project.jei}"
}
subsystems {
parchment {
minecraftVersion = "${project.mc_version}"
mappingsVersion = "${project.parchment}"
}
}
repositories {
maven { url "https://maven.teamabnormals.com/" }
maven { url = "https://maven.blamejared.com/" }
maven { url = "https://modmaven.dev" }
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [mod_version: mod_version, mc_version: mc_version, neoforge: neoforge, blueprint: blueprint]
inputs.properties replaceProperties
filesMatching(["META-INF/neoforge.mods.toml"]) {
expand replaceProperties
}
}
tasks.named("jar", Jar).configure {
manifest {
attributes([
"Specification-Title" : project.mod_name,
"Specification-Vendor" : "Team Abnormals",
"Specification-Version" : "1",
"Implementation-Title" : project.mod_name,
"Implementation-Version" : project.mod_version,
"Implementation-Vendor" : "Team Abnormals",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
publishing {
publications {
maven(MavenPublication) {
artifact jar
}
}
repositories {
maven {
name = "abnormals"
url = "https://maven.teamabnormals.com"
credentials(PasswordCredentials)
}
}
}
publishMods {
file = jar.archiveFile
changelog = providers.fileContents(layout.projectDirectory.file("changelog.md")).asText
type = STABLE
modLoaders.add("neoforge")
version = project.mod_version
displayName = "${project.mod_name} ${project.mc_version} - ${project.mod_version}"
modrinth {
announcementTitle = "<:modrinth:1428950505010364517> Download from Modrinth!"
accessToken = providers.gradleProperty("MODRINTH_API_KEY")
projectId = project.modrinth_id
minecraftVersions.add(project.mc_version)
requires("blueprint")
}
curseforge {
announcementTitle = "<:curseforge:1428950488358850581> Download from CurseForge!"
accessToken = providers.gradleProperty("CURSEFORGE_API_KEY")
projectId = project.curseforge_id
projectSlug = project.mod_id
minecraftVersions.add(project.mc_version)
requires("blueprint")
}
discord() {
webhookUrl = providers.gradleProperty("DISCORD_WEBHOOK")
dryRunWebhookUrl = providers.gradleProperty("DISCORD_WEBHOOK_ALT")
username = "Team Abnormals"
content = changelog.map {
"## ${project.mod_name} ${project.mc_version} - ${project.mod_version}\n" + it
}
style {
look = "MODERN"
thumbnailUrl = "https://i.slabfi.sh/icon_border/${project.mod_id}.png"
color = "#537db5"
}
}
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}