-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.gradle
74 lines (65 loc) · 1.88 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
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'eclipse'
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
maven { url "http://nexus.hc.to/content/repositories/pub_releases" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
ext.mcversion = '1.11.2'
version = '0.1'
// In this section you declare the dependencies for your production and test code
dependencies {
compile "org.spigotmc:spigot-api:1.11.2-R0.1-SNAPSHOT"
compile "net.milkbowl.vault:VaultAPI:1.6"
compile fileTree(dir: 'lib', include: '*.jar')
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
jar {
version = version
from file('plugin.yml')
from file('config.yml')
}
clean {
delete fileTree(dir: 'lib', include: 'spigot-*.jar')
}
task setup(dependsOn: 'setupDownload') {
def spigotJar = new File('lib/spigot-' + mcversion + '.jar')
if (!spigotJar.exists()) {
spigotJar.getParentFile().mkdirs();
doFirst {
javaexec {
workingDir 'setup'
classpath 'setup/BuildTools.jar'
main 'org.spigotmc.builder.Builder'
args '--rev', mcversion
}
}
doLast {
copy {
from 'setup/spigot-' + mcversion + '.jar'
into 'lib'
}
}
}
}
task setupDownload {
File buildTools = new File('setup/BuildTools.jar')
if (!buildTools.exists()) {
buildTools.getParentFile().mkdirs();
println 'Downloading Spigot BuildTools...'
new URL('https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar').withInputStream{ i -> buildTools.withOutputStream{ it << i }}
}
}
build.dependsOn setup