-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
121 lines (101 loc) · 4.24 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
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}
architectury {
platformSetupLoomIde()
fabric()
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentFabric.extendsFrom common
}
repositories {
// mavens for Create Fabric and dependencies
maven { url = "https://mvn.devos.one/releases" } // Porting Lib releases
maven { url = "https://mvn.devos.one/snapshots" } // Create and several dependencies
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // Forge Config API Port
maven { // Fabric ASM for Porting Lib
url = "https://jitpack.io/"
content { includeGroupAndSubgroups("com.github") }
}
maven { url = "https://maven.shedaniel.me" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com" } // JEI
maven { url = "https://maven.terraformersmc.com/releases" } // Mod Menu, EMI
}
configurations.configureEach {
resolutionStrategy {
// make sure the desired version of loader is used. Sometimes old versions are pulled in transitively.
force("net.fabricmc:fabric-loader:$fabric_loader_version")
}
}
dependencies {
modImplementation("net.fabricmc:fabric-loader:$fabric_loader_version")
common(project(path: ":common", configuration: "namedElements")) { transitive = false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive = false }
// 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_fabric_version")
// Development QOL
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 (fabric_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: $fabric_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 {
// set up properties for filling into metadata
Map<String, Object> properties = [
"version": version,
"fabric_loader_version": fabric_loader_version,
"fabric_api_version": fabric_api_version,
"minecraft_version": minecraft_version,
"create_version": create_fabric_version // on fabric, use the entire version, unlike forge
]
inputs.properties(properties)
filesMatching("fabric.mod.json") {
expand properties
}
}
shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
archiveClassifier = "dev-shadow"
}
remapJar {
injectAccessWidener = true
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier = null
}
jar {
archiveClassifier = "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}