-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathbuild.gradle.kts
87 lines (68 loc) · 2.34 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
plugins {
id("com.github.johnrengelman.shadow")
}
architectury {
platformSetupLoomIde()
fabric()
}
loom {
accessWidenerPath.set(project(":Common").loom.accessWidenerPath)
}
val common by configurations.creating
val shadowCommon by configurations.creating
val developmentFabric = configurations.named("developmentFabric")
configurations{
compileClasspath.get().extendsFrom(common)
runtimeClasspath.get().extendsFrom(common)
developmentFabric.get().extendsFrom(common)
}
dependencies {
modImplementation("net.fabricmc:fabric-loader:$fabric_loader_version")
modApi("net.fabricmc.fabric-api:fabric-api:$fabric_api_version")
common(project(path = ":Common", configuration = "namedElements")) { isTransitive = false }
shadowCommon(project(path = ":Common", configuration = "transformProductionFabric")) { isTransitive = false }
modApi("me.shedaniel.cloth:cloth-config-fabric:$cloth_config_version") {
exclude(group = "net.fabricmc", module = "fabric-loader")
}
include("me.shedaniel.cloth:cloth-config-fabric:$cloth_config_version")
// Sodium
modImplementation("maven.modrinth:sodium:mc1.19.2-0.4.4") {
exclude(group = "net.fabricmc.fabric-api")
}
// This is a dependency of Sodium....
modImplementation("org.joml:joml:1.10.4")
modImplementation(cusrseMaven("modMenu", projectID = 308702, fileId = 4066826))
}
tasks.processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand("versions" to project.version)
}
}
tasks.shadowJar {
exclude("architectury.common.json")
configurations = listOf(shadowCommon)
archiveClassifier.set("dev-shadow")
}
tasks.remapJar {
val shadowJarTask = tasks.shadowJar.get()
injectAccessWidener.set(true)
inputFile.set(shadowJarTask.archiveFile)
dependsOn(shadowJarTask)
archiveClassifier.set(null as String?)
}
tasks.jar {
archiveClassifier.set("dev")
}
tasks.sourcesJar {
val commonSources = project(":Common").tasks.sourcesJar.get()
dependsOn(commonSources)
from(commonSources.archiveFile.map(project::zipTree))
}
components.getByName<SoftwareComponent>("java") {
(this as AdhocComponentWithVariants).apply {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}
}