|
1 | | -apply plugin: 'maven' |
| 1 | +apply plugin: 'maven-publish' |
2 | 2 | apply plugin: 'signing' |
3 | 3 |
|
4 | 4 | ext.isReleaseVersion = !version.endsWith("SNAPSHOT") |
5 | 5 |
|
6 | | -task javadocJar(type: Jar) { |
7 | | - classifier = 'javadoc' |
8 | | - from javadoc |
9 | | -} |
10 | | - |
11 | | -task sourcesJar(type: Jar) { |
12 | | - classifier = 'sources' |
13 | | - from sourceSets.main.allSource |
14 | | -} |
15 | | - |
16 | | -artifacts { |
17 | | - archives javadocJar, sourcesJar |
| 6 | +java { |
| 7 | + withJavadocJar() |
| 8 | + withSourcesJar() |
18 | 9 | } |
19 | 10 |
|
20 | 11 | javadoc { |
21 | 12 | def generateJavadoc = project.hasProperty("generateJavadoc") |
22 | | - onlyIf { (isReleaseVersion || gradle.taskGraph.hasTask("uploadArchives")) || generateJavadoc } |
| 13 | + onlyIf { (isReleaseVersion || gradle.taskGraph.hasTask(":ui:publishToSonatype")) || generateJavadoc } |
23 | 14 |
|
24 | 15 | options.encoding = 'UTF-8' |
25 | 16 | options.addStringOption('Xdoclint:none', '-quiet') |
26 | 17 | } |
27 | 18 |
|
28 | | -signing { |
29 | | - required { isReleaseVersion || gradle.taskGraph.hasTask("uploadArchives") } |
30 | | - def signingKey = findProperty("signingKey") |
31 | | - def signingPassword = findProperty("signingPassword") |
32 | | - useInMemoryPgpKeys(signingKey, signingPassword) |
33 | | - sign configurations.archives |
34 | | -} |
| 19 | +publishing { |
| 20 | + publications { |
| 21 | + maven(MavenPublication) { |
| 22 | + from components.java |
35 | 23 |
|
36 | | -uploadArchives { |
37 | | - repositories { |
38 | | - mavenDeployer { |
39 | | - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
40 | | - |
41 | | - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
42 | | - authentication(userName: ossrhUsername, password: ossrhPassword) |
43 | | - } |
44 | | - |
45 | | - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
46 | | - authentication(userName: ossrhUsername, password: ossrhPassword) |
47 | | - } |
48 | | - |
49 | | - pom.project { |
50 | | - url 'https://github.com/kotcrab/vis-ui/' |
| 24 | + pom { |
| 25 | + url = 'https://github.com/kotcrab/vis-ui/' |
51 | 26 |
|
52 | 27 | scm { |
53 | | - connection 'scm:git:[email protected]:kotcrab/vis-ui.git' |
54 | | - developerConnection 'scm:git:[email protected]:kotcrab/vis-ui.git' |
55 | | - url '[email protected]:kotcrab/vis-ui.git' |
| 28 | + connection = 'scm:git:[email protected]:kotcrab/vis-ui.git' |
| 29 | + developerConnection = 'scm:git:[email protected]:kotcrab/vis-ui.git' |
| 30 | + url = '[email protected]:kotcrab/vis-ui.git' |
56 | 31 | } |
57 | 32 |
|
58 | 33 | licenses { |
59 | 34 | license { |
60 | | - name 'The Apache License, Version 2.0' |
61 | | - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 35 | + name = 'The Apache License, Version 2.0' |
| 36 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
62 | 37 | } |
63 | 38 | } |
64 | 39 |
|
65 | 40 | developers { |
66 | 41 | developer { |
67 | | - id 'kotcrab' |
68 | | - name 'Pawel Pastuszak' |
69 | | - url 'https://kotcrab.com' |
| 42 | + id = 'kotcrab' |
| 43 | + name = 'Kotcrab' |
| 44 | + url = 'https://kotcrab.com' |
70 | 45 | } |
71 | 46 | } |
| 47 | + |
72 | 48 | } |
73 | 49 | } |
74 | 50 | } |
75 | 51 | } |
| 52 | + |
| 53 | +signing { |
| 54 | + required { isReleaseVersion || gradle.taskGraph.hasTask(":ui:publishToSonatype") } |
| 55 | + def signingKey = findProperty("signingKey") |
| 56 | + def signingPassword = findProperty("signingPassword") |
| 57 | + useInMemoryPgpKeys(signingKey, signingPassword) |
| 58 | + sign publishing.publications.maven |
| 59 | +} |
0 commit comments