-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
202 lines (181 loc) · 6.02 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7.+" 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")
}
}
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
repositories {
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
maven {
name = 'tterrag maven'
url = 'https://maven.tterrag.com/'
}
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 {
url = "https://cursemaven.com"
}
mavenCentral()
maven {
url = "https://mvn.devos.one/snapshots/"
}
maven { url = "https://mvn.devos.one/releases/" }
maven {
url = "https://cursemaven.com"
}
maven {
url = "https://jitpack.io"
}
maven { // Reach Entity Attributes
url = "https://maven.jamieswhiteshirt.com/libs-release"
content { includeGroup("com.jamieswhiteshirt") }
}
maven {
//Forge Config Api Port, DiagonalBlocks
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven { // for 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(17)
}
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("forge.", "").replace("fabric.", ""),
minecraft_version : minecraft_version,
fabric_api_version : fabric_api_version,
fabric_loader_version: fabric_loader_version,
create_forge_range : create_forge_range,
create_fabric_range : create_fabric_range,
mod_license : mod_license,
mod_authors : mod_authors,
mod_name : mod_name,
mod_description : mod_description
]
inputs.properties replaceProperties
filesMatching(["fabric.mod.json", "META-INF/mods.toml"]) {
expand replaceProperties + [project: project]
}
}
java {
withSourcesJar()
}
}
wrapper {
gradleVersion = "8.8"
}