This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
forked from P3pp3rF1y/SophisticatedBackpacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
229 lines (205 loc) · 7.7 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
buildscript {
repositories {
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.74'
classpath 'org.parchmentmc:librarian:1.2.0.7-dev-SNAPSHOT'
}
}
plugins {
id "org.sonarqube" version "3.3"
id "maven-publish"
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'idea'
apply plugin: 'eclipse'
if (findProject(':SophisticatedCore') != null) {
evaluationDependsOn(':SophisticatedCore')
}
repositories {
mavenCentral()
maven { url "https://maven.theillusivec4.top/" }
maven { url "https://maven.tterrag.com/" }
maven { url = "https://modmaven.dev/" }
maven { url "https://minecraft.curseforge.com/api/maven/" }
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven { url "https://maven.blamejared.com/" }
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/p3pp3rf1y/sophisticatedcore")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("READ_PACKAGES_TOKEN")
}
content {
includeGroupByRegex "sophisticatedcore.*"
}
}
}
group = 'sophisticatedbackpacks'
version = "${project.minecraft_version}-${project.mod_version}.${getBuildNumber()}${getStable()}"
archivesBaseName = 'sophisticatedbackpacks'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '17'
minecraft {
mappings channel: 'parchment', version: "$parchment_version"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property "mixin.env.disableRefMap", "true"
//property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
sophisticatedbackpacks {
source sourceSets.main
}
}
}
server {
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property "mixin.env.disableRefMap", "true"
//property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
mods {
sophisticatedbackpacks {
source sourceSets.main
}
}
}
data {
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property 'fml.earlyprogresswindow', 'false'
property "mixin.env.disableRefMap", "true"
//property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
args '--mod', 'sophisticatedbackpacks', '--flat', '--all', '--output', file('src/generated/resources/')
mods {
if (findProject(':SophisticatedCore') != null) {
SophisticatedCore {
source project(':SophisticatedCore').sourceSets.main
}
}
sophisticatedbackpacks {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
if (findProject(':SophisticatedCore') != null) {
implementation project(':SophisticatedCore')
} else {
compileOnly fg.deobf("sophisticatedcore:sophisticatedcore:${sc_version}") {
transitive = false
}
runtimeOnly fg.deobf("sophisticatedcore:sophisticatedcore:${sc_version}") {
transitive = false
}
testImplementation fg.deobf("sophisticatedcore:sophisticatedcore:${sc_version}") {
transitive = false
}
}
compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
compileOnly fg.deobf("vazkii.botania:Botania:${botania_version}:api")
runtimeOnly fg.deobf("vazkii.botania:Botania:${botania_version}")
compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")
compileOnly fg.deobf("curse.maven:craftingtweaks-233071:${crafting_tweaks_cf_file_id}")
compileOnly fg.deobf("curse.maven:balm-531761:${balm_cf_file_id}")
compileOnly fg.deobf("curse.maven:chipped-456956:${chipped_cf_file_id}")
runtimeOnly fg.deobf("curse.maven:chipped-456956:${chipped_cf_file_id}")
compileOnly fg.deobf("curse.maven:ctm-267602:${ctm_cf_file_id}")
runtimeOnly fg.deobf("curse.maven:ctm-267602:${ctm_cf_file_id}")
compileOnly fg.deobf("vazkii.botania:Botania:${botania_version}:api")
runtimeOnly fg.deobf("vazkii.botania:Botania:${botania_version}")
compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")
}
test {
useTestNG()
}
task generateSources(type: Copy) {
from 'src/replaceme/java'
into "$buildDir/generated-src"
filter { line -> line.replaceAll('@MOD_VERSION@', '${project.version}') }
}
jar {
from('/') {
include 'LICENSE'
}
manifest {
attributes(["Specification-Title" : "sophisticatedbackpacks",
"Specification-Vendor" : "p3pp3rf1y",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : "${project.version}",
"Implementation-Vendor" : "p3pp3rf1y",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
}
processResources {
// Exclude datagenerator .cache directory
exclude '.cache'
}
static def getBuildNumber() {
if (System.getenv("GITHUB_RUN_NUMBER") != null) {
return System.getenv("GITHUB_RUN_NUMBER").toString()
}
return ""
}
static def getStable() {
if ((System.getenv("GITHUB_REF") != null && System.getenv("GITHUB_REF").endsWith("-dev"))) {
return "-alpha"
}
return ""
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/P3pp3rF1y/SophisticatedBackpacks")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
artifactId = 'sophisticatedbackpacks'
from(components.java)
}
}
}
sonarqube {
properties {
property "sonar.projectName", "SophisticatedBackpacks"
property "sonar.projectKey", "sophisticatedbackpacks:SophisticatedBackpacks"
}
}
task printVersionName {
println "version:" + project.version
}