Newer
Older
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
apply plugin: 'java'
apply plugin: 'maven'
group = 'io.github.packserver.RegPlug'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets {
main {
java {
srcDir 'src/'
}
resources {
if(System.getenv().containsKey("IS_RELEASE"))
srcDirs = ['resources', 'config/false']
else
srcDirs = ['resources', 'config/true']
}
}
}
repositories {
mavenCentral()
maven {
name 'Spigot'
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name 'BungeeCord'
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
name 'InventiveTalent'
url "https://repo.inventivetalent.org/content/groups/public/"
}
}
// Simple hack for provided dependencies
configurations {
provided
compile.extendsFrom provided
}
dependencies {
compile group: 'org.java-websocket', name: 'Java-WebSocket', version:'1.3.0'
compile group: 'org.spigotmc', name: 'spigot-api', version:'1.10-R0.1-SNAPSHOT'
compile group: 'org.bukkit', name: 'bukkit', version:'1.10-R0.1-SNAPSHOT'
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
}
// Simple hack for provided dependencies
jar {
dependsOn configurations.runtime
from {
(configurations.runtime - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
task copyJarToBin(type: Copy) {
from "${buildDir}/libs/RegPlug-0.0.1-SNAPSHOT.jar"
if(System.getenv().containsKey("IS_RELEASE"))
into "/Users/spotlight/Projects/RPi/toCopy"
else
// into "/Users/spotlight/Projects/Minecraft/Testing/plugins"
into "/Users/spotlight/Projects/Minecraft/Testing/plugins"
}
task sendToPi(type: Exec,dependsOn:[copyJarToBin]) {
if(System.getenv().containsKey("IS_RELEASE"))
commandLine "bash", "/Users/spotlight/Projects/RPi/upload.sh", "RegPlug-0.0.1-SNAPSHOT.jar", "30632/plugins"
else
commandLine "/usr/bin/true"
}
sendToPi.mustRunAfter build
build.finalizedBy sendToPi