mirror of
https://github.com/InsanusMokrassar/KotlinPublicationScriptsBuilder.git
synced 2024-11-14 12:23:56 +00:00
repositories properties now checked
This commit is contained in:
parent
4c4845803d
commit
b43016bb24
@ -22,14 +22,20 @@ data class MavenPublishingRepository(
|
|||||||
name.toUpperCase()
|
name.toUpperCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun build(indent: String) = """maven {
|
fun build(indent: String): String {
|
||||||
name = "$name"
|
val usernameProperty = "${nameCapitalized}_USER"
|
||||||
url = uri("$url")
|
val passwordProperty = "${nameCapitalized}_PASSWORD"
|
||||||
credentials {
|
return """if ((project.hasProperty('${usernameProperty}') || System.getenv('${usernameProperty}') != null) && (project.hasProperty('${passwordProperty}') || System.getenv('${passwordProperty}') != null)) {
|
||||||
username = project.hasProperty('${nameCapitalized}_USER') ? project.property('${nameCapitalized}_USER') : System.getenv('${nameCapitalized}_USER')
|
maven {
|
||||||
password = project.hasProperty('${nameCapitalized}_PASSWORD') ? project.property('${nameCapitalized}_PASSWORD') : System.getenv('${nameCapitalized}_PASSWORD')
|
name = "$name"
|
||||||
|
url = uri("$url")
|
||||||
|
credentials {
|
||||||
|
username = project.hasProperty('${usernameProperty}') ? project.property('${usernameProperty}') : System.getenv('${usernameProperty}')
|
||||||
|
password = project.hasProperty('${passwordProperty}') ? project.property('${passwordProperty}') : System.getenv('${passwordProperty}')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}""".replace("\n", "\n$indent")
|
}""".replace("\n", "\n$indent")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val SonatypeRepository = MavenPublishingRepository("sonatype", "https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
val SonatypeRepository = MavenPublishingRepository("sonatype", "https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
|
Loading…
Reference in New Issue
Block a user