This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
128 lines (107 loc) · 3.94 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.31"
maven
signing
}
group = "jp.nephy"
version = "2.0.4"
val ktorVersion = "1.2.0"
repositories {
mavenCentral()
jcenter()
maven("https://dl.bintray.com/kotlin/ktor")
maven("https://dl.bintray.com/kotlin/kotlinx")
}
dependencies {
compile(kotlin("stdlib-jdk8"))
compile("io.ktor:ktor-client-core-jvm:$ktorVersion")
testCompile("io.ktor:ktor-client-apache:$ktorVersion")
testCompile("io.ktor:ktor-client-cio:$ktorVersion")
testCompile("io.ktor:ktor-client-jetty:$ktorVersion")
testCompile("io.ktor:ktor-client-okhttp:$ktorVersion")
compile("jp.nephy:jsonkt:4.10")
compile("io.github.microutils:kotlin-logging:1.6.26")
testCompile("ch.qos.logback:logback-core:1.2.3")
testCompile("ch.qos.logback:logback-classic:1.2.3")
testCompile("org.fusesource.jansi:jansi:1.17.1")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}
val uploadArchives: Upload by tasks
uploadArchives.apply {
repositories {
withConvention(MavenRepositoryHandlerConvention::class) {
mavenDeployer {
beforeDeployment {
signing.signPom(this)
}
val (username, password) = System.getenv("sonatypeUsername") to System.getenv("sonatypePassword")
withGroovyBuilder {
"snapshotRepository"("url" to "https://oss.sonatype.org/content/repositories/snapshots") {
"authentication"("userName" to username, "password" to password)
}
"repository"("url" to "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
"authentication"("userName" to username, "password" to password)
}
}
pom.project {
withGroovyBuilder {
"name"("VRChaKt")
"packaging"("jar")
"artifactId"("vrchakt")
"description"("VRChat Web API wrapper for Kotlin.")
"url"("https://github.com/NephyProject/VRChaKt")
"licenses" {
"license" {
"name"("MIT")
"url"("http://opensource.org/licenses/MIT")
}
}
"developers" {
"developer" {
"id"("SlashNephy")
"name"("Slash Nephy")
"email"("[email protected]")
}
}
"scm" {
"url"("https://github.com/NephyProject/VRChaKt")
"connection"("scm:git:https://github.com/NephyProject/VRChaKt.git")
"developerConnection"("scm:git:git://github.com/NephyProject/VRChaKt.git")
"tag"("HEAD")
}
"issueManagement" {
"system"("GitHub Issues")
"url"("https://github.com/NephyProject/VRChaKt/issues")
}
}
}
}
}
}
}
val javadocJar by tasks.creating(Jar::class) {
classifier = "javadoc"
from(tasks["javadoc"])
}
val sourceSets = the<JavaPluginConvention>().sourceSets
val sourcesJar by tasks.creating(Jar::class) {
classifier = "sources"
from(sourceSets["main"].java.srcDirs)
}
artifacts {
withGroovyBuilder {
"archives"(tasks["jar"], sourcesJar, javadocJar)
}
}
signing {
gradle.taskGraph.whenReady {
isRequired = hasTask("uploadArchives")
}
sign(configurations.archives)
}