-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
147 lines (116 loc) · 4.16 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
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'me.modmuss50.mod-publish-plugin' version '0.4.5'
id 'maven-publish'
}
configurations.configureEach {
resolutionStrategy {
force("net.fabricmc:fabric-loader:$loader_version")
}
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
def ENV = System.getenv()
def RELEASE_NAME = "${version}"
def RELEASE_FILE = "${buildDir}/libs/${archivesBaseName}-${version}.jar"
@SuppressWarnings('GrMethodMayBeStatic')
def getChangeLog() {
return ""
}
repositories {
maven { url 'https://maven.isxander.dev/releases/' } // YACL
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // YACL dependency
maven { url 'https://maven.quiltmc.org/repository/release/' } // YACL dependency
maven { url 'https://maven.shedaniel.me/' } // REI
maven { url 'https://maven.terraformersmc.com/releases/' } // ModMenu
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
include modApi("teamreborn:energy:${project.energy_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation "dev.isxander:yet-another-config-lib:${project.yacl_version}-fabric"
include modImplementation("dev.isxander:yet-another-config-lib:${project.yacl_version}-fabric")
modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modCompileOnly "dev.emi:emi-fabric:${project.emi_version}:api"
switch(project.active_recipe_viewer) {
case "rei":
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
break
case "emi":
modRuntimeOnly "dev.emi:emi-fabric:${project.emi_version}"
break
}
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
modRuntimeOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
}
processResources {
inputs.property "1.0", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
ext.getChangeLog = { ->
return "- Update to 1.21;\n" +
"- Added Coxinha Banner Pattern."
}
publishMods {
file = remapJar.archiveFile
displayName = (project.mod_version as String)
type = STABLE
modLoaders.add("fabric")
changelog = project.getChangeLog()
curseforge {
projectId = project.curseforge_id
projectSlug = "coxinha-utilities"
accessToken = providers.environmentVariable("CURSEFORGE_API_KEY")
minecraftVersions.add(project.minecraft_version)
requires {
slug = "fabric-api"
}
optional {
slug = "roughly-enough-items"
}
}
modrinth {
projectId = project.modrinth_id
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions.add(project.minecraft_version)
requires {
slug = "fabric-api"
}
optional {
slug = "rei"
}
}
discord {
webhookUrl = providers.environmentVariable("CAFETERIA_MOD_RELEASE_WEBHOOK")
username = "Coxinha Utilities (Fabric)"
avatarUrl = "https://cdn.modrinth.com/data/NXqpbY3F/icon.png"
content = changelog.map { "# Coxinha Utilities (Fabric) " + (project.mod_version as String) + " has been released \n" + it}
}
}