-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
73 lines (59 loc) · 2.04 KB
/
build.gradle
File metadata and controls
73 lines (59 loc) · 2.04 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
71
72
73
import io.papermc.hangarpublishplugin.HangarPublishTask
plugins {
alias(libs.plugins.hangar)
}
def changelogMd = file('CHANGELOG.md')
ext {
changelog = changelogMd.exists() ? changelogMd.text : ''
minecraft_version_list = minecraft_versions.split(",").toList()
velocity_version_list = velocity_versions.split(",").toList()
}
def copyShadowJar = it -> {
it.include('*-all.jar', '*-javadoc.jar', '*-sources.jar')
it.rename { String fileName ->
fileName.replace('-all', '')
}
}
tasks.register('buildAll', Copy) {
dependsOn(':bukkit:shadowJar', ':velocity:shadowJar', ':bungeecord:shadowJar')
from('bukkit/build/libs', copyShadowJar)
from('bungeecord/build/libs', copyShadowJar)
from('velocity/build/libs', copyShadowJar)
it.rename { String fileName ->
fileName.replace(plugin_name, plugin_id)
}
into('result')
}
tasks.register('clean', Delete) {
delete 'result'
}
hangarPublish {
evaluationDependsOn(":bukkit")
evaluationDependsOn(":bungeecord")
evaluationDependsOn(":velocity")
publications.register('plugin') {
version = project.version
id = hangar_project_id
channel = 'Release'
changelog = project.changelog
apiKey = findProperty('hangar_api_key') as String ?: ''
// register platforms
platforms {
paper {
jar = project(":bukkit").tasks.named("shadowJar").get().outputs.files.singleFile
platformVersions = minecraft_version_list
}
waterfall {
jar = project(":bungeecord").tasks.named("shadowJar").get().outputs.files.singleFile
platformVersions = List.of("1.21")
}
velocity {
jar = project(":velocity").tasks.named("shadowJar").get().outputs.files.singleFile
platformVersions = velocity_version_list
}
}
}
}
tasks.withType(HangarPublishTask).configureEach {
dependsOn(':bukkit:shadowJar', ':velocity:shadowJar', ':bungeecord:shadowJar')
}