Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align mavenCentralUsername and mavenCentralPassword configuration with other project properties #867

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [Unreleased]

- Allow mavenCentralUsername and mavenCentralPassword to be set from any property type for added flexibility.

## 0.30.0 *(2024-10-13)*

- Add support for Dokka 2.0.0-Beta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ abstract class MavenPublishBaseExtension @Inject constructor(
sonatypeHost = sonatypeHost,
groupId = groupId,
versionIsSnapshot = version.map { it.endsWith("-SNAPSHOT") },
repositoryUsername = project.providers.gradleProperty("mavenCentralUsername"),
repositoryPassword = project.providers.gradleProperty("mavenCentralPassword"),
repositoryUsername = project.provider { project.properties["mavenCentralUsername"]?.toString() },
repositoryPassword = project.provider { project.properties["mavenCentralPassword"]?.toString() },
automaticRelease = automaticRelease,
// TODO: stop accessing rootProject https://github.com/gradle/gradle/pull/26635
rootBuildDirectory = project.rootProject.layout.buildDirectory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ internal abstract class SonatypeRepositoryBuildService :
rootBuildDirectory: Provider<Directory>,
buildEventsListenerRegistry: BuildEventsListenerRegistry,
): Provider<SonatypeRepositoryBuildService> {
val okhttpTimeout = project.providers.gradleProperty("SONATYPE_CONNECT_TIMEOUT_SECONDS")
val okhttpTimeout = project.provider<String> { project.properties["SONATYPE_CONNECT_TIMEOUT_SECONDS"]?.toString() }
.map { it.toLong() }
.orElse(60)
val closeTimeout = project.providers.gradleProperty("SONATYPE_CLOSE_TIMEOUT_SECONDS")
val closeTimeout = project.provider<String> { project.properties["SONATYPE_CLOSE_TIMEOUT_SECONDS"]?.toString() }
.map { it.toLong() }
.orElse(60 * 15)
val service = gradle.sharedServices.registerIfAbsent(NAME, SonatypeRepositoryBuildService::class.java) {
Expand Down