Add bintray availability check

This commit is contained in:
Him188 2020-04-11 00:18:14 +08:00
parent bb548fc20c
commit 34a24f5df4
2 changed files with 14 additions and 0 deletions

View File

@ -14,6 +14,14 @@ import java.io.File
*/
object Bintray {
@JvmStatic
fun isBintrayAvailable(project: Project): Boolean {
return kotlin.runCatching {
getUser(project)
getKey(project)
}.isSuccess
}
@JvmStatic
fun getUser(project: Project): String {
kotlin.runCatching {

View File

@ -3,6 +3,12 @@ import upload.Bintray
// kotlinx.coroutines
// Source code from kotlinx.coroutines
if (!Bintray.isBintrayAvailable(project)) {
println("bintray isn't available. NO PUBLICATIONS WILL BE SET")
return
}
def pomConfig = {
licenses {
license {