generated from jaredlll08/MultiLoader-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild.gradle
165 lines (139 loc) · 4.95 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
import groovy.json.JsonOutput
buildscript {
dependencies {
classpath "org.apache.groovy:groovy-json:4.0.6"
}
}
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],
footer: [
text: "Want to support us? Check out our Ko-fi! http://kofi.terrarium.earth",
icon_url: "https://cdn.discordapp.com/attachments/881367981463072809/1044025688719626250/61e1116779fc0a9bd5bdbcc7_Frame_6.png"
]
]],
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.officialMojangMappings()
}
if (name in platforms.split(",")) {
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"
}
}
}
}
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"
}
}
}
}
}
}
}
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 {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url = "https://nexus.resourcefulbees.com/repository/maven-public/" }
maven { url "https://maven.terraformersmc.com" }
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
}