@@ -8,57 +8,18 @@ plugins {
88 id(" com.gabrielfeo.kotlin-jvm-library" )
99 id(" com.gabrielfeo.develocity-api-code-generation" )
1010 id(" com.gabrielfeo.test-suites" )
11- id(" org.jetbrains.dokka" )
1211 `java- library`
1312 `maven- publish`
1413 signing
1514 kotlin(" jupyter.api" ) version " 0.12.0-181"
1615}
1716
18- val repoUrl = " https://github.com/gabrielfeo/develocity-api-kotlin"
19-
20- java {
21- withSourcesJar()
22- withJavadocJar()
23- toolchain {
24- languageVersion.set(JavaLanguageVersion .of(11 ))
25- vendor.set(JvmVendorSpec .AZUL )
26- }
27- }
28-
29- tasks.withType<DokkaTask >().configureEach {
30- dokkaSourceSets.register(" main" ) {
31- sourceRoot(" src/main/kotlin" )
32- sourceLink {
33- localDirectory.set(file(" src/main/kotlin" ))
34- remoteUrl.set(URL (" $repoUrl /blob/$version /src/main/kotlin" ))
35- remoteLineSuffix.set(" #L" )
36- }
37- jdkVersion.set(11 )
38- suppressGeneratedFiles.set(false )
39- documentedVisibilities.set(setOf (PUBLIC ))
40- perPackageOption {
41- matchingRegex.set(""" .*\.internal.*""" )
42- suppress.set(true )
43- }
44- externalDocumentationLink(" https://kotlinlang.org/api/kotlinx.coroutines/" )
45- externalDocumentationLink(" https://square.github.io/okhttp/4.x/okhttp/" )
46- externalDocumentationLink(" https://square.github.io/retrofit/2.x/retrofit/" )
47- externalDocumentationLink(" https://square.github.io/moshi/1.x/moshi/" )
48- externalDocumentationLink(" https://square.github.io/moshi/1.x/moshi-kotlin/" )
49- }
50- }
51-
5217tasks.processJupyterApiResources {
5318 libraryProducers = listOf (
5419 " com.gabrielfeo.develocity.api.internal.jupyter.DevelocityApiJupyterIntegration" ,
5520 )
5621}
5722
58- tasks.named<Jar >(" javadocJar" ) {
59- from(tasks.dokkaHtml)
60- }
61-
6223tasks.named<Test >(" integrationTest" ) {
6324 environment(" DEVELOCITY_API_LOG_LEVEL" , " DEBUG" )
6425}
@@ -94,6 +55,7 @@ dependencies {
9455val libraryPom = Action <MavenPom > {
9556 name.set(" Develocity API Kotlin" )
9657 description.set(" A library to use the Develocity API in Kotlin" )
58+ val repoUrl = providers.gradleProperty(" repo.url" )
9759 url.set(repoUrl)
9860 licenses {
9961 license {
@@ -110,27 +72,27 @@ val libraryPom = Action<MavenPom> {
11072 }
11173 }
11274 scm {
113- val basicUrl = repoUrl.substringAfter(" ://" )
114- connection.set(" scm:git:git://$basicUrl .git" )
115- developerConnection.set(" scm:git:ssh://$basicUrl .git" )
116- url.set(" https://$basicUrl / " )
75+ val basicUrl = repoUrl.map { it. substringAfter(" ://" ) }
76+ connection.set(basicUrl.map { " scm:git:git://$it .git" } )
77+ developerConnection.set(basicUrl.map { " scm:git:ssh://$it .git" } )
78+ url.set(basicUrl.map { " https://$it / " } )
11779 }
11880}
11981
12082publishing {
12183 publications {
122- create <MavenPublication >(" develocityApiKotlin" ) {
84+ register <MavenPublication >(" develocityApiKotlin" ) {
12385 artifactId = " develocity-api-kotlin"
12486 from(components[" java" ])
12587 pom(libraryPom)
12688 }
12789 // For occasional maven local publishing
128- create <MavenPublication >(" unsignedDevelocityApiKotlin" ) {
90+ register <MavenPublication >(" unsignedDevelocityApiKotlin" ) {
12991 artifactId = " develocity-api-kotlin"
13092 from(components[" java" ])
13193 pom(libraryPom)
13294 }
133- create <MavenPublication >(" relocation" ) {
95+ register <MavenPublication >(" relocation" ) {
13496 artifactId = " gradle-enterprise-api-kotlin"
13597 pom {
13698 libraryPom(this )
@@ -165,10 +127,10 @@ publishing {
165127fun isCI () = System .getenv(" CI" ).toBoolean()
166128
167129signing {
168- sign(
169- publishing.publications[ " develocityApiKotlin " ],
170- publishing.publications[ " relocation " ],
171- )
130+ val signedPublications = publishing.publications.matching {
131+ ! it.name.contains( " unsigned " , ignoreCase = true )
132+ }
133+ sign(signedPublications )
172134 if (isCI()) {
173135 useInMemoryPgpKeys(
174136 project.properties[" signing.secretKey" ] as String? ,
0 commit comments