-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts.bak
More file actions
117 lines (102 loc) · 3.42 KB
/
Copy pathbuild.gradle.kts.bak
File metadata and controls
117 lines (102 loc) · 3.42 KB
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
plugins {
kotlin("jvm") version "1.9.22"
kotlin("plugin.serialization") version "1.9.22"
id("org.jetbrains.dokka") version "1.9.10"
`maven-publish`
signing
}
group = "io.odxproxy"
version = "0.1.0"
repositories {
mavenCentral()
}
val okHttpVersion = "4.12.0"
val ulidVersion = "5.2.3"
val serializationVersion = "1.6.2"
val coroutinesVersion = "1.8.0"
val junitVersion = "5.10.1"
dependencies {
implementation(kotlin("stdlib"))
implementation("com.squareup.okhttp3:okhttp:$okHttpVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
implementation("com.github.f4b6a3:ulid-creator:$ulidVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("com.squareup.okhttp3:mockwebserver:$okHttpVersion")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlin {
explicitApi()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
javaParameters = true
freeCompilerArgs += listOf("-Xjvm-default=all")
}
}
tasks.withType<Jar> {
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
// CRITICAL: This gives your library a proper name for Java 9+ Modules
"Automatic-Module-Name" to "io.odxproxy"
)
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.named<org.jetbrains.dokka.gradle.DokkaTask>("dokkaHtml") {
outputDirectory.set(layout.buildDirectory.dir("javadoc"))
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
// This line is the magic. It tells Gradle to take the compiled Jar + Sources + Javadoc
from(components["java"])
// This is metadata required for Maven Central
pom {
name.set("ODXProxy Java Client")
description.set("High-performance Java/Kotlin client for ODXProxy Gateway.")
url.set("https://github.com/terrakernel/odxproxy-java")
licenses {
license {
name.set("MIT License")
url.set("http://www.opensource.org/licenses/mit-license.php")
}
}
developers {
developer {
id.set("jwajong")
name.set("Julian Wajong")
email.set("julian.wajong@gmail.com")
organization.set("TERRAKERNEL PTE. LTD.")
}
}
scm {
connection.set("scm:git:git://github.com/terrakernel/odxproxy-java.git")
url.set("https://github.com/terrakernel/odxproxy-java")
}
}
}
}
}
signing {
// Only try to sign if keys are present (prevents build failure on local machines without GPG)
if (project.hasProperty("signing.keyId")) {
// useGpgCmd()
sign(publishing.publications["mavenJava"])
}
}