-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
34 lines (30 loc) · 953 Bytes
/
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
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
group = "com.kvc0"
version = System.getenv("VERSION") ?: "${gitVersion()}-SNAPSHOT"
val ossrhUsername = System.getenv("OSSRH_USERNAME")
val ossrhPassword = System.getenv("OSSRH_PASSWORD")
fun gitVersion(): String {
try {
val stdout = java.io.ByteArrayOutputStream()
exec {
commandLine = listOf("git", "describe", "--tags")
standardOutput = stdout
}
return stdout.toString().trim()
} catch (e: Exception) {
print("git failed: $e")
return "unknown"
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}