forked from Mantaro/MantaroBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
134 lines (97 loc) · 2.92 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* Mantaro's build.gradle */
//Imports
import org.apache.tools.ant.filters.ReplaceTokens
//Plugins
plugins {
//Compiles Java
id 'java'
//Adds an Executable Manifest
id 'application'
//Creates FatJars
id 'com.github.johnrengelman.shadow' version '1.2.4'
//Checks for RestActions
id 'com.sedmelluq.jdaction' version '1.0.1'
}
//Define the Main Class
mainClassName = "net.kodehawa.mantarobot.MantaroBot"
//Use an unified versioning system
def ver = new Version(major: 4, minor: 4, revision: 2)
version ver.toString()
//We are going to use Java 8
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
maven { url 'https://jitpack.io' }
mavenLocal()
}
dependencies {
compile 'net.dv8tion:JDA:3.1.1_210'
compile 'com.sedmelluq:lavaplayer:1.2.39'
compile 'com.sedmelluq:jda-nas:1.0.5'
compile 'org.reflections:reflections:0.9.10'
compile 'ch.qos.logback:logback-classic:0.9.26'
compile 'org.apache-extras.beanshell:bsh:2.0b6'
compile 'us.monoid.web:resty:0.3.2'
compile 'org.jsoup:jsoup:1.8.3'
compile 'br.com.brjdevs:utils:1.0.0_15'
compile 'br.com.brjdevs:network:1.0.0_2'
compile 'br.com.brjdevs:trove-utils:1.0.0_4'
compile 'com.google.guava:guava:22.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0.pr1'
compile 'com.rethinkdb:rethinkdb-driver:2.3.3'
compile 'mysql:mysql-connector-java:6.0.4'
compile 'net.sf.trove4j:trove4j:3.0.3'
compile 'com.patreon:patreon:0.1.1'
compile 'org.springframework.boot:spring-boot-starter-web:1.4.3.RELEASE'
compile 'net.jodah:expiringmap:0.5.8'
compile 'joda-time:joda-time:2.9.9'
compile fileTree(dir: 'lib', include: '*.jar')
compileOnly "org.projectlombok:lombok:1.16.16"
}
task wrapper(type: Wrapper) {
gradleVersion = '3.2'
}
//Task for the versioning system
task prepareSource(type: Copy) {
from 'src/main/java'
into 'build/prepared-src'
filter(ReplaceTokens, tokens: [
version: ver.toString()
])
dependsOn clean
}
prepareSource.dependsOn clean
compileJava {
source = prepareSource.destinationDir
classpath = sourceSets.main.compileClasspath
options.encoding = 'UTF-8'
dependsOn prepareSource
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
build.dependsOn shadowJar
artifacts {
archives shadowJar
}
task cleanDistTar(type: Delete) { delete files(distTar) }
distTar { classifier = "trash" }
distTar.finalizedBy cleanDistTar
task cleanDistZip(type: Delete) { delete files(distZip) }
distZip { classifier = "trash" }
distZip.finalizedBy cleanDistZip
task cleanShittyJar(type: Delete) { delete files(jar) }
jar { classifier = "trash" }
jar.finalizedBy cleanShittyJar
shadowJar { classifier = "" }
class Version {
String major, minor, revision
static String getBuild() {
System.getenv("BUILD_NUMBER") ?: System.getProperty("BUILD_NUMBER") ?: "DEV-" + new Date().format('ddMMyyyy')
}
String toString() {
"${major}.${minor}.${revision}_$build"
}
}