forked from Shevchik/BungeePluginManager
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
79 lines (56 loc) · 1.31 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
plugins {
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'java'
}
defaultTasks 'build'
group 'bungeepluginmanager'
version '2.1'
sourceCompatibility = JavaVersion.VERSION_1_8
File targetJarDirectory = new File("target")
task setupFolders(type: DefaultTask) {doLast{
targetJarDirectory.mkdirs()
}}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['resources']
}
}
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
compileOnly group: 'net.md-5', name: 'bungeecord-api', version: '1.15-SNAPSHOT'
compileOnly group: 'org.yaml', name: 'snakeyaml', version: '1.26'
}
compileJava {
options.encoding = 'UTF-8'
options.incremental = false
}
shadowJar {
doFirst {
archivePath.delete()
}
from sourceSets.main.java.srcDirs
from 'LICENSE'
archiveName = jar.archiveName
}
task copyFinalJarToTarget(type: DefaultTask) {doLast{
java.nio.file.Files.copy(
shadowJar.archivePath.getAbsoluteFile().toPath(),
new File(targetJarDirectory, jar.baseName + '.jar').getAbsoluteFile().toPath(),
java.nio.file.StandardCopyOption.REPLACE_EXISTING
)
}}
compileJava.dependsOn(clean)
compileJava.dependsOn(setupFolders)
jar.enabled = false
jar.finalizedBy(shadowJar)
shadowJar.finalizedBy(copyFinalJarToTarget)