-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
108 lines (90 loc) · 2.86 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.153'
}
version = '1.4.0'
group = 'dev.gigaherz.playertemplate' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
Provider<String> minecraftVersion(Transformer<String, String> mapper) {
return project.userDevRuntime.runtimes.map(r -> r.values().first().specification.minecraftVersion).map(mapper)
}
base {
archivesName = minecraftVersion { "PlayerTemplate-${it}" }
}
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
runs {
// applies to all the run configs below
configureEach {
systemProperty 'forge.logging.markers', '' // 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
workingDirectory project.file('run')
modSource project.sourceSets.main
}
client {
}
server {
}
}
subsystems {
parchment {
minecraftVersion="1.20.4"
mappingsVersion="2024.04.14"
}
}
dependencies {
implementation 'net.neoforged:neoforge:21.0.86-beta'
}
jar {
from('/') {
include 'LICENSE.txt'
}
manifest {
attributes([
"Specification-Title" : "playertemplate",
"Specification-Vendor" : "gigaherz",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "gigaherz",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
project.afterEvaluate {
publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName
from components.java
}
}
repositories {
if (findProperty("RELEASE") && System.env.giga_maven_host != null) {
System.out.println("Remote publish enabled on " + System.env.giga_maven_host)
maven {
url System.env.giga_maven_host
credentials {
username System.env.giga_maven_user
password System.env.giga_maven_password
}
}
}
else {
System.out.println("Remote publish disabled.")
maven {
url "$projectDir/../CommonMaven"
}
}
}
}
}