From 60c1242a8016f4c22462749a7b99decea5be7a69 Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 19 Aug 2020 23:09:40 +0800 Subject: [PATCH] Fix publishing --- buildSrc/build.gradle.kts | 11 +++++----- buildSrc/src/main/kotlin/upload/Bintray.kt | 25 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e5763c011..443597f65 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -18,15 +18,16 @@ kotlin { dependencies { fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version" - fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version" + fun ktor(id: String, version: String = "1.3.2") = "io.ktor:ktor-$id:$version" api("org.jsoup:jsoup:1.12.1") api("com.google.code.gson:gson:2.8.6") - api(kotlinx("coroutines-core", "1.3.9")) - api(ktor("client-core", "1.4.0")) - api(ktor("client-cio", "1.4.0")) - api(ktor("client-json", "1.4.0")) + api(kotlinx("coroutines-core", "1.3.8")) + + api(ktor("client-core")) + api(ktor("client-cio")) + api(ktor("client-json")) compileOnly(gradleApi()) compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0") diff --git a/buildSrc/src/main/kotlin/upload/Bintray.kt b/buildSrc/src/main/kotlin/upload/Bintray.kt index 3e5cf8604..ba1e89e9b 100644 --- a/buildSrc/src/main/kotlin/upload/Bintray.kt +++ b/buildSrc/src/main/kotlin/upload/Bintray.kt @@ -55,6 +55,18 @@ object Bintray { } } + project.file("bintray.user.txt").let { local -> + if (local.exists()) { + return local.readText().trim() + } + } + + project.rootProject.file("bintray.user.txt").let { local -> + if (local.exists()) { + return local.readText().trim() + } + } + error( "Cannot find bintray user, " + "please specify by creating a file bintray.user.txt in project dir, " + @@ -92,6 +104,19 @@ object Bintray { } } + project.file("bintray.user.txt").let { local -> + if (local.exists()) { + return local.readText().trim() + } + } + + project.rootProject.file("bintray.user.txt").let { local -> + if (local.exists()) { + return local.readText().trim() + } + } + + error( "Cannot find bintray key, " + "please specify by creating a file bintray.key.txt in project dir, " +