File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1+ import kotlinx.validation.build.addPublishingRepositoryIfPresent
12import kotlinx.kover.gradle.plugin.dsl.CoverageUnit
23import kotlinx.validation.build.mavenCentralMetadata
3- import kotlinx.validation.build.mavenRepositoryPublishing
44import kotlinx.validation.build.signPublicationIfKeyPresent
55import org.gradle.api.attributes.TestSuiteType.FUNCTIONAL_TEST
66import org.jetbrains.dokka.gradle.DokkaTask
@@ -125,8 +125,8 @@ publishing {
125125 create<MavenPublication >(" maven" ) {
126126 from(components[" java" ])
127127 }
128+ addPublishingRepositoryIfPresent(project)
128129
129- mavenRepositoryPublishing(project)
130130 mavenCentralMetadata()
131131 }
132132
Original file line number Diff line number Diff line change @@ -11,13 +11,18 @@ import org.gradle.api.publish.maven.*
1111import org.gradle.plugins.signing.*
1212import java.net.*
1313
14- fun PublishingExtension.mavenRepositoryPublishing (project : Project ) {
15- repositories {
16- maven {
17- url = URI (" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
18- credentials {
19- username = project.getSensitiveProperty(" libs.sonatype.user" )
20- password = project.getSensitiveProperty(" libs.sonatype.password" )
14+ // Artifacts are published to an intermediate repo (libs.repo.url) first,
15+ // and then deployed to the central portal.
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+ }
2126 }
2227 }
2328 }
You can’t perform that action at this time.
0 commit comments