-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
153 lines (130 loc) · 4.5 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
plugins {
// see https://fabricmc.net/develop/ for new versions
id 'fabric-loom' version '1.7-SNAPSHOT' apply false
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
id 'net.neoforged.moddev' version '2.0.72' apply false
id "me.modmuss50.mod-publish-plugin" version "0.8.3"
id 'net.minecraftforge.gradle' version '[6.0.24,6.2)' apply false
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply false
}
allprojects {
apply plugin: "maven-publish"
version = "${rootProject.mod_version}-${rootProject.minecraft_version}"
group = rootProject.maven_group
repositories {
mavenCentral()
maven {
url = "https://cursemaven.com"
}
maven {
name = "Forge Config API Port"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven {
name = "Cloth Config Maven"
url = "https://maven.shedaniel.me/"
}
maven {
name = "Mod Menu Maven"
url = "https://maven.terraformersmc.com/"
}
maven { url = 'https://jitpack.io' }
flatDir {
dirs '../modlibs'
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 21
}
}
publishMods {
File changeLog = rootProject.file("changelog.md")
String changelogText = changeLog.exists() ? changeLog.text : ""
changelog = changelogText
type = STABLE
dryRun = true //Always enable for debug
// CurseForge options used by both Fabric and Forge
def cfOptions = curseforgeOptions {
accessToken = providers.gradleProperty("CURSEFORGE_TOKEN")
minecraftVersions.add("1.21.4")
javaVersions.add(JavaVersion.VERSION_21)
clientRequired = true
dryRun = true
}
// Modrinth options used by both Fabric and Forge
def mrOptions = modrinthOptions {
accessToken = providers.gradleProperty("MODRINTH_TOKEN")
projectId = "${modrinth_id}"
minecraftVersionRange {
start = "1.21.4"
end = "1.21.4" // Set to "latest" to use the latest minecraft version
}
dryRun = true
}
// Fabric specific options for CurseForge
curseforge("curseforgeFabric") {
from cfOptions
file project(":fabric")
projectId = "${curseforge_id_fabric}"
modLoaders.add("fabric")
requires {
slug = "fabric-api"
}
embeds("cloth-config")
optional("modmenu")
version = "${minecraft_version}-${mod_version}-fabric"
displayName = "${jar_name}-Fabric-${minecraft_version}-${mod_version}"
}
// Forge specific options for CurseForge
curseforge("curseforgeForge") {
from cfOptions
file project(":forge")
modLoaders.add("forge")
projectId = "${curseforge_id_forge}"
version = "${minecraft_version}-${mod_version}-forge"
displayName = "${jar_name}-Forge-${minecraft_version}-${mod_version}"
}
// Neoforge specific options for Curseforge
curseforge("curseforgeNeoforge") {
from cfOptions
file project(":neoforge")
modLoaders.add("neoforge")
projectId = "${curseforge_id_forge}"
version = "${minecraft_version}-${mod_version}-neoforge"
displayName = "${jar_name}-Neoforge-${minecraft_version}-${mod_version}"
}
// Fabric specific options for Modrinth
modrinth("modrinthFabric") {
from mrOptions
file project(":fabric")
modLoaders.add("fabric")
requires {
slug = "fabric-api"
}
embeds {
slug = "cloth-config"
}
optional {
slug = "modmenu"
}
version = "${minecraft_version}-${mod_version}-fabric"
displayName = "${jar_name}-Fabric-${minecraft_version}-${mod_version}"
}
// Forge specific options for Modrinth
modrinth("modrinthForge") {
from mrOptions
file project(":forge")
modLoaders.add("forge")
version = "${minecraft_version}-${mod_version}-forge"
displayName = "${jar_name}-Forge-${minecraft_version}-${mod_version}"
}
// Neoforge specific options for Modrinth
modrinth("modrinthNeoforge") {
from mrOptions
file project(":neoforge")
modLoaders.add("neoforge")
version = "${minecraft_version}-${mod_version}-neoforge"
displayName = "${jar_name}-Neoforge-${minecraft_version}-${mod_version}"
}
}