-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
84 lines (71 loc) · 2.46 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
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.13.3'
id 'biz.aQute.bnd.builder' version "$bndVersion"
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
scmVersion {
tag {
prefix = 'whistlepost-console-'
}
versionCreator 'versionWithBranch'
branchVersionCreator = ['main': 'simple']
nextVersion {
suffix = 'pre'
separator = '-'
}
}
repositories {
mavenCentral()
mavenLocal()
}
sourceCompatibility = 8
targetCompatibility = 8
group = 'org.whistlepost'
version = scmVersion.version
ext {
isReleaseVersion = !version.endsWith("SNAPSHOT")
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
"$name"(MavenPublication) {
from components.java
pom.withXml {
asNode().appendNode('name', name)
asNode().appendNode('description', description)
asNode().appendNode('url', 'https://www.whistlepost.org')
def scmNode = asNode().appendNode('scm')
scmNode.appendNode('url', 'https://github.com/whistlepost/whistlepost-console')
scmNode.appendNode('connection', 'scm:git@github.com:whistlepost/whistlepost-console.git')
scmNode.appendNode('developerConnection', 'scm:git@github.com:whistlepost/whistlepost-console.git')
def licenseNode = asNode().appendNode('licenses').appendNode('license')
licenseNode.appendNode('name', 'Apache License')
licenseNode.appendNode('url', 'https://raw.githubusercontent.com/whistlepost/whistlepost-console/main/LICENSE')
licenseNode.appendNode('distribution', 'repo')
def developerNode = asNode().appendNode('developers').appendNode('developer')
developerNode.appendNode('id', 'fortuna')
developerNode.appendNode('name', 'Ben Fortuna')
}
}
}
repositories {
maven {
name = "OSSRH"
url = version.endsWith('SNAPSHOT') ? "https://oss.sonatype.org/content/repositories/snapshots/" :
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
required { isReleaseVersion }
sign publishing.publications[name]
}