Fix gradle script not working without maven username/password

This commit is contained in:
DBotThePony 2022-05-14 16:46:47 +07:00
parent af172dafe8
commit ad93ff58fb
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -242,7 +242,11 @@ tasks {
} }
} }
publishing { val mavenUser: String? by project
val mavenPassword: String? by project
if (mavenUser != null && mavenPassword != null) {
publishing {
publications { publications {
create<MavenPublication>("mavenJava") { create<MavenPublication>("mavenJava") {
// from(components["java"]) // from(components["java"])
@ -268,13 +272,12 @@ publishing {
url = uri("sftp://maven@dbotthepony.ru:22/maven") url = uri("sftp://maven@dbotthepony.ru:22/maven")
credentials { credentials {
val mavenUser: String by project
val mavenPassword: String by project
username = mavenUser username = mavenUser
password = mavenPassword password = mavenPassword
} }
} }
} }
}
} }
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing