-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle.kts
140 lines (121 loc) · 3.3 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
plugins {
kotlin("jvm") version "1.8.21"
id("org.jmailen.kotlinter") version "3.15.0"
id("org.jetbrains.dokka") version "1.8.20"
`maven-publish`
`java-library`
application
signing
jacoco
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
kotlin {
jvmToolchain(8)
}
dependencies {
// ////////////////////////////////
// Public dependencies
// OkHttp 3 - Http client (without Kotlin dependency of version 4)
api("com.squareup.okhttp3:okhttp:3.14.5")
// Moshi JSON library
implementation("com.squareup.moshi:moshi:1.15.0")
implementation("com.squareup.moshi:moshi-kotlin:1.15.0")
implementation("com.squareup.moshi:moshi-adapters:1.15.0")
// SLF4J for logging facade
implementation("org.slf4j:slf4j-api:2.0.7")
// Render dokka from the Java perspective
dokkaPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.8.20")
// Test dependencies
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.mockito:mockito-inline:4.11.0")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
}
tasks.jacocoTestReport {
classDirectories.setFrom(
files(
classDirectories.files.map {
fileTree(it) {
exclude(
"com/nylas/models/**",
"com/nylas/interceptors/**",
)
}
},
),
)
reports {
xml.required.set(true)
csv.required.set(true)
html.required.set(true)
}
}
tasks.test {
finalizedBy(tasks.jacocoTestReport)
useJUnitPlatform()
}
tasks.processResources {
expand("artifact_version" to project.version)
}
tasks.register<Jar>("sourceJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
tasks.register<Jar>("uberJar") {
archiveClassifier.set("uber")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("Nylas SDK for Kotlin & Java")
description.set("Kotlin & Java SDK for the Nylas Communication Platform")
url.set("https://github.com/nylas/nylas-java")
licenses {
license {
name.set("MIT")
url.set("http://www.opensource.org/licenses/mit-license.php")
}
}
developers {
developer {
id.set("mrashed-dev")
name.set("Mostafa Rashed")
organization.set("Nylas")
organizationUrl.set("https://www.nylas.com/")
}
}
scm {
url.set("https://github.com/nylas/nylas-java")
connection.set("scm:git:https://github.com/nylas/nylas-java.git")
developerConnection.set("scm:git:https://github.com/nylas/nylas-java.git")
}
}
}
}
repositories {
maven {
name = "ossrh"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials(PasswordCredentials::class)
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}