-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle
141 lines (118 loc) · 3.63 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
plugins {
id 'maven-publish'
alias libs.plugins.quilt.loom
}
def ENV = System.getenv()
def buildTime = ENV.BUILD_TIME ?: new Date().format('yyyyMMddHHmmss')
def javaVersion = 17
group = "dev.cammiescorner.arcanus-legacy"
archivesBaseName = "arcanus-legacy"
boolean isPreviewBuild = !ENV.TAG || ENV.TAG.matches(".+-.+")
def buildNumber = !ENV.TAG ? ("${ENV.BUILD_NUMBER ? "build.${ENV.BUILD_NUMBER}" : buildTime}-${libs.versions.minecraft.get()}") : ""
version = (ENV.TAG ?: "development") + ((isPreviewBuild && !ENV.TAG) ? "+${buildNumber}" : "")
// messy workaround for bug in quilt loom 1.3.3+
project.configurations.configureEach {
exclude(group: "net.fabricmc", module: "fabric-loader")
exclude(group: "net.fabricmc.fabric-api")
}
repositories {
maven {
name = "Ladysnake"
url = "https://maven.ladysnake.org/releases"
}
maven {
name = "TerraformersMC"
url = "https://maven.terraformersmc.com"
}
maven {
name = "ParchmentMC"
url = "https://maven.parchmentmc.org"
}
maven {
name = "uuid.gg"
url = "https://maven.uuid.gg/releases"
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
minecraft libs.minecraft
mappings(loom.layered {
it.mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
it.parchment("${libs.parchment.mappings.get()}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
modImplementation libs.quilt.loader
modImplementation libs.quilted.fabric.api
modImplementation libs.midnightlib
modImplementation libs.bundles.cca
modImplementation(libs.sparkweave) {
exclude(group: "io.github.llamalad7")
}
// modmenu
modLocalRuntime libs.modmenu
// LazyDFU
modLocalRuntime libs.lazydfu
}
loom {
mods {
"arcanus" {
// Tell Loom about each source set used by your mod here. This ensures that your mod's classes are properly transformed by Loader.
sourceSet("main")
}
}
accessWidenerPath.set(file("src/main/resources/arcanus.accesswidener"))
}
processResources {
inputs.property "version", version
filesMatching('quilt.mod.json') {
expand "version": version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release.set(javaVersion)
}
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
vendor = JvmVendorSpec.MICROSOFT
}
}
jar {
from("LICENSE.md") {
rename { "LICENSE_${archivesBaseName}.md" }
}
manifest.mainAttributes(
"Implementation-Title": project.archivesBaseName,
"Implementation-Version": project.version,
"Maven-Artifact": "${project.group}:${project.archivesBaseName}:${project.version}".toLowerCase(Locale.ROOT),
"Built-On-Minecraft": libs.versions.minecraft.get(),
"Built-On-Java": "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})"
)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId "Arcanus-Legacy-Quilt"
from components.java
}
}
repositories {
if (ENV.MAVEN_UPLOAD_URL) {
maven {
url = ENV.MAVEN_UPLOAD_URL
credentials {
username = ENV.MAVEN_UPLOAD_USERNAME
password = ENV.MAVEN_UPLOAD_PASSWORD
}
}
}
}
}