@@ -8,57 +8,18 @@ plugins {
8
8
id(" com.gabrielfeo.kotlin-jvm-library" )
9
9
id(" com.gabrielfeo.develocity-api-code-generation" )
10
10
id(" com.gabrielfeo.test-suites" )
11
- id(" org.jetbrains.dokka" )
12
11
`java- library`
13
12
`maven- publish`
14
13
signing
15
14
kotlin(" jupyter.api" ) version " 0.12.0-181"
16
15
}
17
16
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
-
52
17
tasks.processJupyterApiResources {
53
18
libraryProducers = listOf (
54
19
" com.gabrielfeo.develocity.api.internal.jupyter.DevelocityApiJupyterIntegration" ,
55
20
)
56
21
}
57
22
58
- tasks.named<Jar >(" javadocJar" ) {
59
- from(tasks.dokkaHtml)
60
- }
61
-
62
23
tasks.named<Test >(" integrationTest" ) {
63
24
environment(" DEVELOCITY_API_LOG_LEVEL" , " DEBUG" )
64
25
}
@@ -94,6 +55,7 @@ dependencies {
94
55
val libraryPom = Action <MavenPom > {
95
56
name.set(" Develocity API Kotlin" )
96
57
description.set(" A library to use the Develocity API in Kotlin" )
58
+ val repoUrl = providers.gradleProperty(" repo.url" )
97
59
url.set(repoUrl)
98
60
licenses {
99
61
license {
@@ -110,27 +72,27 @@ val libraryPom = Action<MavenPom> {
110
72
}
111
73
}
112
74
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 / " } )
117
79
}
118
80
}
119
81
120
82
publishing {
121
83
publications {
122
- create <MavenPublication >(" develocityApiKotlin" ) {
84
+ register <MavenPublication >(" develocityApiKotlin" ) {
123
85
artifactId = " develocity-api-kotlin"
124
86
from(components[" java" ])
125
87
pom(libraryPom)
126
88
}
127
89
// For occasional maven local publishing
128
- create <MavenPublication >(" unsignedDevelocityApiKotlin" ) {
90
+ register <MavenPublication >(" unsignedDevelocityApiKotlin" ) {
129
91
artifactId = " develocity-api-kotlin"
130
92
from(components[" java" ])
131
93
pom(libraryPom)
132
94
}
133
- create <MavenPublication >(" relocation" ) {
95
+ register <MavenPublication >(" relocation" ) {
134
96
artifactId = " gradle-enterprise-api-kotlin"
135
97
pom {
136
98
libraryPom(this )
@@ -165,10 +127,10 @@ publishing {
165
127
fun isCI () = System .getenv(" CI" ).toBoolean()
166
128
167
129
signing {
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 )
172
134
if (isCI()) {
173
135
useInMemoryPgpKeys(
174
136
project.properties[" signing.secretKey" ] as String? ,
0 commit comments