-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
executable file
·135 lines (124 loc) · 4.01 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
plugins {
kotlin("jvm") version "1.3.72"
id("org.jmailen.kotlinter") version "2.3.2"
id("org.jetbrains.dokka") version "0.10.1"
signing
`maven-publish`
id("io.codearte.nexus-staging") version "0.21.2"
}
group = "dev.fuelyour"
version = "0.0.7-SNAPSHOT"
val projectDescription = "Simple library that converts sql queries using " +
"named parameters into sql queries using positional parameters, thus " +
"allowing you to use named parameters even if your database tools only " +
"support positional parameters"
description = projectDescription
extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT")
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("io.kotest:kotest-runner-junit5:4.0.3")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
}
}
dokka {
outputFormat = "html"
outputDirectory = "$buildDir/dokka"
}
}
val sourcesJar by tasks.creating(org.gradle.jvm.tasks.Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
val dokkaJar by tasks.creating(org.gradle.jvm.tasks.Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(tasks.dokka)
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(sourcesJar)
artifact(dokkaJar)
pom {
name.set("${project.group}:${rootProject.name}")
description.set(projectDescription)
url.set("https://github.com/fuelyourdev/${rootProject.name}")
licenses {
license {
name.set("MIT License")
url.set(
"http://www.opensource.org/licenses/mit-license.php"
)
}
}
developers {
developer {
id.set("fuelyourdev")
name.set("Trevor Young")
email.set("trevor@fuelyour.dev")
organization.set("Fuel Your Dev, LLC")
organizationUrl.set("https://fuelyour.dev")
}
}
scm {
connection.set("scm:git:git://github.com/fuelyourdev/${rootProject.name}.git")
developerConnection.set(
"scm:git:git://github.com/fuelyourdev/${rootProject.name}.git"
)
url.set("https://github.com/fuelyourdev/${rootProject.name}/tree/master")
}
}
}
}
repositories {
maven {
val repoUrl = if (rootProject.extra["isReleaseVersion"] as Boolean) {
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
} else {
"https://oss.sonatype.org/content/repositories/snapshots"
}
url = uri(repoUrl)
credentials {
username = System.getenv("ossrhUsername")
password = System.getenv("ossrhPassword")
}
}
}
}
if (rootProject.extra["isReleaseVersion"] as Boolean) {
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
}
nexusStaging {
username = System.getenv("ossrhUsername")
password = System.getenv("ossrhPassword")
}