-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpublish-helper.gradle
74 lines (71 loc) · 1.95 KB
/
publish-helper.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
import org.gradle.internal.component.external.model.ComponentVariant
// Dieses GradleSkript gibt die Publishing-Definition für Java-Artefakte vor
// Gradle Module können dies dann Nutzen und einzelne Informationen überschreiben
// um Redundanz vorzubeugen, bspw:
/*
apply from: "$rootDir/publish-helper.gradle"
publishing {
publications {
publishJava(MavenPublication) {
artifactId = 'svws-server-app'
pom {
name = 'SVWS Server Application'
description = 'Diese Bibliothek enthält den Java-Server für die Schulverwaltungssoftware in NRW'
}
}
}
}
*/
publishing {
publications {
publishJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'name'
description = 'description'
url = 'http://www.svws.nrw.de'
licenses {
license {
name = 'BSD-3-Clause'
url = 'https://opensource.org/licenses/BSD-3-Clause'
}
}
scm {
connection = 'scm:[email protected]/SVWS-NRW/SVWS-Server'
developerConnection = 'scm:[email protected]/SVWS-NRW/SVWS-Server.git'
url = 'https://github.com/SVWS-NRW/SVWS-Server.git'
}
developers {
developer {
id = 'svws-nrw'
name = 'Schulverwaltung NRW'
email = '[email protected]'
}
}
}
}
}
}
task signJars(type: Exec) {
group 'signing'
dependsOn rootProject.prepareSigning
doFirst {
def fileJarsToSign = new File("${projectDir}/build/jarsToSign.txt")
fileJarsToSign.withWriter { w -> "" }
fileTree(dir: "build/libs/", includes: ["**-${project.version}.jar"], excludes: ["**-javadoc.jar", "**-sources.jar"]).files.findAll {
fileJarsToSign.withWriterAppend {
w -> w << it.toString() << "\n"
}
}
}
workingDir file("${rootDir}/build/signing")
commandLine = ["${rootDir}/config/signing/sign_jars.sh", "${projectDir}/build/jarsToSign.txt"]
}