-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathbuild.gradle
More file actions
226 lines (205 loc) · 7.07 KB
/
build.gradle
File metadata and controls
226 lines (205 loc) · 7.07 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
plugins {
id "architectury-plugin" version "3.4.+"
id "dev.architectury.loom" version "1.10.+" apply false
}
boolean ci = System.getenv("CI") != null ? System.getenv("CI").toBoolean() : false
boolean nightly = ci && (System.getenv("RELEASE") != null ? !System.getenv("RELEASE").toBoolean() : true)
def getGitTag = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine "git", "describe", "--tags", "--abbrev=0"
standardOutput = stdout
}
def str = stdout.toString().trim().takeBetween("v", "+")
if (str == "") {
return "0.0.0"
}
return str
}
architectury {
minecraft = rootProject.minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: "maven-publish"
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")
}
compileOnly 'com.google.code.findbugs:jsr305:3.0.2' // for nullability annotations
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = rootProject.archives_base_name
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/copycats-plus/copycats"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "realRobotixMaven"
url = "https://maven.realrobotix.me/copycats"
credentials(PasswordCredentials)
}
}
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${getGitTag()}+mc.${minecraft_version}-${project.name}${nightly ? "-build.${buildNumber}" : ""}"
group = rootProject.maven_group
ext.ci = ci
repositories {
maven {
name = 'Neoforge maven'
url = 'https://maven.neoforged.net/releases/'
}
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
maven {
name = 'createmod maven'
url = 'https://maven.createmod.net/'
}
maven {
name = 'ithundxr maven'
url = "https://maven.ithundxr.dev/snapshots"
}
maven {
// location of the maven that hosts JEI files before January 2023
name = "Progwml6's maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
maven {
//Location of EMI
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/"
}
maven {
name = 'CurseForge maven'
url = 'https://cursemaven.com'
}
mavenCentral()
maven {
url = "https://mvn.devos.one/snapshots/"
}
maven {
url = "https://mvn.devos.one/releases/"
}
maven {
url = "https://jitpack.io"
}
maven {
name = "Reach Entity Attributes"
url = "https://maven.jamieswhiteshirt.com/libs-release"
content { includeGroup("com.jamieswhiteshirt") }
}
maven {
name = "Forge Config Api Port, DiagonalBlocks"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven {
name = "Porting Lib: Mixin Extras, Fabric ASM"
url = "https://jitpack.io/"
content { includeGroupAndSubgroups("com.github") }
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
flatDir {
dirs "lib"
}
}
configurations {
findAndDelete
}
// special task used to invalidate gradle cache for specific dependencies
tasks.register('seekAndDestroy') {
doLast {
configurations.findAndDelete.each {
println 'Deleting: ' + it
delete it.parent
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
jar {
processResources.exclude("assets/copycats/models/block/copycat_base/README.md")
}
tasks.named('processResources', ProcessResources).configure {
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
// include packs
from(project(":common").file("src/main/resources")) {
include("resourcepacks/")
}
// set up properties for filling into metadata
var replaceProperties = [
version : version.replace("neoforge.", "").replace("fabric.", ""),
minecraft_version : minecraft_version,
minecraft_version_range : minecraft_version_range,
fabric_api_version : fabric_api_version,
fabric_loader_version : fabric_loader_version,
neoforge_version_range : neoforge_version_range,
neoforge_loader_version_range: neoforge_loader_version_range,
create_neoforge_range : create_neoforge_range,
create_fabric_range : create_fabric_range,
archives_base_name : archives_base_name,
mod_license : mod_license,
mod_authors : mod_authors,
mod_name : mod_name,
mod_description : mod_description,
mod_credits : mod_credits,
mod_url : mod_url,
mod_issues : mod_issues
]
inputs.properties replaceProperties
filesMatching(["fabric.mod.json", "META-INF/neoforge.mods.toml"]) {
expand replaceProperties + [project: project]
}
}
java {
withSourcesJar()
}
}
wrapper {
gradleVersion = "8.14"
}