Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Build
run: ./gradlew build
- name: Publish with JReleaser
run: ./gradlew jreleaserFullRelease
run: ./gradlew publishAllPublicationsToStagingRepository jreleaserFullRelease
env:
JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_PUBLIC_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ subprojects {
repositories {
maven {
name = "staging"
url = uri(layout.buildDirectory.dir("staging-deploy"))
url = uri(rootProject.layout.buildDirectory.dir("staging-deploy"))
}
}
}
Expand Down Expand Up @@ -144,7 +144,7 @@ jreleaser {
active = Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
applyMavenCentralRules = true
stagingRepositories.set(listOf("${layout.buildDirectory.get().asFile}/staging-deploy"))
stagingRepositories.set(listOf("${rootProject.layout.buildDirectory.get().asFile}/staging-deploy"))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly points to the root project's build directory, the path construction can be improved to be more robust and idiomatic for Gradle. Using string interpolation with a hardcoded path separator (/) can be brittle on different operating systems. Additionally, using .get() causes eager resolution of the property, which is discouraged in favor of Gradle's lazy configuration model.

A better approach is to use Gradle's Provider API to construct the path lazily and in a platform-independent way.

        stagingRepositories.set(rootProject.layout.buildDirectory.dir("staging-deploy").map { setOf(it.asFile.path) })

}
}
}
Expand Down
Loading