-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
132 lines (115 loc) · 4.05 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
kotlin("jvm") version "1.6.0"
kotlin("plugin.serialization") version "1.6.0"
id("org.jetbrains.kotlin.plugin.noarg") version "1.6.0"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
group = "com.hcyacg"
version = "0.3.9"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.0-native-mt")
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1")
implementation("com.squareup.okhttp3:okhttp:4.9.3")
implementation("org.apache.commons:commons-lang3:3.12.0")
implementation("org.apache.httpcomponents:httpclient:4.5.13")
implementation("org.jsoup:jsoup:1.14.3")
implementation("org.slf4j:slf4j-api:1.7.33")
implementation("ch.qos.logback:logback-core:1.2.10")
implementation("ch.qos.logback:logback-classic:1.2.10")
implementation("com.google.code.gson:gson:2.8.9")
testImplementation("org.jetbrains.kotlin:kotlin-test:1.6.0")
}
tasks.test {
useJUnit()
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "11"
}
noArg {
annotation("com.lindroid.projectname.annotation.NoArg")
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.register<Zip>("stuffZip") {
archiveBaseName.set("stuff")
from("src/stuff")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = rootProject.name
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set(rootProject.name)
description.set("The Robot Kotlin SDK on Tencent Channel")
url.set("https://github.com/Nekoer/tencent-guild-protocol")
// properties.set(mapOf(
// "myProp" to "value",
// "prop.with.dots" to "anotherValue"
// ))
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("Nekoer")
name.set("Nekoer")
email.set("hcyacg@vip.qq.com")
}
}
scm {
connection.set("scm:git:git://github.com/Nekoer/tencent-guild-protocol.git")
developerConnection.set("scm:git:ssh://github.com/Nekoer/tencent-guild-protocol.git")
url.set("https://github.com/Nekoer/tencent-guild-protocol")
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
val releasesRepoUrl = uri(layout.buildDirectory.dir("repos/releases"))
val snapshotsRepoUrl = uri(layout.buildDirectory.dir("repos/snapshots"))
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(properties["myNexusTokenUsername"].toString())
password.set(properties["myNexusTokenPassword"].toString())
}
}
}