-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
112 lines (94 loc) · 3.83 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
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
}
architectury {
minecraft = rootProject.minecraft_version
}
final VALID_PUBLISHING = Set.of("fabric", "neoforge", "common", "common-mojmap");
subprojects {
apply plugin: "dev.architectury.loom"
loom {
silentMojangMappingsLicense()
}
repositories {
maven { url "https://maven.parchmentmc.org" }
maven { url "https://maven.wispforest.io/releases" }
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
if (!name.equals("common-mojmap")) {
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.21:2024.07.28@zip")
}
} else {
mappings loom.officialMojangMappings()
}
if (!(project.name.contains("common") || project.name.contains("cclayer") || project.name.contains("tclayer"))) {
// include("io.wispforest:endec:${rootProject.endec_version}")
// include("io.wispforest.endec:gson:${rootProject.endec_gson_version}")
// include("io.wispforest.endec:jankson:${rootProject.endec_jankson_version}")
// include("io.wispforest.endec:netty:${rootProject.endec_netty_version}")
}
implementation("io.wispforest:endec:${rootProject.endec_version}")
implementation("io.wispforest.endec:gson:${rootProject.endec_gson_version}")
implementation("io.wispforest.endec:jankson:${rootProject.endec_jankson_version}")
implementation("io.wispforest.endec:netty:${rootProject.endec_netty_version}")
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
base {
var name = project.name
archivesName = "${rootProject.archives_base_name}${(name.isEmpty() ? "" : "-${project.name.replace("-mojmap", "")}")}"
}
version = "${project.mod_version}+${rootProject.minecraft_base_version}${(project.name.contains("mojmap") ? "-mojmap" : "")}"
group = rootProject.maven_group
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 21
}
java {
withSourcesJar()
}
final ENV = System.getenv()
if(VALID_PUBLISHING.contains(project.name)) {
publishing {
publications {
mavenCommon(MavenPublication) {
final name = project.name
artifactId = "${rootProject.archives_base_name}${(name.isEmpty() ? "" : "-${name.replace("-mojmap", "")}")}"
afterEvaluate {
if (!name.equals("common-mojmap")) {
from components.java
} else {
var mojmapJarTask = project.tasks.named("mojmapJar");
artifact(mojmapJarTask) {
builtBy mojmapJarTask
classifier = ''
}
var mojmapSourcesJarTask = project.tasks.named("mojmapSourcesJar");
artifact(mojmapSourcesJarTask) {
builtBy mojmapSourcesJarTask
classifier = 'sources'
}
}
}
}
}
repositories {
maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USER
password ENV.MAVEN_PASSWORD
}
}
}
}
}
}