compile options
This commit is contained in:
parent
baf740fc6d
commit
80e10389ab
2 changed files with 8 additions and 2 deletions
|
@ -72,13 +72,17 @@ allprojects {
|
|||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
// Ignore warning for @ExperimentalCoroutinesApi
|
||||
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
'-opt-in=kotlin.RequiresOptIn',
|
||||
'-Xjvm-default=all' //Support @JvmDefault
|
||||
]
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'gradle/jacoco_project.gradle'
|
||||
|
|
|
@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugin.general.openhumans.dagger.BaseUrl
|
|||
import info.nightscout.androidaps.plugin.general.openhumans.dagger.ClientId
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.dagger.ClientSecret
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.dagger.RedirectUrl
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
import okhttp3.*
|
||||
import okio.BufferedSink
|
||||
|
@ -115,6 +116,7 @@ internal class OpenHumansAPI @Inject constructor(
|
|||
if (!response.isSuccessful) throw OHHttpException(response.code, response.message, null)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private suspend fun Request.await(): Response {
|
||||
val call = client.newCall(this)
|
||||
return suspendCancellableCoroutine {
|
||||
|
|
Loading…
Reference in a new issue