-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
122 lines (103 loc) · 3.97 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.22"
`java-library`
application
signing
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
description = "Sqiffy | Parent module"
allprojects {
apply(plugin = "java-library")
apply(plugin = "signing")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "application")
apply(plugin = "signing")
group = "com.dzikoysk.sqiffy"
version = "1.0.0-alpha.64"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
languageVersion = "1.9"
freeCompilerArgs = listOf(
"-Xjvm-default=all", // For generating default methods in interfaces
"-Xcontext-receivers"
)
}
}
repositories {
mavenCentral()
}
afterEvaluate {
description
?.takeIf { it.isNotEmpty() }
?.split("|")
?.let { (projectName, projectDescription) ->
publishing {
publications {
create<MavenPublication>("library") {
pom {
name.set(projectName.trim())
description.set(projectDescription.trim())
url.set("https://github.com/dzikoysk/sqiffy")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("dzikoysk")
name.set("dzikoysk")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/dzikoysk/sqiffy.git")
developerConnection.set("scm:git:ssh://github.com/dzikoysk/sqiffy.git")
url.set("https://github.com/dzikoysk/sqiffy.git")
}
}
from(components.getByName("java"))
}
}
}
if (findProperty("signing.keyId").takeIf { it?.toString()?.trim()?.isNotEmpty() == true } != null) {
signing {
sign(publishing.publications.getByName("library"))
}
}
}
}
}
subprojects {
dependencies {
api("com.zaxxer:HikariCP:5.0.1")
val junit = "5.9.3"
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit")
testImplementation("org.assertj:assertj-core:3.24.1")
}
tasks.test {
useJUnitPlatform()
}
}
nexusPublishing {
repositories.sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
username.set(getEnvOrProperty("SONATYPE_USER", "sonatypeUser"))
password.set(getEnvOrProperty("SONATYPE_PASSWORD", "sonatypePassword"))
}
}
fun getEnvOrProperty(env: String, property: String): String? =
System.getenv(env) ?: findProperty(property)?.toString()