-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
88 lines (69 loc) · 2.14 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
plugins {
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id "com.github.johnrengelman.shadow" version "7.1.2"
}
// We're keeping this up here so flavor can resolve within the
// parent directory, not the modules
def platforms = ["spigot", "velocity"]
def flavor = fileTree("flavor")
allprojects {
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.jetbrains.kotlin.jvm'
ext {
// dependency versions
kotlinVersion = '1.6.10'
getCurrentShortRevision = {
new ByteArrayOutputStream().withStream { os ->
exec {
executable = "git"
args = ["rev-parse", "HEAD"]
standardOutput = os
}
return os.toString().trim().substring(0, 8)
}
}
setProperty("revision", getCurrentShortRevision)
}
group 'design.lmao.lmaolib'
version ext.getProperty("revision")
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://jitpack.io'
}
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
// TODO: replace with dependency version constants
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
compileOnly 'com.google.code.gson:gson:2.9.0'
if (platforms.contains(project.name)) {
implementation flavor
} else {
compileOnly flavor
}
}
compileKotlin {
kotlinOptions.javaParameters = true
kotlinOptions.jvmTarget = "1.8"
}
shadowJar {
archiveClassifier.set("")
exclude "**/*.kotlin_metadata"
exclude "**/*.kotlin_builtins"
exclude "META-INF/"
archiveFileName = "dbllib-${project.name}.jar"
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
}
tasks.build.dependsOn(shadowJar)
}