|
1 | | -jar { |
2 | | - from sourceSets.main.allSource |
3 | | - |
4 | | - manifest { |
5 | | - attributes( |
6 | | - "Automatic-Module-Name": project.group + '.' + project.name, |
7 | | - "Implementation-Title": project.group + '.' + project.name, |
8 | | - "Implementation-Version": archiveVersion, |
9 | | - "Implementation-Vendor": "Codeborne") |
| 1 | +subprojects { |
| 2 | + jar { |
| 3 | + from sourceSets.main.allSource |
| 4 | + |
| 5 | + manifest { |
| 6 | + attributes( |
| 7 | + "Automatic-Module-Name": project.group + '.' + project.name, |
| 8 | + "Implementation-Title": project.group + '.' + project.name, |
| 9 | + "Implementation-Version": archiveVersion, |
| 10 | + "Implementation-Vendor": "Codeborne") |
| 11 | + } |
10 | 12 | } |
11 | | -} |
12 | | - |
13 | | -task sourcesJar(type: Jar, dependsOn: classes) { |
14 | | - classifier = 'sources' |
15 | | - from sourceSets.main.allSource |
16 | | -} |
17 | | - |
18 | | -javadoc { |
19 | | - // failOnError = false |
20 | | - source = sourceSets.main.allJava |
21 | | -} |
22 | | - |
23 | | -task javadocJar(type: Jar, dependsOn: javadoc) { |
24 | | - classifier = 'javadoc' |
25 | | - from javadoc.destinationDir |
26 | | -} |
27 | | - |
28 | | -artifacts { |
29 | | - archives jar |
30 | | - archives sourcesJar |
31 | | - archives javadocJar |
32 | | -} |
33 | | - |
34 | | -if (project.hasProperty("signing.keyId")) { |
35 | | - apply plugin: 'signing' |
36 | | - |
37 | | - signing { |
38 | | - sign configurations.archives |
| 13 | + |
| 14 | + task sourcesJar(type: Jar, dependsOn: classes) { |
| 15 | + classifier = 'sources' |
| 16 | + from sourceSets.main.allSource |
39 | 17 | } |
40 | 18 |
|
41 | | - uploadArchives { |
42 | | - repositories { |
43 | | - mavenDeployer { |
44 | | - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 19 | + javadoc { |
| 20 | + // failOnError = false |
| 21 | + source = sourceSets.main.allJava |
| 22 | + } |
45 | 23 |
|
46 | | - repository(url: project.version.endsWith("-SNAPSHOT") ? |
47 | | - 'https://oss.sonatype.org/content/repositories/snapshots/' : |
48 | | - 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') { |
49 | | - authentication(userName: "$sonatypeUsername", password: "$sonatypePassword") |
50 | | - } |
| 24 | + task javadocJar(type: Jar, dependsOn: javadoc) { |
| 25 | + classifier = 'javadoc' |
| 26 | + from javadoc.destinationDir |
| 27 | + } |
| 28 | + |
| 29 | + artifacts { |
| 30 | + archives jar |
| 31 | + archives sourcesJar |
| 32 | + archives javadocJar |
| 33 | + } |
| 34 | + |
| 35 | + if (project.hasProperty("signing.keyId")) { |
| 36 | + apply plugin: 'signing' |
51 | 37 |
|
52 | | - pom.project { |
53 | | - name archivesBaseName |
54 | | - packaging 'jar' |
55 | | - description 'AssertLog: Unit-tests for your logging' |
56 | | - url 'https://github.com/codeborne/assertlog' |
| 38 | + signing { |
| 39 | + sign configurations.archives |
| 40 | + } |
| 41 | + |
| 42 | + uploadArchives { |
| 43 | + repositories { |
| 44 | + mavenDeployer { |
| 45 | + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
57 | 46 |
|
58 | | - scm { |
59 | | - url 'scm:git@github.com:codeborne/assertlog.git' |
60 | | - connection 'scm:git@github.com:codeborne/assertlog.git' |
61 | | - developerConnection 'scm:git@github.com:codeborne/assertlog.git' |
| 47 | + repository(url: project.version.endsWith("-SNAPSHOT") ? |
| 48 | + 'https://oss.sonatype.org/content/repositories/snapshots/' : |
| 49 | + 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') { |
| 50 | + authentication(userName: "$sonatypeUsername", password: "$sonatypePassword") |
62 | 51 | } |
63 | 52 |
|
64 | | - licenses { |
65 | | - license { |
66 | | - name 'MIT' |
67 | | - url 'https://opensource.org/licenses/MIT' |
68 | | - distribution 'repo' |
| 53 | + pom.project { |
| 54 | + name archivesBaseName |
| 55 | + packaging 'jar' |
| 56 | + description 'AssertLog: Unit-tests for your logging' |
| 57 | + url 'https://github.com/codeborne/assertlog' |
| 58 | + |
| 59 | + scm { |
| 60 | + url 'scm:git@github.com:codeborne/assertlog.git' |
| 61 | + connection 'scm:git@github.com:codeborne/assertlog.git' |
| 62 | + developerConnection 'scm:git@github.com:codeborne/assertlog.git' |
69 | 63 | } |
70 | | - } |
71 | 64 |
|
72 | | - developers { |
73 | | - developer { |
74 | | - id 'asolntsev' |
75 | | - name 'Andrei Solntsev' |
| 65 | + licenses { |
| 66 | + license { |
| 67 | + name 'MIT' |
| 68 | + url 'https://opensource.org/licenses/MIT' |
| 69 | + distribution 'repo' |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + developers { |
| 74 | + developer { |
| 75 | + id 'asolntsev' |
| 76 | + name 'Andrei Solntsev' |
| 77 | + } |
76 | 78 | } |
77 | 79 | } |
78 | | - } |
79 | 80 |
|
80 | | - //mess with the generated pom to set the 'packaging' tag |
81 | | - pom.withXml { XmlProvider xmlProvider -> |
82 | | - def xml = xmlProvider.asString() |
83 | | - def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes)) |
| 81 | + //mess with the generated pom to set the 'packaging' tag |
| 82 | + pom.withXml { XmlProvider xmlProvider -> |
| 83 | + def xml = xmlProvider.asString() |
| 84 | + def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes)) |
84 | 85 |
|
85 | | - pomXml.version[0] + { packaging('jar') } |
| 86 | + pomXml.version[0] + { packaging('jar') } |
86 | 87 |
|
87 | | - def newXml = new StringWriter() |
88 | | - def printer = new XmlNodePrinter(new PrintWriter(newXml)) |
89 | | - printer.preserveWhitespace = true |
90 | | - printer.print(pomXml) |
91 | | - xml.setLength(0) |
92 | | - xml.append(newXml.toString()) |
| 88 | + def newXml = new StringWriter() |
| 89 | + def printer = new XmlNodePrinter(new PrintWriter(newXml)) |
| 90 | + printer.preserveWhitespace = true |
| 91 | + printer.print(pomXml) |
| 92 | + xml.setLength(0) |
| 93 | + xml.append(newXml.toString()) |
| 94 | + } |
93 | 95 | } |
94 | 96 | } |
95 | 97 | } |
|
0 commit comments