-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle.kts
104 lines (94 loc) · 3.46 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
import java.util.Base64
allprojects {
version = "1.3.0"
group = "com.bisnode.opa"
}
subprojects {
apply {
plugin("checkstyle")
plugin("codenarc")
plugin("java")
plugin("java-library")
plugin("groovy")
plugin("maven-publish")
plugin("signing")
}
repositories {
mavenCentral()
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
configure<CodeNarcExtension> {
reportFormat = "console"
}
}
tasks.wrapper {
gradleVersion = Versions.gradle
}
// anything below this line will be evaluated AFTER the children
evaluationDependsOnChildren()
subprojects {
configure<PublishingExtension> {
publications {
create<MavenPublication>("${project.name}-module") {
artifactId = project.name
from(components["java"])
pom {
name.set("${project.ext["pomName"]}")
description.set("${project.ext["pomDescription"]}")
url.set("https://github.com/Bisnode/opa-spring-security")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
scm {
connection.set("scm:git:git://github.com/Bisnode/opa-spring-security.git")
developerConnection.set("scm:git:ssh://github.com:Bisnode/opa-spring-security.git")
url.set("https://github.com/Bisnode/opa-spring-security.git")
}
developers {
developer {
name.set("Łukasz Kamiński")
email.set("[email protected]")
organization.set("Bisnode")
organizationUrl.set("https://www.bisnode.com")
}
}
}
}
}
repositories {
maven {
val ossrhUsername: String? by project
val ossrhPassword: String? by project
name = "OSSRH"
credentials {
username = ossrhUsername
password = ossrhPassword
}
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}
configure<SigningExtension> {
val signingKey: String? by project
val signingPassword: String? by project
// if on GitHub
if(signingKey != null && signingPassword != null) {
val decodedKey = signingKey
?.let { Base64.getDecoder().decode(signingKey) }
?.let { String(it) }
useInMemoryPgpKeys(decodedKey, signingPassword)
}
sign((project.properties["publishing"] as PublishingExtension).publications["${project.name}-module"])
}
}