forked from arrowhead-f/arrowhead-kalix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (103 loc) · 3.5 KB
/
build.gradle
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
buildscript {
repositories {
mavenCentral()
}
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
group = 'se.arkalix'
version = '0.5.2'
tasks.withType(JavaCompile) {
sourceCompatibility = '11'
targetCompatibility = '11'
}
}
// Load property from gradle.properties or return "N/A" if not defined.
def prop = { String name -> return project.hasProperty(name) ? project.property(name) : "N/A" }
subprojects {
apply plugin: 'maven-publish'
apply plugin: 'signing'
publishing {
repositories {
maven {
credentials {
// The RHS variables are collected from the user gradle.properties file.
username = prop("arkalixJiraUsername")
password = prop("arkalixJiraPassword")
}
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
publications {
mavenJava(MavenPublication) {
pom {
url = 'https://arkalix.se'
licenses {
license {
name = 'The Eclipse Public License, Version 2.0'
url = 'https://www.eclipse.org/legal/epl-2.0/'
}
}
developers {
developer {
id = 'emanuelpalm'
name = 'Emanuel Palm'
email = 'emanuel.palm@arkalix.se'
}
}
scm {
connection = 'scm:git:git://github.com/emanuelpalm/arrowhead-kalix.git'
developerConnection = 'scm:git:ssh://github.com/emanuelpalm/arrowhead-kalix.git'
url = 'http://github.com/emanuelpalm/arrowhead-kalix/'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
afterEvaluate {
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
exclude '**/internal/**'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
def console = System.console()
console.printf("\nSignatures required. Using the following details from gradle.properties:\n")
// The RHS variables are collected from the user gradle.properties file.
def keyId = prop("arkalixSigningKeyId")
def file = prop("arkalixSigningSecretKeyRingFile")
def password = prop("arkalixSigningPassword")
console.printf("PGP Key Id: %s\n", keyId)
console.printf("PGP Secret Key Ring File: %s\n", file)
console.printf("PGP Private Key Password: %s\n\n", password != null ? "***" : "-")
allprojects {
ext."signing.keyId" = keyId
ext."signing.secretKeyRingFile" = file
ext."signing.password" = password
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}