-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
134 lines (109 loc) · 3.66 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
129
130
131
132
133
134
/*
* Copyright (c) 2021 kotx__
*/
plugins {
kotlin("jvm") version "1.6.0"
kotlin("plugin.serialization") version "1.6.0"
id("org.jetbrains.dokka") version "1.5.30"
`maven-publish`
signing
}
val projectName: String = "flylib-reloaded"
val projectGroup: String = "dev.kotx"
val projectVersion: String = "0.5.0"
group = projectGroup
version = projectVersion
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib:1.6.0")
api("org.jetbrains.kotlin:kotlin-reflect:1.6.0")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1")
api("io.insert-koin:koin-core:3.1.3")
api("io.insert-koin:koin-core-ext:3.0.2")
compileOnly("com.destroystokyo.paper", "paper-api", "1.16.5-R0.1-SNAPSHOT")
compileOnly(fileTree("./libs"))
dokkaGfmPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.5.31")
}
java {
withJavadocJar()
withSourcesJar()
}
tasks {
javadoc {
options.encoding = "UTF-8"
}
dokkaHtml.configure {
outputDirectory.set(file("./dokka/html"))
}
dokkaJavadoc.configure {
outputDirectory.set(file("./dokka/javadoc"))
}
}
val packageJavadoc: TaskProvider<Jar> by tasks.registering(Jar::class) {
from(tasks.javadoc.get().destinationDir)
archiveClassifier.set("javadoc")
archiveExtension.set("jar")
dependsOn(tasks.javadoc)
}
val packageSources: TaskProvider<Jar> by tasks.registering(Jar::class) {
from(sourceSets.main.get().allSource)
archiveClassifier.set("sources")
archiveExtension.set("jar")
}
publishing {
publications {
create<MavenPublication>("release") {
from(components["kotlin"])
artifactId = projectName
groupId = projectGroup
version = projectVersion
artifact(packageJavadoc)
artifact(packageSources)
pom {
name.set(projectName)
description.set("An utility library for Minecraft Paper that provides commands, menus, Kotlin extensions, and more.")
url.set("https://github.com/TeamKun/flylib-reloaded")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/mit-license.php")
}
}
developers {
developer {
id.set("kotx__")
name.set("kotlin chan")
}
}
organization {
name.set("TeamKun")
url.set("https://github.com/TeamKun")
}
scm {
connection.set("[email protected]:TeamKun/flylib-reloaded.git")
developerConnection.set("[email protected]:TeamKun/flylib-reloaded.git")
url.set("https://github.com/TeamKun/flylib-reloaded")
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
val mavenUserName = if (hasProperty("maven_username")) findProperty("maven_username") as String else ""
val mavenPassword = if (hasProperty("maven_password")) findProperty("maven_password") as String else ""
credentials {
username = mavenUserName
password = mavenPassword
}
}
}
}
signing {
sign(publishing.publications["release"])
}