-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
152 lines (140 loc) · 5.33 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
142
143
144
145
146
147
148
149
150
151
152
plugins {
id 'java'
id 'maven-publish'
id 'com.gradleup.shadow' version '8.3.0'
}
tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}
group = mod_group_id
version = mod_version
configurations.register('universalClasspath') {
canBeConsumed = false
canBeResolved = true
}
repositories {
mavenLocal()
mavenCentral()
maven {
name "JitPack"
url 'https://jitpack.io'
}
maven {
name "Modrinth"
url "https://api.modrinth.com/maven"
}
}
base {
// Modified by TeaCon
archivesName = "$mod_github_repo-Universal-$minecraft_version"
}
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
dependencies {
universalClasspath project(path: ':util', configuration: 'utilJar')
universalClasspath project(path: ':velocity', configuration: 'velocityJar')
universalClasspath project(path: ':neoforge', configuration: 'neoForgeJar')
shadow 'com.vdurmont:semver4j:3.1.0'
shadow 'com.moandjiezana.toml:toml4j:0.7.2'
shadow 'io.lettuce:lettuce-core:6.2.4.RELEASE'
shadow 'org.apache.commons:commons-text:1.10.0'
shadow 'io.prometheus:simpleclient_httpserver:0.16.0'
}
shadowJar {
archiveClassifier.set(null)
configurations = [project.configurations.universalClasspath, project.configurations.shadow]
dependencies {
it.exclude it.dependency('io.netty:.*')
it.exclude it.dependency('com.google.code.gson:.*')
}
from('LICENSE') {
into 'META-INF'
}
manifest {
attributes([
"Specification-Title" : "Gongdaobei",
"Specification-Vendor" : "TeaConMC",
"Specification-Version" : "1",
"Implementation-Title" : rootProject.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "TeaConMC",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
relocate 'reactor', 'org.teacon.gongdaobei.reactor'
relocate 'io.lettuce', 'org.teacon.gongdaobei.lettuce'
relocate 'io.prometheus', 'org.teacon.gongdaobei.prometheus'
relocate 'org.apache.commons', 'org.teacon.gongdaobei.commons'
relocate 'com.moandjiezana.toml', 'org.teacon.gongdaobei.toml'
relocate 'com.vdurmont.semver4j', 'org.teacon.gongdaobei.semver4j'
relocate 'org.reactivestreams', 'org.teacon.gongdaobei.reactivestreams'
mergeServiceFiles()
}
jar.enabled = false
artifacts {
archives shadowJar
}
publishing {
publications {
register('release', MavenPublication) {
artifact shadowJar
version = mod_version
groupId = mod_group_id
artifactId = "$mod_github_repo-Universal-$minecraft_version"
pom {
name = mod_github_repo
url = "https://github.com/$mod_github_owner/$mod_github_repo"
licenses {
license {
name = mod_license
url = "https://github.com/$mod_github_owner/$mod_github_repo/blob/HEAD/LICENSE"
}
}
organization {
name = 'TeaConMC'
url = 'https://github.com/teaconmc'
}
developers {
for (mod_author in "$mod_authors".split(',')) {
developer { id = mod_author.trim(); name = mod_author.trim() }
}
}
issueManagement {
system = 'GitHub Issues'
url = "https://github.com/$mod_github_owner/$mod_github_repo/issues"
}
scm {
url = "https://github.com/$mod_github_owner/$mod_github_repo"
connection = "scm:git:git://github.com/$mod_github_owner/${mod_github_repo}.git"
developerConnection = "scm:git:[email protected]:$mod_github_owner/${mod_github_repo}.git"
}
}
}
}
repositories {
maven {
name = "TeaConOSS"
url = "s3://maven/"
credentials(AwsCredentials) {
accessKey = System.env.TEACON_ARCHIVE_ACCESS_KEY
secretKey = System.env.TEACON_ARCHIVE_ACCESS_SECRET
}
}
maven {
name = "TeaConGitea"
url = "https://git.teacon.cn/api/packages/teaconmc/maven"
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "token " + System.getenv("GITEA_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}