-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle
182 lines (157 loc) · 7.95 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 GradlePackageVersionRange
plugins {
id "fabric-loom" version "1.3.+"
id "io.github.juuxel.loom-vineflower" version "1.+"
id "maven-publish"
}
loom {
accessWidenerPath = file("src/main/resources/twilightforest.accesswidener")
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
archivesBaseName = "${project.mod_id}-fabric-${minecraft_version}"
version = (hasProperty("CIRevision") ? CIRevision : project.mod_version)
group = project.group_name
sourceSets.main.resources {
srcDir "src/generated/resources"
}
repositories {
mavenLocal() // test builds of Porting Lib
maven { url = "https://maven.quiltmc.org/repository/release" } // QM
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Suggestion Tweaker
maven { url = "https://maven.shedaniel.me/" } // Cloth Config
maven { url = "https://maven.wispforest.io" } // TOP
maven { url = "https://storage.googleapis.com/devan-maven/" }
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu, Trinkets, EMI
maven { url = "https://mvn.devos.one/snapshots/" } // Porting Lib, Forge Tags, Tinkers, Mantle
maven { url = "https://maven.ladysnake.org/releases" } // Cardinal Components API
maven { url = "https://maven.parchmentmc.net/" } // Parchment
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://dvs1.progwml6.com/files/maven/" } // JEI
maven { url 'https://maven.blamejared.com' } // Botany Pots, Bookself
maven { // Jade
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven { url = "https://maven.wispforest.io"}
maven { url = "https://jitpack.io" } // Fabric ASM, Mixin Extras
}
dependencies {
// dev env
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.qm_version}:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}") { exclude(group: "net.fabricmc.fabric-api") }
modLocalRuntime("maven.modrinth:suggestion-tweaker:${project.suggestion_tweaker_version}+fabric")
modLocalRuntime("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api") } // for Suggestion Tweaker
// dependencies
for (String module in port_lib_modules.split(",")) {
modApi(include("io.github.fabricators_of_create.Porting-Lib:$module:$port_lib_version"))
}
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
modImplementation(include("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${project.config_api_version}"))
modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"))
modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"))
modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-world:${project.cca_version}"))
modImplementation(include("com.github.Chocohead:Fabric-ASM:v2.3"))
modImplementation(include("maven.modrinth:here-be-no-dragons:1.0.0"))
implementation(include("com.electronwill.night-config:core:3.6.3"))
implementation(include("com.electronwill.night-config:toml:3.6.3"))
implementation(include("javax.annotation:javax.annotation-api:1.3.2"))
implementation(include("com.google.code.findbugs:jsr305:3.0.2"))
// compat
modImplementation("dev.emi:trinkets:${project.trinkets_version}")
// EMI
modCompileOnly("dev.emi:emi:${project.emi_version}") { transitive = false }
// JEI
// FIXME remapping issues with API jar
// deps.modCompileOnly("mezz.jei:jei-${project.minecraft_version}-common-api:${project.jei_version}") { transitive = false }
// deps.modCompileOnly("mezz.jei:jei-${project.minecraft_version}-fabric-api:${project.jei_version}") { transitive = false }
modCompileOnly("mezz.jei:jei-1.19.3-fabric:${project.jei_version}") { transitive = false }
// REI
modCompileOnly("me.shedaniel.cloth:basic-math:0.6.0") { transitive = false }
modCompileOnly("dev.architectury:architectury-fabric:${project.architectury_version}") { transitive = false }
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}") { transitive = false }
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") { transitive = false }
// Jade
modImplementation("curse.maven:jade-324717:${jade_id}")
// TOP
modCompileOnly("mcjty.theoneprobe:theoneprobe-fabric:${top_version}")
String recipeViewer = project.recipe_viewer
if (recipeViewer == "emi") {
modLocalRuntime("dev.emi:emi:${project.emi_version}") { transitive = false }
} else if (recipeViewer == "jei") {
modLocalRuntime("mezz.jei:jei-${project.minecraft_version}-fabric:${project.jei_version}") { transitive = false }
} else if (recipeViewer == "rei") {
modLocalRuntime("me.shedaniel.cloth:basic-math:0.6.0") { transitive = false }
modLocalRuntime("dev.architectury:architectury-fabric:${project.architectury_version}") { transitive = false }
modLocalRuntime("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api"); transitive = false }
modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") { transitive = false }
} else {
println("unknown recipe viewer: $recipeViewer")
}
// test mods
// modRuntimeOnly "net.darkhax.botanypots:BotanyPots-Fabric-1.19.2:9.0.3"
// modLocalRuntime "io.wispforest:owo-lib:0.10.4+pre.1+1.19.4"
}
loom {
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=twilightforest"
property "porting_lib.datagen.existing_resources", file("src/main/resources").absolutePath
property "twilightforest.data.server", "false"
runDir "build/datagen"
}
}
}
processResources {
Map<String, String> properties = new HashMap<>()
properties.put("version", project.version)
properties.put("loader_version", project.loader_version)
properties.put("fabric_version", project.fabric_version)
properties.put("minecraft_version", project.minecraft_version)
properties.put("java_version", sourceCompatibility)
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}"}
}
}
// configure the maven publication
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.
}
}