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