This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 296
/
Copy pathbuild.gradle.kts
143 lines (122 loc) · 4.17 KB
/
build.gradle.kts
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.AbstractRunTask
import net.fabricmc.loom.task.RemapJarTask
plugins {
id("pex-platform")
id("ca.stellardrift.opinionated.fabric")
id("ca.stellardrift.localization")
}
val shade: Configuration by configurations.creating
configurations.implementation.get().extendsFrom(shade)
val minecraftVersion = "1.16.5"
dependencies {
val adventurePlatformVersion: String by project
val cloudVersion: String by project
shade(project(":impl-blocks:minecraft")) {
exclude("com.google.guava")
exclude("com.google.code.gson")
exclude("org.spongepowered")
exclude("net.kyori")
exclude("org.jetbrains.kotlin")
}
shade(project(":impl-blocks:hikari-config"))
shade("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1") { isTransitive = false }
shade("cloud.commandframework:cloud-brigadier:$cloudVersion")
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings("net.fabricmc:yarn:$minecraftVersion+build.5:v2")
modImplementation("net.fabricmc:fabric-loader:0.11.2")
modImplementation("net.fabricmc.fabric-api:fabric-api:0.31.0+1.16")
modImplementation(include("net.kyori:adventure-platform-fabric:$adventurePlatformVersion") {
exclude("com.google.code.gson")
exclude("ca.stellardrift", "colonel")
})
modImplementation(include("ca.stellardrift:confabricate:2.0.3") {
exclude("com.google.code.gson")
})
modImplementation(include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT")!!)
runtimeOnly("net.minecraftforge:forgeflower:1.5.498.2")
}
loom {
runs {
configureEach {
runDir(projectDir.resolve("run/").relativeTo(rootDir).toString())
}
}
}
tasks.withType(AbstractRunTask::class).configureEach {
javaLauncher.set(pexPlatform.developmentRuntime())
this.standardInput = System.`in`
// Mixin debug options
jvmArgs(
// "-Dmixin.debug.verbose=true",
// "-Dmixin.debug.export=true",
// "-Dmixin.debug.export.decompile.async=false",
"-Dmixin.dumpTargetOnFailure=true",
"-Dmixin.checks.interfaces=true",
"-Dpermissionsex.debug.mixinaudit=true"
)
// Configure mixin agent
/*jvmArgumentProviders += CommandLineArgumentProvider {
// Resolve the Mixin configuration
// Java agent: the jar file for mixin
val mixinJar = configurations.runtimeClasspath.get().resolvedConfiguration
.getFiles { it.name == "sponge-mixin" && it.group == "net.fabricmc" }
.atMostOne()
if (mixinJar != null) {
listOf("-javaagent:$mixinJar")
} else {
emptyList()
}
}*/
}
tasks.register("runFabricServer") {
dependsOn(tasks.runServer)
group = "pex"
description = "Run a Fabric development server"
}
tasks.register("runFabricClient") {
dependsOn(tasks.runClient)
group = "pex"
description = "Run a Fabric development client"
}
pexPlatform {
relocate(
"cloud.commandframework",
"com.github.benmanes.caffeine",
"com.zaxxer.hikari",
"org.antlr",
"org.jdbi",
"org.pcollections",
"org.slf4j"
)
relocate("org.apache.logging.slf4j", keepElements = 2)
excludeChecker()
}
val shadowJar by tasks.getting(ShadowJar::class) {
configurations = listOf(shade)
archiveClassifier.set("dev-all")
from(sourceSets["accessor"].output)
from(sourceSets["mixin"].output)
dependencies {
exclude(dependency("org.jetbrains.kotlin:.*:.*"))
exclude(dependency("org.jetbrains.kotlinx:.*:.*"))
exclude(dependency("org.jetbrains:annotations:.*"))
exclude(dependency("io.leangen.geantyref:geantyref:.*"))
}
}
val remapShadowJar = tasks.register<RemapJarTask>("remapShadowJar") {
dependsOn(shadowJar)
archiveClassifier.set("all")
input.set(shadowJar.archiveFile)
addNestedDependencies.set(true)
}
configurations {
sequenceOf(shadowRuntimeElements, shadow).forEach {
it.configure {
outgoing {
artifacts.clear()
artifact(remapShadowJar)
}
}
}
}