forked from DRSchlaubi/discordstats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
128 lines (108 loc) · 3.35 KB
/
build.gradle.kts
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
import com.jfrog.bintray.gradle.BintrayExtension
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.LinkMapping
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.jfrog.bintray") version "1.8.4"
id("org.jetbrains.dokka") version "0.9.18"
kotlin("jvm") version "1.3.21"
java
`maven-publish`
}
group = "me.schlaubi"
version = "1.0"
// Variables
val slf4jVersion = "1.7.26"
val okHttpVersion = "3.14.0"
repositories {
mavenCentral()
jcenter()
}
dependencies {
// HTTP
compile("com.squareup.okhttp3", "okhttp", okHttpVersion)
// JSON
compile("org.json", "json", "20180813")
// Logging
compile("org.slf4j", "slf4j-api", slf4jVersion)
// Util
compile("com.google.guava:guava:27.1-jre")
// Kotlin
implementation(kotlin("stdlib-jdk8"))
// API Wrappers
@Suppress("SpellCheckingInspection")
implementation("net.dv8tion:JDA:4.ALPHA.0_67")
implementation("com.discord4j:discord4j-core:3.0.1")
// Tests
testCompile("junit", "junit", "4.12")
testCompile("org.slf4j", "slf4j-simple", slf4jVersion)
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
setPublications("mavenJava")
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
repo = "maven"
name = "discordstats"
userOrg = "drschlaubi"
setLicenses("GPL-3.0")
vcsUrl = "https://github.com/DRSchlaubi/discordstats.git"
version(delegateClosureOf<BintrayExtension.VersionConfig> {
name = project.version as String
})
})
}
val dokkaJar by tasks.creating(Jar::class)
val sourcesJar by tasks.creating(Jar::class)
artifacts {
add("archives", sourcesJar)
add("archives", dokkaJar)
}
tasks {
dokka {
outputFormat = "html"
outputDirectory = "docs"
jdkVersion = 8
reportUndocumented = true
impliedPlatforms = mutableListOf("JVM")
sourceDirs = files("src/main/kotlin", "src/main/java")
sourceDirs.forEach {
val relativePath = rootDir.toPath().relativize(it.toPath()).toString()
linkMapping(delegateClosureOf<LinkMapping> {
dir = it.absolutePath
url = "https://github.com/DRSchlaubi/discordstats/tree/master/$relativePath"
suffix = "#L"
})
}
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = uri("https://www.slf4j.org/api/").toURL()
})
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = uri("https://square.github.io/okhttp/3.x/okhttp/").toURL()
})
}
"sourcesJar"(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
"dokkaJar"(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("javadoc")
from(dokka)
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(sourcesJar)
artifact(dokkaJar)
}
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}