-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
95 lines (87 loc) · 2.63 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
// SOLVER-API
plugins {
id 'java-library'
id 'maven-publish'
}
test {
useJUnitPlatform()
}
signing {
sign configurations.archives
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
publishing {
repositories {
mavenLocal()
maven {
url = version.endsWith('SNAPSHOT') ? sonatypeSnapshotsUrl : sonatypeReleasesUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
publications {
maven(MavenPublication) {
artifactId = project.name
groupId = group
from components.java
pom {
name = project.name
description = "$projectDescription"
url = "$projectUrl"
inceptionYear = "$projectInceptionYear"
organization {
name = "$projectVendor"
url = "$projectVendorUrl"
}
licenses {
license {
name = "$projectLicense"
url = "$projectLicenseUrl"
}
}
issueManagement {
system = "Github Issues"
url = "$projectIssues"
}
developers {
developer {
id = "$projectDeveloperId"
name = "$projectDeveloper"
email = "$projectDeveloperMail"
}
}
scm {
connection = "scm:git:$projectScm"
developerConnection = "scm:git:$projectScm"
url = "$projectUrl"
}
}
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
}