forked from DragonsPlusMinecraft/CreateEnchantmentIndustry
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
182 lines (155 loc) · 5.96 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
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
//file:noinspection GradlePackageVersionRange
plugins {
id "fabric-loom" version "1.5.+"
id "maven-publish"
id "me.modmuss50.mod-publish-plugin" version "0.3.5"
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
group = project.maven_group
version = mod_version
repositories {
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = "https://mvn.devos.one/releases/" } // Porting Lib Releases
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
maven { url = "https://maven.tterrag.com/" } // Flywheel
maven { url = "https://maven.dragons.plus/releases" } // DragonLib
maven { url = "https://maven.dragons.plus/snapshots" } // DragonLib snapshot
mavenLocal() // Fast test
}
loom {
accessWidenerPath = file("src/main/resources/create_enchantment_industry.accesswidener")
sourceSets {
main {
resources {
srcDir("src/generated/resources")
exclude("src/generated/resources/.cache")
}
}
}
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=create_enchantment_industry"
vmArg "-Dporting_lib.datagen.existing_resources=${file("src/main/resources")}"
}
server {
runDir "run/server"
}
}
}
dependencies {
// Setup
minecraft("com.mojang:minecraft:${minecraft_version}")
mappings(loom.layered {
//it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${qm_version}:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")
// dependencies
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
// Create - dependencies are added transitively
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
// Create Dragon Lib
include(modImplementation("plus.dragons.createdragonlib:create_dragon_lib-fabric-${minecraft_version}:${dragonlib_version}"){
transitive = false
})
// Development QOL
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
// Recipe Viewers - Create Fabric supports JEI, REI, and EMI.
// See root gradle.properties to choose which to use at runtime.
switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
case "jei": modLocalRuntime("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}"); break
case "rei": modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"); break
case "emi": modLocalRuntime("dev.emi:emi:${emi_version}"); break
case "disabled": break
default: println("Unknown recipe viewer specified: ${recipe_viewer}. Must be JEI, REI, EMI, or disabled.")
}
// if you would like to add integration with them, uncomment them here.
modCompileOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}")
modCompileOnly("mezz.jei:jei-${minecraft_version}-common:${jei_version}")
// modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}")
// modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${rei_version}")
// modCompileOnly("dev.emi:emi:${emi_version}")
}
processResources {
// require dependencies to be the version compiled against or newer
Map<String, String> properties = new HashMap<>()
properties.put("version", version)
properties.put("fabric_loader_version", fabric_loader_version)
properties.put("fabric_api_version", fabric_api_version)
properties.put("create_version", create_version)
properties.put("minecraft_version", minecraft_version)
properties.forEach((k, v) -> inputs.property(k, v))
filesMatching("fabric.mod.json") {
expand properties
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = Integer.parseInt(sourceCompatibility)
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
}
publishMods {
file = remapJar.archiveFile
changelog = new File("changelog/${mod_version}.md").text
version = mod_version
type = STABLE
displayName = "CEI ${mod_version} for Create ${minecraft_version}-${create_version}"
modLoaders.add("fabric")
modLoaders.add("quilt")
curseforge {
projectId = "876129"
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
minecraftVersions.add(minecraft_version)
requires {
slug = "create-fabric"
slug = "fabric-api"
}
}
modrinth {
projectId = "AEZO385x"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions.add(minecraft_version)
requires {
slug = "create-fabric"
slug = "fabric-api"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}