-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle
113 lines (99 loc) · 2.93 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
import org.gradle.util.GradleVersion
import java.time.Instant
plugins {
id "fabric-loom" version "1.0.18"
id "net.nemerosa.versioning" version "3.0.0"
id "maven-publish"
id "signing"
}
group = maven_group
version = mod_version
final isReleaseVersion = !version.endsWith("-SNAPSHOT")
java {
withSourcesJar()
}
loom {
mixin {
defaultRefmapName.set("refmap.reach-entity-attributes.json")
}
runs {
configureEach {
property "mixin.debug", "true"
property "mixin.debug.export.decompile", "false"
property "mixin.debug.verbose", "true"
property "mixin.dumpTargetOnFailure", "true"
property "mixin.checks", "true"
property "mixin.hotSwap", "true"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:$minecraft_version"
mappings "net.fabricmc:yarn:$yarn_mappings"
modImplementation "net.fabricmc:fabric-loader:$loader_version"
modImplementation fabricApi.module("fabric-resource-loader-v0", fabric_version)
modImplementation fabricApi.module("fabric-registry-sync-v0", fabric_version)
implementation("com.google.code.findbugs:jsr305:$jsr305_version") {
transitive = false
}
}
compileJava {
options.with {
it.release.set(17)
it.fork = true
it.deprecation = true
it.encoding = "UTF-8"
it.compilerArgs = ["-Xlint:all", "-parameters"]
}
}
processResources {
inputs.property "version", project.version
filesMatching("/fabric.mod.json") {
expand "version": project.version
}
}
jar {
from "/LICENSE"
manifest.attributes([
"Build-Timestamp": Instant.now(),
"Build-Revision": versioning.info.commit,
"Build-Jvm": "" +
"${System.getProperty("java.version")} (" +
"${System.getProperty("java.vm.vendor")} " +
"${System.getProperty("java.vm.version")})",
"Built-By": GradleVersion.current(),
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Vendor": project.group,
"Specification-Title": "FabricMod",
"Specification-Version": "1.0.0",
"Specification-Vendor": "dev.sapphic",
"Sealed": "true"
])
}
publishing {
publications {
mavenJava(MavenPublication) {
afterEvaluate {
artifact remapJar
artifact(sourcesJar.archiveFile) {
classifier = "sources"
builtBy remapSourcesJar
}
}
}
}
repositories {
maven {
url = "https://maven.jamieswhiteshirt.com/libs-" + (isReleaseVersion ? "release" : "snapshot")
credentials {
username = project.properties.jwsMavenUser
password = project.properties.jwsMavenPassword
}
}
}
}
signing {
required = isReleaseVersion
sign publishing.publications.mavenJava
}