forked from BitcoinJake09/CryptoPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
105 lines (82 loc) · 2.96 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import de.undercouch.gradle.tasks.download.Download
buildscript {
repositories {
jcenter()
}
dependencies {
classpath group: 'eu.appsatori', name: 'gradle-fatjar-plugin', version: '0.3'
classpath group: 'de.undercouch', name: 'gradle-download-task', version: '1.2'
}
}
plugins {
id 'java' // or 'groovy' Must be explicitly applied
id 'com.github.johnrengelman.shadow' version '2.0.2'
}
apply plugin: 'de.undercouch.download'
apply plugin: 'eu.appsatori.fatjar'
group 'cryptoplugin'
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: "com.google.code.gson", name: "gson", version: "2.4"
compile 'commons-codec:commons-codec:1.9'
compile group: 'com.timgroup', name: 'java-statsd-client', version: '3.0.1'
compile group: 'in.ashwanthkumar', name: 'slack-java-webhook', version: '0.0.7'
compile group: 'com.mixpanel', name: 'mixpanel-java', version: '1.4.4'
compile group: 'com.ullink.slack', name: 'simpleslackapi', version: '0.6.0'
compile group: 'org.spigotmc', name: 'spigot-api', version: project.property("apiversion"), { ext { fatJarExclude = true } }
compile group: 'org.spigotmc', name: 'spigot', version: project.property("apiversion"), { ext { fatJarExclude = true } }
}
jar {
actions = []
dependsOn = []
dependsOn('fatJar')
baseName = 'cryptoplugin'
from('resources') {
include 'plugin.yml'
include 'config.yml'
}
}
processResources {
// include 'plugin.yml'
}
task setupWorkspace(dependsOn: ['buildSpigot']) {
}
// START Building Spigot and Bukkit
def spigotBuildDir = new File("$buildDir/spigot/")
task buildSpigot(type: JavaExec) {
if (hasSpigot()) {
enabled = false;
dependsOn = [];
} else {
dependsOn = ['cleanSpigotBuild', 'downloadBuildTool']
}
main = '-jar'
args new File(spigotBuildDir, "BuildTools.jar").getAbsolutePath(),"--rev",project.property("apibuildtoolversion")
workingDir = spigotBuildDir
}
task downloadBuildTool(type: Download) {
spigotBuildDir.mkdirs()
src project.property("buildtoolurl")
dest new File(spigotBuildDir, "BuildTools.jar")
}
task cleanSpigotBuild() {
spigotBuildDir.deleteDir()
}
def hasSpigot() {
def groupId = "org.spigotmc"
def version = project.property("apiversion")
return hasArtifact(groupId, "spigot-api", version) && hasArtifact(groupId, "spigot", version)
}
def hasArtifact(groupId, artifactId, version) {
def localMavenRepo = new File(new File(ant.properties['user.home'] as String), ".m2/repository/")
def file = new File(localMavenRepo, groupId.replace('.', '/') + "/" + artifactId + "/" + version + "/")
return file.exists()
}
// END Building Spigot and Bukkit