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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ See also the [full License text](LICENSE).
[junit5gh]: https://github.com/junit-team/junit5
[junit5ug]: https://junit.org/junit5/docs/current/user-guide
[circleci]: https://circleci.com/gh/mannodermaus/android-junit5
[sonatyperepo]: https://oss.sonatype.org/content/repositories/snapshots
[sonatyperepo]: https://central.sonatype.com/repository/maven-snapshots
[sampletests]: instrumentation/sample
[wiki-home]: https://github.com/mannodermaus/android-junit5/wiki
[wiki-dsl]: https://github.com/mannodermaus/android-junit5/wiki/Configuration
Expand Down
2 changes: 1 addition & 1 deletion README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ See also the [full License text](LICENSE).
[junit5gh]: https://github.com/junit-team/junit5
[junit5ug]: https://junit.org/junit5/docs/current/user-guide
[circleci]: https://circleci.com/gh/mannodermaus/android-junit5
[sonatyperepo]: https://oss.sonatype.org/content/repositories/snapshots
[sonatyperepo]: https://central.sonatype.com/repository/maven-snapshots
[sampletests]: instrumentation/sample
[wiki-home]: https://github.com/mannodermaus/android-junit5/wiki
[wiki-dsl]: https://github.com/mannodermaus/android-junit5/wiki/Configuration
Expand Down
32 changes: 20 additions & 12 deletions build-logic/src/main/kotlin/Deployment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ private fun Project.configureRootDeployment(deployConfig: Deployed, credentials:
group = deployConfig.groupId
version = deployConfig.currentVersion

nexusPublishing(
packageGroup = deployConfig.groupId,
stagingProfileId = credentials.sonatypeStagingProfileId,
sonatypeUsername = credentials.ossrhUsername,
sonatypePassword = credentials.ossrhPassword
centralPublishing(
packageGroup = deployConfig.groupId,
stagingProfileId = credentials.sonatypeStagingProfileId,
username = credentials.centralUsername,
password = credentials.centralPassword
)
}

Expand Down Expand Up @@ -348,11 +348,11 @@ private fun Project.signing(action: SigningExtension.() -> Unit) {

// Nexus Staging & Publishing Plugins facade

private fun Project.nexusPublishing(
packageGroup: String,
stagingProfileId: String?,
sonatypeUsername: String?,
sonatypePassword: String?
private fun Project.centralPublishing(
packageGroup: String,
stagingProfileId: String?,
username: String?,
password: String?
) {
extensions.getByName("nexusPublishing").withGroovyBuilder {
setProperty("packageGroup", packageGroup)
Expand All @@ -368,11 +368,19 @@ private fun Project.nexusPublishing(

cls.getDeclaredMethod("setUsername", Any::class.java)
.also { it.isAccessible = true }
.invoke(delegate, sonatypeUsername)
.invoke(delegate, username)

cls.getDeclaredMethod("setPassword", Any::class.java)
.also { it.isAccessible = true }
.invoke(delegate, sonatypePassword)
.invoke(delegate, password)

cls.getDeclaredMethod("setNexusUrl", Any::class.java)
.also { it.isAccessible = true }
.invoke(delegate, uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))

cls.getDeclaredMethod("setSnapshotRepositoryUrl", Any::class.java)
.also { it.isAccessible = true }
.invoke(delegate, uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions build-logic/src/main/kotlin/Environment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ class DeployedCredentials(private val project: Project) {
var signingKeyId: String?
var signingPassword: String?
var signingKeyRingFile: String?
var ossrhUsername: String?
var ossrhPassword: String?
var centralUsername: String?
var centralPassword: String?
var sonatypeStagingProfileId: String?

init {
Expand All @@ -171,8 +171,8 @@ class DeployedCredentials(private val project: Project) {
this.signingKeyId = properties.getOrEnvvar("SIGNING_KEY_ID")
this.signingPassword = properties.getOrEnvvar("SIGNING_PASSWORD")
this.signingKeyRingFile = properties.getOrEnvvar("SIGNING_KEY_RING_FILE")
this.ossrhUsername = properties.getOrEnvvar("OSSRH_USERNAME")
this.ossrhPassword = properties.getOrEnvvar("OSSRH_PASSWORD")
this.centralUsername = properties.getOrEnvvar("CENTRAL_USERNAME")
this.centralPassword = properties.getOrEnvvar("CENTRAL_PASSWORD")
this.sonatypeStagingProfileId = properties.getOrEnvvar("SONATYPE_STAGING_PROFILE_ID")
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions plugin/.idea/runConfigurations/Plugin__Run_Unit_Tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.