-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
134 lines (115 loc) · 4.23 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.0"
kotlin("plugin.serialization") version "1.9.0"
id("org.jetbrains.dokka") version "1.9.0"
id("maven-publish")
id("signing")
id("io.gitlab.arturbosch.detekt") version "1.23.1"
}
group = "com.chromasgaming"
version = "2.0.0"
val ktorVersion: String by project
val kotlinxCoroutinesVersion: String by project
val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
implementation("org.junit.jupiter:junit-jupiter:5.9.0") {
exclude("META-INF/LICENSE.md")
}
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("io.ktor:ktor-client-auth:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.github.oshai:kotlin-logging-jvm:5.1.0")
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion")
}
java {
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("ktweet") {
groupId = "com.chromasgaming"
artifactId = "ktweet"
artifact(javadocJar)
from(components["java"])
pom {
name.set("KTweet")
description.set("KTweet is a Kotlin Library that allows you to consume the Twitter API v2.")
url.set("https://github.com/ChromasIV/KTweet")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("ChromasIV")
name.set("Thomas Carney")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/ChromasIV/KTweet")
}
}
}
}
repositories {
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/ChromasIV/KTweet")
// credentials {
// username = System.getenv("USERNAME")
// password = System.getenv("TOKEN")
// }
// }
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["ktweet"])
}
tasks.kotlinSourcesJar() {}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
systemProperty("consumerKey", System.getProperty("consumerKey"))
systemProperty("consumerSecret", System.getProperty("consumerSecret"))
systemProperty("accessToken", System.getProperty("accessToken"))
systemProperty("accessTokenSecret", System.getProperty("accessTokenSecret"))
systemProperty("clientId", System.getProperty("clientId"))
systemProperty("clientSecret", System.getProperty("clientSecret"))
systemProperty("oauth2AccessToken", System.getProperty("oauth2AccessToken"))
onlyIf { !project.hasProperty("skipTests") }
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}