|
5 | 5 |
|
6 | 6 | plugins { |
7 | 7 | id "org.jetbrains.kotlin.jvm" |
8 | | - id "maven-publish" |
9 | 8 | id "java-library" |
10 | | - id "signing" |
11 | 9 | id "org.jetbrains.dokka" |
| 10 | + id "com.vanniktech.maven.publish" version "0.29.0" |
12 | 11 | } |
13 | 12 |
|
14 | 13 | java { |
@@ -36,63 +35,41 @@ def dokkaJavadocJar = tasks.register("dokkaJavadocJar", org.gradle.jvm.tasks.Jar |
36 | 35 |
|
37 | 36 | } |
38 | 37 |
|
39 | | -publishing { |
40 | | - repositories { |
41 | | - maven { |
42 | | - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" |
43 | | - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" |
44 | | - url = releasesRepoUrl //version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl |
45 | | - credentials { |
46 | | - if (project.hasProperty("ossrhUsername")) { |
47 | | - username = ossrhUsername |
48 | | - password = ossrhPassword |
49 | | - } |
50 | | - } |
51 | | - } |
52 | | - } |
53 | | - publications { |
54 | | - release(MavenPublication) { |
55 | | - from components.java |
56 | | - groupId = 'com.yahoo.behaviorgraph' |
57 | | - artifactId = 'bgjvm' |
58 | | - version = '0.8.0' |
59 | | - artifact dokkaJavadocJar |
60 | | - repositories { |
| 38 | +import com.vanniktech.maven.publish.KotlinJvm |
| 39 | +import com.vanniktech.maven.publish.JavadocJar |
| 40 | +import com.vanniktech.maven.publish.SonatypeHost |
61 | 41 |
|
| 42 | +mavenPublishing { |
| 43 | + configure(new KotlinJvm(new JavadocJar.Dokka("dokkaHtml"), true)) |
| 44 | + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) |
| 45 | + coordinates("com.yahoo.behaviorgraph", "bgjvm", "0.8.0") |
| 46 | + pom { |
| 47 | + name = 'Behavior Graph' |
| 48 | + description = 'Behavior Graph lets you build your programs out of small, easily understood pieces in a way that lets the computer do more of the work for you.' |
| 49 | + url = 'https://github.com/yahoo/bgkotlin' |
| 50 | + licenses { |
| 51 | + license { |
| 52 | + name = 'The Apache License, Version 2.0' |
| 53 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
62 | 54 | } |
63 | | - pom { |
64 | | - name = 'Behavior Graph' |
65 | | - description = 'Behavior Graph lets you build your programs out of small, easily understood pieces in a way that lets the computer do more of the work for you.' |
66 | | - url = 'https://github.com/yahoo/bgkotlin' |
67 | | - licenses { |
68 | | - license { |
69 | | - name = 'The Apache License, Version 2.0' |
70 | | - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
71 | | - } |
72 | | - } |
73 | | - developers { |
74 | | - developer { |
75 | | - id = 'slevin' |
76 | | - name = 'Sean Levin' |
77 | | - |
78 | | - } |
79 | | - } |
80 | | - scm { |
81 | | - connection = 'scm:git:git://github.com/yahoo/bgkotlin.git' |
82 | | - developerConnection = 'scm:git:ssh://github.com:yahoo/bgkotlin.git' |
83 | | - url = 'https://github.com/yahoo/bgkotlin' |
84 | | - } |
| 55 | + } |
| 56 | + developers { |
| 57 | + developer { |
| 58 | + id = 'slevin' |
| 59 | + name = 'Sean Levin' |
| 60 | + |
85 | 61 | } |
86 | 62 | } |
| 63 | + scm { |
| 64 | + connection = 'scm:git:git://github.com/yahoo/bgkotlin.git' |
| 65 | + developerConnection = 'scm:git:ssh://github.com:yahoo/bgkotlin.git' |
| 66 | + url = 'https://github.com/yahoo/bgkotlin' |
| 67 | + } |
87 | 68 | } |
88 | | -} |
| 69 | + |
| 70 | + signAllPublications() |
89 | 71 |
|
90 | 72 |
|
91 | | -signing { |
92 | | - if (project.hasProperty("signing.keyId")) { |
93 | | - sign configurations.archives |
94 | | - sign publishing.publications.release |
95 | | - } |
96 | 73 | } |
97 | 74 |
|
98 | 75 | dependencies { |
|
0 commit comments