File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
import kotlinx.kover.gradle.plugin.dsl.MetricType
2
- import kotlinx.validation.build.publishingRepository
2
+ import kotlinx.validation.build.addPublishingRepositoryIfPresent
3
3
import kotlinx.validation.build.mavenCentralMetadata
4
4
import kotlinx.validation.build.signPublicationIfKeyPresent
5
5
import org.gradle.api.attributes.TestSuiteType.FUNCTIONAL_TEST
@@ -125,7 +125,7 @@ publishing {
125
125
create<MavenPublication >(" maven" ) {
126
126
from(components[" java" ])
127
127
}
128
- publishingRepository (project)
128
+ addPublishingRepositoryIfPresent (project)
129
129
130
130
mavenCentralMetadata()
131
131
}
Original file line number Diff line number Diff line change @@ -13,13 +13,16 @@ import java.net.*
13
13
14
14
// Artifacts are published to an intermediate repo (libs.repo.url) first,
15
15
// and then deployed to the central portal.
16
- fun PublishingExtension.publishingRepository (project : Project ) {
17
- repositories {
18
- maven {
19
- url = URI (project.getSensitiveProperty(" libs.repo.url" ) ? : error(" libs.repo.url is not set" ))
20
- credentials {
21
- username = project.getSensitiveProperty(" libs.repo.user" )
22
- password = project.getSensitiveProperty(" libs.repo.password" )
16
+ fun PublishingExtension.addPublishingRepositoryIfPresent (project : Project ) {
17
+ val repositoryUrl = project.getSensitiveProperty(" libs.repo.url" )
18
+ if (! repositoryUrl.isNullOrBlank()) {
19
+ repositories {
20
+ maven {
21
+ url = URI (repositoryUrl)
22
+ credentials {
23
+ username = project.getSensitiveProperty(" libs.repo.user" )
24
+ password = project.getSensitiveProperty(" libs.repo.password" )
25
+ }
23
26
}
24
27
}
25
28
}
You can’t perform that action at this time.
0 commit comments