Skip to content

Commit

Permalink
Update to Kotlin 1.3 and remove experimental flags
Browse files Browse the repository at this point in the history
  • Loading branch information
SalvatoreT committed Nov 5, 2018
1 parent b77e397 commit 13227fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
9 changes: 2 additions & 7 deletions app/build.gradle
Expand Up @@ -45,7 +45,8 @@ dependencies {
testImplementation "com.squareup.assertj:assertj-android:1.2.0"
testImplementation "com.android.support:support-annotations:$support_version"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.24.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0"

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.ligi:tracedroid:1.4"
Expand All @@ -70,9 +71,3 @@ dependencies {

kaptAndroidTest "com.google.dagger:dagger-compiler:$dagger_version"
}

kotlin {
experimental {
coroutines "enable"
}
}
12 changes: 6 additions & 6 deletions app/src/main/java/org/ligi/ipfsdroid/IPFSDaemon.kt
Expand Up @@ -5,9 +5,9 @@ import android.app.ProgressDialog
import android.content.Context
import android.os.Build
import android.support.v7.app.AlertDialog
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.android.UI
import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import okio.Okio
import java.io.File
import java.io.FileNotFoundException
Expand All @@ -28,23 +28,23 @@ class IPFSDaemon(private val androidContext: Context) {

fun download(activity: Activity,
runInit: Boolean,
afterDownloadCallback: () -> Unit) = async(UI) {
afterDownloadCallback: () -> Unit) = GlobalScope.async(Dispatchers.Main) {

val progressDialog = ProgressDialog(androidContext)
progressDialog.setMessage("Copy IPFS binary")
progressDialog.setCancelable(false)
progressDialog.show()

try {
async(CommonPool) {
GlobalScope.async {
downloadFile(activity)
getBinaryFile().setExecutable(true)
}.await()

if (runInit) {
progressDialog.setMessage("Running init")

val readText = async(CommonPool) {
val readText = GlobalScope.async {
val exec = run("init")
exec.waitFor()

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
@@ -1,6 +1,6 @@
buildscript {
ext {
kotlin_version = '1.2.71'
kotlin_version = '1.3.0'
support_version = '27.1.1'
dagger_version = '2.16'
permissiondispatcher_version = '3.2.0'
Expand Down

0 comments on commit 13227fd

Please sign in to comment.