forked from oblac/jodd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
59 lines (49 loc) · 1.13 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
ext.moduleName = 'jodd-bom'
ext.moduleDescription = "Jodd (Bill of Materials)"
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: "${gradleScriptDir}/publish-maven.gradle"
group = 'org.jodd'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: classes) {
classifier = 'javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
buildBomDependencies(pom)
// RE-sign the pom, as it has been modified
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
pomFile.delete()
}
}
}
}
def buildBomDependencies(pom) {
pom.withXml {
asNode().children().last() + {
delegate.dependencyManagement {
delegate.dependencies {
parent.javaModules().sort { "$it.name" }.each { p ->
delegate.dependency {
delegate.groupId(p.group)
delegate.artifactId(p.name)
delegate.version(p.version)
}
}
}
}
}
}
}