-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle
89 lines (75 loc) · 2.84 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
plugins {
id 'com.github.johnrengelman.shadow' version "${shadow_version}"
id 'fabric-loom' version "${fabric_loom_version}"
id 'mod-update' version "${mod_update_version}"
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
id 'com.modrinth.minotaur' version "${minotaur_version}"
id 'com.github.node-gradle.node' version "${node_gradle_version}"
}
apply from: "https://raw.githubusercontent.com/henkelmax/mod-gradle-scripts/${mod_gradle_script_version}/mod.gradle"
repositories {
}
dependencies {
include(modImplementation("maven.modrinth:admiral:${admiral_version}+fabric"))
modImplementation "me.lucko:fabric-permissions-api:${fabric_permission_api_version}"
implementation("com.googlecode.soundlibs:mp3spi:${mp3spi_version}") {
exclude group: 'junit', module: 'junit'
}
shadow("com.googlecode.soundlibs:mp3spi:${mp3spi_version}") {
exclude group: 'junit', module: 'junit'
}
implementation "org.microhttp:microhttp:${microhttp_version}"
shadow "org.microhttp:microhttp:${microhttp_version}"
implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}"
modRuntimeOnly "maven.modrinth:simple-voice-chat:fabric-${voicechat_mod_version}"
Set<String> voicechatModules = [
'fabric-api-base',
'fabric-command-api-v2',
'fabric-lifecycle-events-v1',
'fabric-networking-api-v1',
'fabric-resource-loader-v0',
'fabric-key-binding-api-v1'
]
voicechatModules.forEach {
modRuntimeOnly(fabricApi.module(it, fabric_api_version))
}
}
processResources {
filesMatching('fabric.mod.json') {
expand 'mod_version': mod_version,
'minecraft_dependency': minecraft_dependency,
'minecraft_version': minecraft_version,
'fabric_loader_dependency': fabric_loader_dependency,
'fabric_api_dependency_breaks': fabric_api_dependency_breaks,
'voicechat_api_version': voicechat_api_version
}
exclude '**/.gitkeep'
}
shadowJar {
relocate 'javazoom', "de.maxhenkel.audioplayer.javazoom"
relocate 'org.tritonus', "de.maxhenkel.audioplayer.tritonus"
relocate 'org.microhttp', "de.maxhenkel.audioplayer.microhttp"
}
node {
download = false
nodeProjectDir = file("${project.projectDir}/web")
}
tasks.register('buildWeb', NpmTask) {
group 'web'
args = ['run', 'build']
}
tasks.buildWeb.dependsOn(npmInstall)
tasks.register('copyWeb', Copy) {
group 'web'
from 'web/dist'
into 'src/main/resources/web'
}
tasks.copyWeb.dependsOn(buildWeb)
tasks.processResources.dependsOn(copyWeb)
tasks.register('cleanWeb', Delete) {
group 'web'
delete fileTree(dir: 'src/main/resources/web', exclude: '**/.gitkeep')
delete 'web/dist'
followSymlinks = true
}
tasks.clean.dependsOn(cleanWeb)