forked from jasync-sql/jasync-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
157 lines (128 loc) · 4.16 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
155
156
157
plugins {
kotlin("jvm")
id("org.jlleitschuh.gradle.ktlint")
`java-library`
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
jacoco
signing
}
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
nexusPublishing {
repositories {
sonatype()
}
}
apply(plugin = "io.github.gradle-nexus.publish-plugin")
allprojects {
group = "com.github.jasync-sql"
version = "2.1.24"
apply(plugin = "kotlin")
apply(plugin = "maven-publish")
apply(plugin = "jacoco")
repositories {
mavenCentral()
}
tasks {
compileKotlin {
kotlinOptions.suppressWarnings = true
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
val JACOCO_VERSION: String by project
jacoco {
toolVersion = JACOCO_VERSION
}
register<JacocoReport>("codeCoverageReport") {
dependsOn(test)
executionData.setFrom(
fileTree(project.rootDir.absolutePath) {
include("**/build/jacoco/*.exec")
}
)
reports {
xml.isEnabled = true
xml.destination = file("$buildDir/reports/jacoco/report.xml")
html.isEnabled = false
csv.isEnabled = false
}
subprojects {
sourceSets(sourceSets.main.get())
}
}
check {
dependsOn(ktlintCheck)
}
test {
jvmArgs = listOf(
"-Dio.netty.leakDetection.level=PARANOID"
)
}
}
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "signing")
java {
withSourcesJar()
withJavadocJar()
}
sourceSets.main {
java.srcDirs("src/main/java")
}
val varintName = when (project.name) {
"db-async-common" -> "jasync-common"
"pool-async" -> "jasync-pool"
"mysql-async" -> "jasync-mysql"
"postgresql-async" -> "jasync-postgresql"
"postgis-jasync" -> "jasync-postgis-jts"
"r2dbc-mysql" -> "jasync-r2dbc-mysql"
else -> "jasync-sql-unknown"
}
tasks {
jar {
base.archivesBaseName = varintName
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifactId = varintName
pom {
name.set("jasync-sql")
description.set("jasync-sql - Async, Netty based, JVM database drivers for PostgreSQL and MySQL written in Kotlin")
url.set("https://github.com/jasync-sql/jasync-sql")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
name.set("Ohad Shai")
email.set("ohadshai@gmail.com")
organization.set("github")
organizationUrl.set("http://www.github.com")
}
}
scm {
url.set("https://github.com/jasync-sql/jasync-sql/tree/master")
connection.set("scm:git:git://github.com/jasync-sql/jasync-sql.git")
developerConnection.set("scm:git:ssh://github.com:jasync-sql/jasync-sql.git")
}
}
}
}
}
signing {
// use the properties passed as command line args
// -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
sign(publishing.publications["mavenJava"])
}
}