-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
83 lines (69 loc) · 2.41 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
plugins {
id "java-library"
id "maven-publish"
id "idea"
id "com.github.ben-manes.versions" version "$versionsPluginVersion"
id "org.ajoberstar.grgit" version "$grgitPluginVersion"
}
group = "space.npstr.prometheus_extensions"
version = "1.10.1"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
vendor = JvmVendorSpec.ADOPTIUM
}
withSourcesJar()
consistentResolution {
useCompileClasspathVersions()
}
}
repositories {
mavenCentral()
maven {
url "https://m2.dv8tion.net/releases"
content { includeModule("net.dv8tion", "JDA") }
content { includeGroup("club.minnced") }
}
// maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // D4J snapshots
// maven { url "https://repo.spring.io/milestone" } // D4J snapshots
}
dependencies {
api platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
api "io.prometheus:prometheus-metrics-core"
compileOnly "net.ttddyy:datasource-proxy:$dsProxyVersion"
compileOnly "net.dv8tion:JDA:$jdaVersion"
// required for user count hax
compileOnly "net.sf.trove4j:trove4j:$troveVersion"
compileOnly "it.unimi.dsi:fastutil:$fastutilVersion"
compileOnly "com.discord4j:discord4j-core:$d4jCoreVersion"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testImplementation"org.junit.jupiter:junit-jupiter-api"
testImplementation"net.dv8tion:JDA:$jdaVersion"
testImplementation"org.mockito:mockito-core"
testImplementation"org.assertj:assertj-core"
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
static def isNonStable(String version) {
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?(_[0-9]+)?$/
return !stableKeyword && !(version ==~ regex)
}
// https://github.com/ben-manes/gradle-versions-plugin
tasks.withType(com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask) {
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
publishing {
publications {
create("main", MavenPublication) {
from(components.java)
}
}
}