55
66plugins {
77 id " org.jetbrains.kotlin.jvm"
8- id " maven-publish"
98 id " java-library"
10- id " signing"
119 id " org.jetbrains.dokka"
10+ id " com.vanniktech.maven.publish" version " 0.29.0"
1211}
1312
1413java {
1514 withSourcesJar()
15+ sourceCompatibility = JavaVersion . VERSION_11
16+ targetCompatibility = JavaVersion . VERSION_11
17+ }
18+
19+ kotlin {
20+ compilerOptions {
21+ jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget . JVM_11
22+ }
1623}
1724
1825tasks. named(' jar' ) {
@@ -28,63 +35,41 @@ def dokkaJavadocJar = tasks.register("dokkaJavadocJar", org.gradle.jvm.tasks.Jar
2835
2936}
3037
31- publishing {
32- repositories {
33- maven {
34- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
35- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
36- url = releasesRepoUrl // version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
37- credentials {
38- if (project. hasProperty(" ossrhUsername" )) {
39- username = ossrhUsername
40- password = ossrhPassword
41- }
42- }
43- }
44- }
45- publications {
46- release(MavenPublication ) {
47- from components. java
48- groupId = ' com.yahoo.behaviorgraph'
49- artifactId = ' bgjvm'
50- version = ' 0.8.0'
51- artifact dokkaJavadocJar
52- repositories {
38+ import com.vanniktech.maven.publish.KotlinJvm
39+ import com.vanniktech.maven.publish.JavadocJar
40+ import com.vanniktech.maven.publish.SonatypeHost
5341
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'
5454 }
55- pom {
56- name = ' Behavior Graph'
57- 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.'
58- url = ' https://github.com/yahoo/bgkotlin'
59- licenses {
60- license {
61- name = ' The Apache License, Version 2.0'
62- url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
63- }
64- }
65- developers {
66- developer {
67- id = ' slevin'
68- name = ' Sean Levin'
69- 70- }
71- }
72- scm {
73- connection = ' scm:git:git://github.com/yahoo/bgkotlin.git'
74- developerConnection = ' scm:git:ssh://github.com:yahoo/bgkotlin.git'
75- url = ' https://github.com/yahoo/bgkotlin'
76- }
55+ }
56+ developers {
57+ developer {
58+ id = ' slevin'
59+ name = ' Sean Levin'
60+ 7761 }
7862 }
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+ }
7968 }
80- }
69+
70+ signAllPublications()
8171
8272
83- signing {
84- if (project. hasProperty(" signing.keyId" )) {
85- sign configurations. archives
86- sign publishing. publications. release
87- }
8873}
8974
9075dependencies {
0 commit comments