-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
103 lines (89 loc) · 3.09 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
plugins {
`java-library`
`maven-publish`
signing
id("org.ajoberstar.grgit") version "4.0.2"
id("org.springframework.boot") version "2.2.6.RELEASE"
id("io.spring.dependency-management") version "1.0.9.RELEASE"
id("io.freefair.lombok") version "5.0.1"
}
group = "systems.fehn"
version = grgit.describe(mapOf("tags" to true))
val isRelease = !version.toString().substringAfterLast('-').startsWith('g')
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.springframework.boot:spring-boot-starter")
compileOnly("org.springframework.boot:spring-boot-starter-web")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor")
api("org.hashids:hashids:1.0.3")
compileOnly("com.fasterxml.jackson.core:jackson-databind")
}
java.withSourcesJar()
java.withJavadocJar()
tasks.jar {
enabled = true
}
tasks.register("version") {
doLast {
println(version)
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
version = if (isRelease) project.version.toString() else "${project.version}-SNAPSHOT"
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("Hashids Spring Boot Starter")
description.set("Use Hashids with Spring Boot")
url.set("https://github.com/fehnomenal/hashids-spring-boot-starter")
licenses {
license {
name.set("MIT License")
url.set("https://www.opensource.org/licenses/mit-license.php")
}
}
developers {
developer {
id.set("afehn")
name.set("Andreas Fehn")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/fehnomenal/hashids-spring-boot-starter.git")
developerConnection.set("scm:git:ssh://github.com:fehnomenal/hashids-spring-boot-starter.git")
url.set("https://github.com/fehnomenal/hashids-spring-boot-starter")
}
}
}
}
repositories {
mavenLocal()
maven {
url = if (isRelease) {
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
} else {
uri("https://oss.sonatype.org/content/repositories/snapshots")
}
credentials {
username = project.property("ossrh.username").toString()
password = project.property("ossrh.password").toString()
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}