-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
158 lines (133 loc) · 5.75 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
plugins {
id 'fabric-loom' version '1.5.+'
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
id 'maven-publish'
}
loom {
accessWidenerPath = file("src/main/resources/fxntstorage.accessWidener")
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
group = project.maven_group
//version = project.mod_version
// Formats the mod version to include the Minecraft version and build number (if present)
// example: 1.0.0+1.18.2-100
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}+${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")
repositories {
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://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://maven.terraformersmc.com/" } // EMI
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.shedaniel.me/" } // REI and deps
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
} // JADE
// EMI TRINKETS
maven {
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/"
}
maven {
name = "Ladysnake Libs"
url = 'https://maven.ladysnake.org/releases'
}
}
fabricApi {
configureDataGeneration()
}
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}")
// Development QOL
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
// JADE
modImplementation "curse.maven:jade-324717:${jade_version}"
// EMI
modCompileOnly("dev.emi:emi-fabric:$emi_version:api") { transitive = false }
// JEI
modCompileOnly("mezz.jei:jei-$minecraft_version-fabric:$jei_version") { transitive = false }
// REI
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:$rei_version")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:$rei_version")
modImplementation "dev.emi:trinkets:${trinkets_version}" // EMI TRINKETS
// 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-fabric:${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_fabric_version}")
// modCompileOnly("mezz.jei:jei-${minecraft_version}-common:${jei_fabric_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 = Map.of(
"version", version,
"fabric_loader_version", fabric_loader_version,
"fabric_api_version", fabric_api_version,
"create_version", create_version,
"minecraft_version", minecraft_version
)
inputs.properties(properties)
filesMatching("fabric.mod.json") {
expand properties
}
}
machete {
// disable machete locally for faster builds
enabled = buildNumber != null
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
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.
}
}