This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
72 lines (63 loc) · 1.56 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
plugins {
kotlin("jvm") version "1.4.0"
id("net.minecrell.plugin-yml.bukkit") version "0.3.0"
`maven-publish`
}
group = "me.syari.ss.kotlin"
version = "1.4.0"
val ssMavenRepoUploadURL: String by extra
val ssMavenRepoUploadUser: String by extra
val ssMavenRepoUploadPassword: String by extra
repositories {
mavenCentral()
maven {
url = uri("https://papermc.io/repo/repository/maven-public/")
}
}
dependencies {
implementation("com.destroystokyo.paper:paper-api:1.16.2-R0.1-SNAPSHOT")
compileOnly(kotlin("stdlib-jdk8"))
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
bukkit {
name = project.name
version = project.version.toString()
main = "$group.Main"
author = "sya_ri"
apiVersion = "1.16"
commands {
register("ss-kotlin") {
description = "Display Kotlin Version & Package"
}
}
}
val jar by tasks.getting(Jar::class) {
from(configurations.compileOnly.get().map {
if (it.isDirectory) it else zipTree(it)
})
}
val sourceJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava.srcDirs)
}
publishing {
repositories {
maven {
url = uri(ssMavenRepoUploadURL)
credentials {
username = ssMavenRepoUploadUser
password = ssMavenRepoUploadPassword
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifact(sourceJar.get())
}
}
}