-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
84 lines (70 loc) · 1.82 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
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'org.jetbrains.kotlin.jvm' version '1.9.23'
id 'maven-publish'
}
group 'me.devoxin'
version '4.2.1'
repositories {
maven {
url 'https://m2.dv8tion.net/releases'
name 'm2-dv8tion'
}
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
def kotlinVersion = '1.9.23'
def coroutinesVersion = '1.6.4'
def jdaVersion = '5.0.0-beta.21'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation 'org.reflections:reflections:0.10.2'
compileOnly "net.dv8tion:JDA:$jdaVersion"
api 'org.slf4j:slf4j-api:1.7.36'
testImplementation "net.dv8tion:JDA:$jdaVersion"
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
String getBuildVersion() {
def gitVersion = new ByteArrayOutputStream()
exec {
commandLine('git', 'rev-parse', '--short', 'HEAD')
standardOutput = gitVersion
}
return "$version\n${gitVersion.toString().trim()}"
}
task writeVersion() {
def resourcePath = sourceSets.main.resources.srcDirs[0]
def resources = file(resourcePath)
if (!resources.exists()) {
resources.mkdirs()
}
file("$resourcePath/flight.txt").text = getBuildVersion()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}
task mavenPublishTask {
doLast {
publishToMavenLocal
}
}
build {
dependsOn writeVersion
finalizedBy(mavenPublishTask)
}
shadowJar {
dependsOn writeVersion
finalizedBy(mavenPublishTask)
}