Skip to content

Commit

Permalink
add credentials for nexus
Browse files Browse the repository at this point in the history
  • Loading branch information
osoykan committed Oct 19, 2022
1 parent 2d2d691 commit 10f4e8d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version = "2.0.0-SNAPSHOT"
plugins {
kotlin("jvm") version "1.7.20"
id("kediatr-publishing") apply false
id("kediatr-signing")
id("kediatr-coverage")
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
}
Expand Down
26 changes: 14 additions & 12 deletions buildSrc/src/main/kotlin/kediatr-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ plugins {
`maven-publish`
signing
}

fun getProperty(
projectKey: String,
environmentKey: String,
): String? {
return if (project.hasProperty(projectKey)) {
project.property(projectKey) as? String?
} else {
System.getenv(environmentKey)
}
}
afterEvaluate {
publishing {
publications {
Expand Down Expand Up @@ -50,21 +59,14 @@ afterEvaluate {
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
// url = uri(layout.buildDirectory.dir("mavenlocalpublish"))
credentials {
username = getProperty("nexus_username", "nexus_username")
password = getProperty("nexus_password", "nexus_password")
}
}
}
}

fun getProperty(
projectKey: String,
environmentKey: String,
): String? {
return if (project.hasProperty(projectKey)) {
project.property(projectKey) as? String?
} else {
System.getenv(environmentKey)
}
}

val signingKey = getProperty(projectKey = "gpg.key", environmentKey = "gpg_private_key")
val passPhrase = getProperty(projectKey = "gpg.passphrase", environmentKey = "gpg_passphrase")
signing {
Expand Down
8 changes: 0 additions & 8 deletions buildSrc/src/main/kotlin/kediatr-signing.gradle.kts

This file was deleted.

0 comments on commit 10f4e8d

Please sign in to comment.