mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 16:48:12 -07:00
Fix crash due to @Nullable not being Runtime.
This commit is contained in:
parent
1e1f0e3ac2
commit
60afbed65f
2 changed files with 9 additions and 5 deletions
|
@ -122,6 +122,7 @@ val kobaltApp = kotlinProject(kobaltPluginApi, wrapper) {
|
||||||
"com.beust:jcommander:1.48",
|
"com.beust:jcommander:1.48",
|
||||||
"com.squareup.retrofit:retrofit:1.9.0",
|
"com.squareup.retrofit:retrofit:1.9.0",
|
||||||
"org.apache.maven:maven-model:3.3.3",
|
"org.apache.maven:maven-model:3.3.3",
|
||||||
|
"com.google.code.findbugs:jsr305:3.0.1",
|
||||||
"org.codehaus.plexus:plexus-utils:3.0.22")
|
"org.codehaus.plexus:plexus-utils:3.0.22")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,9 @@ import com.google.gson.JsonObject
|
||||||
import com.google.gson.JsonParser
|
import com.google.gson.JsonParser
|
||||||
import com.google.inject.assistedinject.Assisted
|
import com.google.inject.assistedinject.Assisted
|
||||||
import com.squareup.okhttp.Response
|
import com.squareup.okhttp.Response
|
||||||
import org.jetbrains.annotations.Nullable
|
|
||||||
import retrofit.mime.TypedFile
|
import retrofit.mime.TypedFile
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import javax.annotation.Nullable
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
data class JCenterPackage(val jo: JsonObject) {
|
data class JCenterPackage(val jo: JsonObject) {
|
||||||
|
@ -52,8 +52,10 @@ open public class UnauthenticatedJCenterApi @Inject constructor(open val http: H
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val username: String?,
|
public class JCenterApi @Inject constructor (
|
||||||
@Nullable @Assisted("password") val password: String?, @Nullable @Assisted("org") val org: String?,
|
@Nullable @Assisted("username") val username: String?,
|
||||||
|
@Nullable @Assisted("password") val password: String?,
|
||||||
|
@Nullable @Assisted("org") val org: String?,
|
||||||
override val http: Http, val gpg: Gpg, val executors: KobaltExecutors) : UnauthenticatedJCenterApi(http) {
|
override val http: Http, val gpg: Gpg, val executors: KobaltExecutors) : UnauthenticatedJCenterApi(http) {
|
||||||
|
|
||||||
interface IFactory {
|
interface IFactory {
|
||||||
|
@ -63,8 +65,9 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
||||||
}
|
}
|
||||||
|
|
||||||
fun packageExists(packageName: String) : Boolean {
|
fun packageExists(packageName: String) : Boolean {
|
||||||
val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", org ?: username!!, "maven", packageName)
|
val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", org ?: username!!,
|
||||||
.joinToString("/")
|
"maven", packageName)
|
||||||
|
.joinToString("/")
|
||||||
val jcResponse = parseResponse(http.get(username, password, url))
|
val jcResponse = parseResponse(http.get(username, password, url))
|
||||||
|
|
||||||
if (jcResponse.errorMessage != null) {
|
if (jcResponse.errorMessage != null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue