-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
154 lines (130 loc) · 4.45 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
153
154
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.6.21"
kotlin("plugin.serialization") version "1.6.21"
id("org.jetbrains.dokka") version "1.6.21"
id("com.github.johnrengelman.shadow") version "7.1.2"
java
`java-library`
`maven-publish`
signing
}
group = "net.nurigo"
version = "4.3.2"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation("org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.4.0")
implementation("commons-codec:commons-codec:1.15")
implementation("com.squareup.okhttp3:okhttp:4.10.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0")
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.6.21")
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.named<ShadowJar>("shadowJar") {
mergeServiceFiles()
exclude("**/*.kotlin_metadata")
exclude("**/*.kotlin_builtins")
archiveClassifier.set("")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
tasks.withType<JavaCompile>().configureEach {
javaCompiler.set(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(8))
})
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(mapOf("Main-Class" to "net.nurigo.sdk.NurigoApp"))
}
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
jvmTarget = "1.8"
}
tasks.dokkaHtml.configure {
outputDirectory.set(rootDir.resolve("docs"))
}
val ossusername: String by project
val osspassword: String by project
publishing {
repositories {
maven {
name = "oss"
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = ossusername
password = osspassword
}
}
}
publications {
create<MavenPublication>("mavenJava") {
groupId = group.toString()
artifactId = "sdk"
version = version
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("Nurigo SDK")
description.set("누리고 서비스에서 사용되는 문자 발송용 SDK")
url.set("https://github.com/nurigo/java-sdk")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("Nurigo CX Team")
email.set("contact@nurigo.net")
organization.set("Nurigo Inc")
}
developer {
id.set("hosy")
name.set("Hosy Lee")
email.set("hosy@nurigo.net")
organization.set("Nurigo Inc")
}
}
scm {
connection.set("scm:git:git://github.com/nurigo/java-sdk.git")
developerConnection.set("scm:git:ssh://github.com/nurigo/java-sdk.git")
url.set("https://github.com/nurigo/java-sdk")
}
}
}
}
}
signing {
sign(publishing.publications)
}