forked from Walkyst/Lavalink-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
200 lines (168 loc) · 5.52 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
buildscript {
ext.kotlin_version = '1.5.31'
ext {
grgitVersion = '2.2.1'
sonarqubeVersion = '2.6.2'
}
repositories {
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
maven { url "https://jitpack.io" }
mavenLocal()
}
dependencies {
classpath "org.ajoberstar:grgit:${grgitVersion}"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:${sonarqubeVersion}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'idea'
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'org.ajoberstar.grgit'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
group = 'com.fredboat.lavalink.client'
version = "1.0"
description = 'JDA based client for the Lavalink-Server'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven {
name 'm2-dv8tion'
url 'https://m2.dv8tion.net/releases'
}
mavenCentral()
maven { url "https://jitpack.io" }
mavenLocal()
}
ext {
//@formatter:off
gradleVersion = '6.1.1'
lavaplayerVersion = '1.3.98.3'
jdaVersion = '5.0.0-alpha.17'
javaWebSocketVersion = '1.5.1'
slf4jVersion = '1.7.25'
jsonOrgVersion = '20180130'
jsoupVersion = '1.14.3'
jdaVersion = '4.1.1_135'
spotbugsAnnotationsVersion = '3.1.3'
prometheusVersion = '0.4.0'
junitJupiterVersion = '5.2.0'
junitPlatformVersion = '1.2.0'
logbackVersion = '1.2.3'
unirestVersion = '1.4.9'
//@formatter:on
}
dependencies {
compile(group: 'com.github.walkyst.lavaplayer-fork', name: 'lavaplayer', version: lavaplayerVersion) {
exclude group: 'com.github.walkyst', module: 'lavaplayer-natives-fork'
}
compile group: 'org.java-websocket', name: 'Java-WebSocket', version: javaWebSocketVersion
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
compile group: 'org.json', name: 'json', version: jsonOrgVersion
compile group: 'org.jsoup', name: 'jsoup', version: jsoupVersion
implementation group: 'net.dv8tion', name: 'JDA', version: '5.0.0-alpha.17'
//testCompile group: 'net.dv8tion', name: 'JDA', version: jdaVersion
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
compileOnly group: 'io.prometheus', name: 'simpleclient', version: prometheusVersion
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion
testCompile group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion
testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: junitPlatformVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion
testCompile group: 'com.mashape.unirest', name: 'unirest-java', version: unirestVersion
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
compileJava {
dependsOn(clean)
options.encoding = 'UTF-8'
compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
wrapper {
gradleVersion = project.ext.gradleVersion
//noinspection UnnecessaryQualifiedReference
distributionType = Wrapper.DistributionType.ALL
}
build {
doLast {
println 'Version: ' + version
}
}
test {
useJUnitPlatform()
systemProperty("TEST_TOKEN", System.getProperty("TEST_TOKEN"))
systemProperty("TEST_VOICE_CHANNEL", System.getProperty("TEST_VOICE_CHANNEL"))
jacoco {
includes['lavalink.client.*']
}
}
sonarqube {
properties {
property "sonar.inclusions", "src/main/java/**/*"
}
}
jar.mustRunAfter clean
publishToMavenLocal.dependsOn jar
// called by jitpack
task install {
dependsOn test
dependsOn publishToMavenLocal
doLast {
println 'Version: ' + version
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
classifier 'sources'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
groupId project.group
artifactId project.name
version project.version
pom {
name = project.name
description = project.description
url = 'https://github.com/FredBoat/Lavalink-Client'
licenses {
license {
name = 'MIT'
url = 'https://choosealicense.com/licenses/mit/'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/FredBoat/Lavalink-Client'
}
}
}
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
@SuppressWarnings("GrMethodMayBeStatic")
String versionFromTag() {
def headTag = grgit.tag.list().find {
it.commit == grgit.head()
}
def clean = grgit.status().clean //uncommitted changes? -> should be SNAPSHOT
if (headTag && clean) {
headTag.getName()
} else {
"${grgit.head().id}-SNAPSHOT"
}
}