-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
85 lines (70 loc) · 2.01 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
`maven-publish`
kotlin("jvm") version "1.7.20"
}
group = "club.minnced"
version = "1.6.0"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
compileOnly("net.dv8tion:JDA:5.0.0-beta.1")
api("io.projectreactor:reactor-core:3.5.0")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions:1.2.0")
implementation(kotlin("stdlib"))
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
val jar: Jar by tasks
val javadoc: Javadoc by tasks
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
javadoc.apply {
isFailOnError = false
options.memberLevel = JavadocMemberLevel.PUBLIC
options.encoding = "UTF-8"
if (options is StandardJavadocDocletOptions) {
val opt = options as StandardJavadocDocletOptions
opt.author()
opt.links(
"https://projectreactor.io/docs/core/3.5.0.RELEASE/api/",
"https://docs.oracle.com/javase/8/docs/api/",
"https://ci.dv8tion.net/job/JDA5/javadoc")
if (JavaVersion.current().isJava9Compatible) {
opt.addBooleanOption("html5", true)
opt.addStringOption("-release", "8")
}
}
}
val sourcesJar = task<Jar>("sourcesJar") {
from(sourceSets["main"].allSource)
classifier = "sources"
}
val javadocJar = task<Jar>("javadocJar") {
from(javadoc.destinationDir)
classifier = "javadoc"
dependsOn(javadoc)
}
val build: Task by tasks
build.apply {
dependsOn(javadocJar)
dependsOn(sourcesJar)
dependsOn(jar)
}
publishing.publications {
register<MavenPublication>("Release") {
from(components["java"])
groupId = project.group as String
artifactId = project.name
version = project.version as String
artifact(javadocJar)
artifact(sourcesJar)
}
}