forked from Alpha-s-Stuff/TinkersConstruct
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
204 lines (173 loc) · 7.05 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
/*
* Tinkers Construct
* Master build file
*
* Authors: boni, Sunstrike, ProgWML6
* Help from AbrarSyed
*/
//file:noinspection GroovyAssignabilityCheck
plugins {
id "fabric-loom" version "1.8-SNAPSHOT"
id "maven-publish"
// id "io.freefair.lombok"
}
repositories {
mavenCentral()
maven { url = "https://libraries.minecraft.net/" }
maven { url = "https://api.modrinth.com/maven" }
maven { url = "https://maven.terraformersmc.com/releases/" }
maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://maven.wispforest.io" } // TOP
maven { url = "https://maven.blamejared.com" } // CraftTweaker, Immersive Engineering
maven { url = "https://www.cursemaven.com" }
maven { url = "https://maven.ladysnake.org/releases" }
maven { url = "https://mvn.devos.one/releases/" }
maven { url = "https://mvn.devos.one/snapshots/" }
maven { url = "https://maven.parchmentmc.org" }
maven { url = "https://maven.vram.io" }
maven { url = "https://jitpack.io" }
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
url "https://maven.jamieswhiteshirt.com/libs-release"
content {
includeGroup "com.jamieswhiteshirt"
}
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
}
group = 'slimeknights.tconstruct'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
version = "${minecraft_version}-${mod_version}"
sourceSets {
main {
resources {
srcDirs "src/generated/resources"
//But exclude the cache of the generated data from what gets built
exclude '.cache'
}
}
}
loom {
accessWidenerPath = file("src/main/resources/tinkers.accesswidener")
runs {
datagen {
client()
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}"
vmArg "-Dfabric-api.datagen.modid=tconstruct"
// from ae2
property "porting_lib.datagen.existing_resources", file("src/main/resources").absolutePath
runDir "build/datagen"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
// dev environment
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
// modRuntimeOnly("com.github.Andrew6rant:InventoryTabs:inventorytabs-${inventorytabs_version}")
// lombok
compileOnly("org.projectlombok:lombok:1.18.22")
annotationProcessor("org.projectlombok:lombok:1.18.22")
testCompileOnly("org.projectlombok:lombok:1.18.22")
testAnnotationProcessor("org.projectlombok:lombok:1.18.22")
// mockito (no idea what this is)
testCompileOnly("org.mockito:mockito-core:2.23.4")
implementation(include("com.google.code.findbugs:jsr305:3.0.2"))
// dependencies
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
include(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.1.1")))
for (String module in port_lib_modules.split(",")) {
modImplementation(include("io.github.fabricators_of_create.Porting-Lib:$module:$port_lib_version+$minecraft_base_version"))
}
modApi(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"))
modApi(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"))
api(include('com.electronwill.night-config:core:3.6.6'))
api(include('com.electronwill.night-config:toml:3.6.6'))
modImplementation("dev.architectury:architectury-fabric:${architectury_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation(include("io.github.tropheusj:milk-lib:${project.milk_lib_version}")) {
exclude(group: "net.fabricmc.fabric-api")
}
modApi(include("io.github.tropheusj:dripstone-fluid-lib:${project.dripstone_fluid_lib_version}")) {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation(include("me.alphamode:Star:1.5.2+${minecraft_version}"))
modApi "com.terraformersmc:modmenu:7.2.2"
// REI
modCompileOnlyApi("me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modCompileOnlyApi("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
// compile against the JEI API but do not include it at runtime
modCompileOnlyApi "mezz.jei:jei-${minecraft_version}-common-api:${jei_version}"
modCompileOnlyApi "mezz.jei:jei-${minecraft_version}-fabric-api:${jei_version}"
// EMI
modCompileOnlyApi "dev.emi:emi-fabric:${emi_version}"
if (project.recipe_viewer == 'jei') {
// at runtime, use the full JEI jar for Fabric
modRuntimeOnly "mezz.jei:jei-${minecraft_version}-fabric:${jei_version}"
} else if (project.recipe_viewer == 'rei') {
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
} else if (project.recipe_viewer == 'emi') {
modRuntimeOnly "dev.emi:emi-fabric:${project.emi_version}"
} else {
println("unknown recipe viewer: $recipe_viewer")
}
}
// process mods.toml to inject variables
processResources {
Map<String, Object> properties = [
"version" : version,
"minecraft_version" : minecraft_version,
"loader_version" : loader_version,
"fabric_version" : fabric_version,
"mantle_version" : mantle_version,
"reach_entity_attributes_version": reach_entity_attributes_version
]
for (String module in port_lib_modules.split(","))
properties.put("port_lib_${module}_version".toString(), "$port_lib_version+$project.minecraft_base_version")
properties.put("port_lib_tags_version", "3.0") // the weird one
properties.forEach((k, v) -> inputs.property(k, v))
filesMatching("fabric.mod.json") {
expand properties
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 17
}
java {
withSourcesJar()
}
jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
}
manifest {
attributes([
"Specification-Title" : "Supporoform",
"Specification-Vendor" : "Slime Knights",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "Slime Knights",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}