-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
166 lines (149 loc) · 7.48 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
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
//file:noinspection GradlePackageVersionRange
//file:noinspection GroovyUnusedAssignment
plugins {
id "fabric-loom" version "1.0.+"
id "io.github.juuxel.loom-quiltflower" version "1.+" // Quiltflower, a better decompiler
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
id "maven-publish"
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
repositories {
mavenLocal()
mavenCentral()
maven { url = "https://mvn.devos.one/snapshots/" }
maven { url = "https://mvn.devos.one/#/snapshots/" }// Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = "https://maven.quiltmc.org/repository/release" }
maven { url = "https://hephaestus.dev/release" }
maven { url = "https://api.modrinth.com/maven" }// LazyDFU
maven { url = "https://cursemaven.com" }// Forge Config API Port, Farmer's Delight
maven { url = "https://maven.parchmentmc.org" }// Parchment mappings
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://maven.tterrag.com/" }// Flywheel
maven { url = "https://storage.googleapis.com/devan-maven/" }
maven { url = "https://maven.shedaniel.me/" }// Cloth Config, REI
maven { url = "https://aperlambda.github.io/maven" }
maven { url = "https://ladysnake.jfrog.io/artifactory/mods" }
maven { url = "https://maven.kotlindiscord.com/repository/terraformers/" }
maven { url = "https://maven.terraformersmc.com/" }// Mod Menu
maven { url = "https://maven.cafeteria.dev/releases/" }
maven { url = "https://jitpack.io/" }// Mixin Extras, Fabric ASM
maven { url = "https://maven.gegy.dev" }
maven { url = "https://dvs1.progwml6.com/files/maven/" }// JEI
maven { url = "https://modmaven.dev" }
maven { url = "https://maven.gudenau.net" }
maven { url = "https://maven.blamejared.com/vazkii/botania/Botania/" }
maven { url = "https://maven.kyrptonaught.dev/" }
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" }// Reach Entity Attributes
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}// Forge Config Api Port
}
dependencies {
// Setup
minecraft("com.mojang:minecraft:${minecraft_version}")
mappings("net.fabricmc:yarn:${YARN_MAPPINGS}:v2")
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")
// 真是不知道ForgeConfigAPIPort出了什么鸟问题。
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}") {
exclude(Map.of("module", "forge-config-api-port-fabric-547434"))
}
modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\ForgeConfigAPIPort-v4.2.10-1.19.2-Fabric.jar"))
modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\core-3.6.5.jar"))
modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\toml-3.6.5.jar"))
// modImplementation "net.minecraftforge:forgeconfigapiport-fabric:${forgeconfigapiport}"
// modCompileOnly("maven.modrinth:lazydfu:${lazydfu_version}")
// modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
modImplementation("curse.maven:farmersdelightfabric-482834:${farmersdelight_version}")//这句是从https://github.com/ianm1647/expandeddelight/blob/1.19/build.gradle抄的。
// 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": modCompileOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}"); break
// case "rei": modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"); break
// case "emi": modCompileOnly("dev.emi:emi:${emi_version}"); break
// // default: println("Unknown recipe viewer specified: ${recipe_viewer}. Must be JEI, REI, EMI, or disabled.")
// }
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}")
// modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\RoughlyEnoughItems-9.1.580.jar"))
// modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\architectury-6.4.62-fabric.jar"))
// modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\cloth-config-8.2.88-fabric.jar"))
// modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}")
modCompileOnly("dev.emi:emi:${emi_version}:api")
// modLocalRuntime("dev.emi:emi:${emi_version}")
modLocalRuntime(files("D:\\CCC\\Documents\\local_maven\\enchlevel-langpatch-1.2.3.jar"))
// var common = include("phoupraw.mcmod:PhouprawSCommon:${common_version}")
// modCompileOnly(common)
// modLocalRuntime(common)
// include(modImplementation("phoupraw.mcmod:PhouprawSCommon:${common_version}"))
// modImplementation(files("D:\\CCC\\Documents\\local_maven\\RoughlyEnoughItems-9.1.580.jar"))
// modImplementation(files("D:\\CCC\\Documents\\local_maven\\architectury-6.4.62-fabric.jar"))
}
processResources {
// require dependencies to be the version compiled against or newer
Map<String, String> properties = new HashMap<>()
properties.put("version", version)
// properties.put("mod_id", mod_id)
// properties.put("archives_base_name", archives_base_name)
properties.forEach((k, v) -> inputs.property(k, v))
filesMatching("fabric.mod.json") { expand properties }
}
//machete {
// // disable machete locally for faster builds
// enabled = buildNumber != null
//}
tasks.withType(JavaCompile).configureEach {
it.options.release = Integer.parseInt(sourceCompatibility)
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
exclude("com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.class", "com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity\$State.class", "com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity\$Mode.class", "com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity\$1.class")
}
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 {
mavenLocal()
// 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.
}
}
loom {
accessWidenerPath = file("src/main/resources/${mod_id}.accesswidener")
runs {
// This adds a new gradle task that runs the datagen API: "gradlew runDatagenClient"
datagenClient {
inherit client
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.modid=${mod_id}"
runDir "build/datagen"
}
}
}
// Adds the generated files into the jar you distribute to players.
sourceSets {
main {
resources {
srcDirs += ['src/main/generated']
}
}
}