-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
183 lines (159 loc) · 5.69 KB
/
build.gradle
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import groovy.json.JsonOutput
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.0-SNAPSHOT" apply false
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0" // literally never gonna update
}
architectury {
minecraft = rootProject.minecraft_version
}
tasks.register("generateDiscordEmbed") {
doFirst {
var env = System.getenv()
var changelogFile = rootProject.file("changelog.txt")
var fields = []
if (changelogFile.exists()) {
fields.add([
name : "Changelog",
value: changelogFile.text
])
}
fields.addAll([
[
name : "Minecraft Version",
value : minecraft_version,
inline: true
],
[
name : "Mod Version",
value : mod_version,
inline: true
],
[
name : "Download",
value : "<:modrinth:978684543034871878> [Modrinth](" +
env.MODRINTH_PROJECT_URL +
")\n<:curseforge:978684543026462790> [Curseforge](" +
env.CURSE_PROJECT_URL + ")",
inline: true
]
])
var json = JsonOutput.toJson([
content : null,
embeds : [[
title : archives_base_name,
color : Integer.parseInt(env.EMBED_COLOR, 16),
fields : fields,
thumbnail: [url: env.WEBHOOK_THUMBNAIL]
]],
username : env.WEBHOOK_USERNAME,
avatar_url : env.WEBHOOK_AVATAR,
attatchments: []
])
new File(projectDir, "embed.json").write(json)
}
}
subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: "com.modrinth.minotaur"
apply plugin: "com.matthewprenger.cursegradle"
loom {
silentMojangMappingsLicense()
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-$rootProject.minecraft_version:$rootProject.parchment_version@zip")
}
}
var env = System.getenv()
var modLoader = name
var changelogFile = rootProject.file("changelog.txt")
var changelogText = changelogFile.exists() ? changelogFile.text : ""
if (env.MODRINTH_TOKEN) {
modrinth {
projectId = env.MODRINTH_PROJECT
uploadFile = tasks.remapJar
gameVersions = [minecraft_version]
loaders = [modLoader]
changelog = changelogText
if (modLoader == "fabric") {
dependencies {
required.project "fabric-api"
required.project "resourceful-lib"
required.project "resourceful-config"
required.project "botarium"
optional.project "modmenu"
optional.project "roughly-enough-items"
}
} else {
dependencies {
required.project "resourceful-lib"
required.project "resourceful-config"
required.project "botarium"
optional.project "roughly-enough-items"
}
}
}
}
if (env.CURSE_TOKEN) {
curseforge {
apiKey = env.CURSE_TOKEN
project {
id = env.CURSE_PROJECT
changelog = changelogText
releaseType = 'release'
addGameVersion minecraft_version
addGameVersion modLoader.capitalize()
mainArtifact(tasks.remapJar)
if (modLoader == "fabric") {
relations {
requiredDependency "fabric-api"
requiredDependency "resourceful-lib"
requiredDependency "resourceful-config"
requiredDependency "botarium"
optionalDependency "modmenu"
optionalDependency "jei"
optionalDependency "roughly-enough-items"
}
} else {
relations {
requiredDependency "resourceful-lib"
requiredDependency "resourceful-config"
requiredDependency "botarium"
optionalDependency "jei"
optionalDependency "roughly-enough-items"
}
}
}
}
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version
group = rootProject.maven_group
repositories {
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven { url = "https://nexus.resourcefulbees.com/repository/maven-public/"}
}
tasks.withType(JavaCompile).tap {
configureEach {
options.encoding = "UTF-8"
options.release = 17
}
}
java {
withSourcesJar()
}
}