-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
152 lines (132 loc) · 4.59 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import org.gradle.jvm.tasks.Jar
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
application
`java-library`
`maven-publish`
signing
jacoco
kotlin("jvm") version "1.6.10"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("org.jetbrains.dokka") version "1.7.10"
}
val artifactName = "sdk-jvm"
val artifactGroup = "io.kuzzle"
val artifactVersion = "1.3.2"
val pomUrl = "https://github.com/kuzzleio/sdk-jvm"
val pomScmUrl = "https://github.com/kuzzleio/sdk-jvm"
val pomScmConnection = "git@github.com/kuzzleio/sdk-jvm"
val pomIssueUrl = "https://github.com/kuzzleio/sdk-jvm/issues"
val pomDesc = "https://github.com/kuzzleio/sdk-jvm"
val githubRepo = "kuzzleio/sdk-jvm"
val githubReadme = "README.md"
val pomLicenseName = "MIT"
val pomLicenseUrl = "https://opensource.org/licenses/mit-license.php"
val pomLicenseDist = "repo"
val pomDeveloperId = "kuzzleio"
val pomDeveloperName = "kuzzle"
group = "io.kuzzle.sdk"
version = "1.3.3"
val ktorVersion = "1.6.8"
repositories {
mavenCentral()
}
configurations {
register("cucumberRuntime") {
extendsFrom(testImplementation.get())
}
}
dependencies {
implementation(kotlin("stdlib"))
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-websockets:$ktorVersion")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-json:$ktorVersion")
implementation("io.ktor:ktor-client-gson:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("com.google.code.gson:gson:2.9.0")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("io.mockk:mockk:1.12.4")
testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
testImplementation("io.ktor:ktor-client-mock-jvm:$ktorVersion")
testImplementation("io.ktor:ktor-client-json-jvm:$ktorVersion")
testImplementation("io.ktor:ktor-client-mock-js:1.3.1")
testImplementation("io.ktor:ktor-client-mock-native:1.3.1")
testImplementation("org.mock-server:mockserver-netty:5.3.0")
testImplementation("io.cucumber:cucumber-java8:7.3.3")
testImplementation("io.cucumber:cucumber-junit:7.3.3")
}
application {
mainClass.set("io.kuzzle.sdk.protocol")
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Test> {
this.testLogging {
this.showStandardStreams = true
}
}
val javadocJar = tasks.named<Jar>("javadocJar") {
from(tasks.named("dokkaJavadoc"))
}
tasks.named<Jar>("jar") {
archiveClassifier.set("without-dependencies")
}
tasks {
named<ShadowJar>("shadowJar") {
archiveClassifier.set("")
archiveBaseName.set(artifactName)
manifest {
attributes(mapOf("Main-Class" to application.mainClass.get()))
}
}
}
publishing {
repositories {
maven {
credentials {
username = "Kuzzle"
password = System.getenv("OSSRH_PASSWORD")
}
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
}
}
publications {
create<MavenPublication>("kuzzle-sdk-jvm") {
groupId = artifactGroup
artifactId = artifactName
version = artifactVersion
artifact(tasks["jar"])
artifact(tasks["sourcesJar"])
artifact(tasks["shadowJar"])
artifact(tasks["javadocJar"])
pom.withXml {
asNode().apply {
appendNode("description", pomDesc)
appendNode("name", rootProject.name)
appendNode("url", pomUrl)
appendNode("licenses").appendNode("license").apply {
appendNode("name", pomLicenseName)
appendNode("url", pomLicenseUrl)
appendNode("distribution", pomLicenseDist)
}
appendNode("developers").appendNode("developer").apply {
appendNode("id", pomDeveloperId)
appendNode("name", pomDeveloperName)
}
appendNode("scm").apply {
appendNode("url", pomScmUrl)
appendNode("connection", pomScmConnection)
}
}
}
}
}
}
signing {
useInMemoryPgpKeys(System.getenv("MAVEN_CENTRAL_GPG"), System.getenv("MAVEN_CENTRAL_GPG_PASSWORD"))
sign(publishing.publications["kuzzle-sdk-jvm"])
}