Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
70 lines (59 loc) · 1.91 KB
/
Copy pathbuild.gradle
File metadata and controls
70 lines (59 loc) · 1.91 KB
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
plugins {
id 'fabric-loom' version '1.7.4'
id 'java'
}
def gitHash = 'unknown'
try {
def proc = 'git rev-parse --short HEAD'.execute()
proc.waitFor()
gitHash = proc.text.trim()
} catch (Exception ignored) {}
def gitDirty = ''
try {
def proc = 'git diff --quiet'.execute()
proc.waitFor()
if (proc.exitValue() != 0) gitDirty = '-dirty'
} catch (Exception ignored) {}
version = "${project.mod_version}-git-${gitHash}${gitDirty}"
group = project.maven_group
base { archivesName = project.archives_base_name }
repositories {
maven { url = 'https://maven.fabricmc.net/' }
maven { url = 'https://maven.terraformersmc.com/' }
maven { url = 'https://api.modrinth.com/maven' }
mavenCentral()
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.4.1")))
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
it.options.compilerArgs += ['-nowarn', '-Xlint:none', '-Xmaxerrs', '100000', '-Xmaxwarns', '0']
}
// Fix duplicate resource entries
tasks.named('jar') {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Implementation-Title': 'DuskByteClient',
'Implementation-Version': project.version,
)
}
}
tasks.named('sourcesJar') {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
task printVersion {
doFirst { println "Building DuskByteClient v${project.version}" }
}
build.dependsOn printVersion