Skip to content

Commit a42d596

Browse files
committed
review feedback
1 parent d48fce5 commit a42d596

File tree

1 file changed

+14
-16
lines changed
  • build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/dsl

1 file changed

+14
-16
lines changed

build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/dsl/Publish.kt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ private object Properties {
2121
}
2222

2323
private object EnvironmentVariables {
24-
object JReleaser {
25-
const val GROUP_ID = "JRELEASER_PROJECT_JAVA_GROUP_ID"
26-
const val MAVEN_CENTRAL_USERNAME = "JRELEASER_MAVENCENTRAL_USERNAME"
27-
const val MAVEN_CENTRAL_TOKEN = "JRELEASER_MAVENCENTRAL_TOKEN"
28-
const val GPG_PASSPHRASE = "JRELEASER_GPG_PASSPHRASE"
29-
const val GPG_PUBLIC_KEY = "JRELEASER_GPG_PUBLIC_KEY"
30-
const val GPG_SECRET_KEY = "JRELEASER_GPG_SECRET_KEY"
31-
}
24+
const val GROUP_ID = "JRELEASER_PROJECT_JAVA_GROUP_ID"
25+
const val MAVEN_CENTRAL_USERNAME = "JRELEASER_MAVENCENTRAL_USERNAME"
26+
const val MAVEN_CENTRAL_TOKEN = "JRELEASER_MAVENCENTRAL_TOKEN"
27+
const val GPG_PASSPHRASE = "JRELEASER_GPG_PASSPHRASE"
28+
const val GPG_PUBLIC_KEY = "JRELEASER_GPG_PUBLIC_KEY"
29+
const val GPG_SECRET_KEY = "JRELEASER_GPG_SECRET_KEY"
3230
}
3331

3432
private val ALLOWED_PUBLICATION_NAMES = setOf(
@@ -113,8 +111,8 @@ fun Project.configurePublishing(repoName: String, githubOrganization: String = "
113111
}
114112
}
115113

116-
val secretKey = System.getenv(EnvironmentVariables.JReleaser.GPG_SECRET_KEY)
117-
val passphrase = System.getenv(EnvironmentVariables.JReleaser.GPG_PASSPHRASE)
114+
val secretKey = System.getenv(EnvironmentVariables.GPG_SECRET_KEY)
115+
val passphrase = System.getenv(EnvironmentVariables.GPG_PASSPHRASE)
118116

119117
if (!secretKey.isNullOrBlank() && !passphrase.isNullOrBlank()) {
120118
apply(plugin = "signing")
@@ -153,11 +151,11 @@ fun Project.configureJReleaser() {
153151

154152
var missingVariables = false
155153
listOf(
156-
EnvironmentVariables.JReleaser.MAVEN_CENTRAL_USERNAME,
157-
EnvironmentVariables.JReleaser.MAVEN_CENTRAL_TOKEN,
158-
EnvironmentVariables.JReleaser.GPG_PASSPHRASE,
159-
EnvironmentVariables.JReleaser.GPG_PUBLIC_KEY,
160-
EnvironmentVariables.JReleaser.GPG_SECRET_KEY,
154+
EnvironmentVariables.MAVEN_CENTRAL_USERNAME,
155+
EnvironmentVariables.MAVEN_CENTRAL_TOKEN,
156+
EnvironmentVariables.GPG_PASSPHRASE,
157+
EnvironmentVariables.GPG_PUBLIC_KEY,
158+
EnvironmentVariables.GPG_SECRET_KEY,
161159
).forEach {
162160
if (System.getenv(it).isNullOrBlank()) {
163161
missingVariables = true
@@ -206,7 +204,7 @@ private fun isAvailableForPublication(project: Project, publication: MavenPublic
206204
if (project.extra.has(Properties.SKIP_PUBLISHING)) shouldPublish = false
207205

208206
// Only publish publications with the configured group from JReleaser or everything if JReleaser group is not configured
209-
val publishGroupName = System.getenv(EnvironmentVariables.JReleaser.GROUP_ID)
207+
val publishGroupName = System.getenv(EnvironmentVariables.GROUP_ID)
210208
shouldPublish = shouldPublish && (publishGroupName == null || publication.groupId.startsWith(publishGroupName))
211209

212210
// Validate publication name is allowed to be published

0 commit comments

Comments
 (0)