forked from Mantaro/MantaroBot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
151 lines (121 loc) · 3.85 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* Copyright (C) 2016-2018 David Alejandro Rubio Escares / Kodehawa
*
* Mantaro is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Mantaro is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Mantaro. If not, see http://www.gnu.org/licenses/
*/
/* 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
//aka did you queue but harsh
id 'com.sedmelluq.jdaction' version '1.0.1'
//Tell me when smth is outdated
id 'com.github.ben-manes.versions' version '0.16.0'
}
//Define the Main Class
mainClassName = "net.kodehawa.mantarobot.MantaroBot"
//Use an unified versioning system
def ver = new Version(major: 4, minor: 8, revision: 5)
version ver.toString()
//We are going to use Java 8
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://dl.bintray.com/kodehawa/maven" }
maven { url 'https://dl.bintray.com/natanbc/maven' }
mavenLocal()
}
dependencies {
compile 'net.dv8tion:JDA:3.5.0_335'
compile 'com.sedmelluq:lavaplayer:1.2.47'
compile 'com.sedmelluq:jda-nas:1.0.6'
compile 'org.reflections:reflections:0.9.9'
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 '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.1'
compile 'com.rethinkdb:rethinkdb-driver:2.3.3'
compile 'org.redisson:redisson:3.5.3'
compile 'io.sentry:sentry:1.2.0'
compile 'net.jodah:expiringmap:0.5.8'
compile 'org.apache.commons:commons-lang3:3.6'
compile fileTree(dir: 'lib', include: '*.jar')
compile 'net.kodehawa:imageboard-api:2.0.3_2'
compile 'com.github.natanbc:discordbots-api:1.4.2'
compileOnly "org.projectlombok:lombok:1.16.16"
compile 'com.datadoghq:java-dogstatsd-client:2.3'
compile 'com.github.natanbc:java-eval:1.0'
//Basically for FinderUtil
compile 'com.jagrosh:JDA-Utilities:1.9'
}
task wrapper(type: Wrapper) {
gradleVersion = '3.2'
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
options.encoding = 'UTF-8'
}
//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
}
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 cleanUnshadedJar(type: Delete) { delete files(jar) }
jar { classifier = "trash" }
jar.finalizedBy cleanUnshadedJar
shadowJar {
classifier = ""
}
class Version {
String major, minor, revision
String toString() {
"${major}.${minor}.${revision}"
}
}