Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Add build-tools and aapt discovery. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunikkk authored Nov 16, 2017
1 parent 8a36190 commit 1bdeb6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions android/src/main/kotlin/com/gojuno/commander/android/Adb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ import java.util.concurrent.TimeUnit.SECONDS

val androidHome: String by lazy { System.getenv("ANDROID_HOME") }
val adb: String by lazy { "$androidHome/platform-tools/adb" }
private val buildTools: String? by lazy {
File(androidHome, "build-tools")
.listFiles()
.sortedArray()
.lastOrNull()
?.absolutePath
}
val aapt: String by lazy { buildTools?.let { "$buildTools/aapt" } ?: "" }

fun connectedAdbDevices(): Observable<Set<AdbDevice>> = process(listOf(adb, "devices"), unbufferedOutput = true)
.ofType(Notification.Exit::class.java)
Expand Down

0 comments on commit 1bdeb6e

Please sign in to comment.