1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 00:38:11 -07:00

Fix crash due to @Nullable not being Runtime.

This commit is contained in:
Cedric Beust 2016-01-07 21:44:29 +04:00
parent 1e1f0e3ac2
commit 60afbed65f
2 changed files with 9 additions and 5 deletions

View file

@ -122,6 +122,7 @@ val kobaltApp = kotlinProject(kobaltPluginApi, wrapper) {
"com.beust:jcommander:1.48",
"com.squareup.retrofit:retrofit:1.9.0",
"org.apache.maven:maven-model:3.3.3",
"com.google.code.findbugs:jsr305:3.0.1",
"org.codehaus.plexus:plexus-utils:3.0.22")
}

View file

@ -15,9 +15,9 @@ import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.google.inject.assistedinject.Assisted
import com.squareup.okhttp.Response
import org.jetbrains.annotations.Nullable
import retrofit.mime.TypedFile
import java.io.File
import javax.annotation.Nullable
import javax.inject.Inject
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?,
@Nullable @Assisted("password") val password: String?, @Nullable @Assisted("org") val org: String?,
public class JCenterApi @Inject constructor (
@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) {
interface IFactory {
@ -63,8 +65,9 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
}
fun packageExists(packageName: String) : Boolean {
val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", org ?: username!!, "maven", packageName)
.joinToString("/")
val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", org ?: username!!,
"maven", packageName)
.joinToString("/")
val jcResponse = parseResponse(http.get(username, password, url))
if (jcResponse.errorMessage != null) {