Added gradle tasks to build & launch app automatically (runFLAVOR_NAME, eg. runGoogleProRelease or rGPR).

This commit is contained in:
Dmitry Yunitsky 2014-12-16 20:03:59 +03:00 committed by Alex Zolotarev
parent 28c8f64c68
commit 4cd3851fe7

View file

@ -231,6 +231,21 @@ android {
}
}
gradle.projectsEvaluated {
android.applicationVariants.all { variant ->
def task = variant.name.capitalize()
def runTask = "run$task"
def installTask = "install$task"
project.task(type: Exec, "${runTask}", dependsOn: "${installTask}") {
doLast {
def component = "com.mapswithme.maps.pro/com.mapswithme.maps.DownloadResourcesActivity"
executable "sh"
args "-c", "adb shell am start -n ${component}"
}
}
}
}
signingConfigs {
mapswithme {
storeFile file('../tools/android/mapswithme.keystore')
@ -279,19 +294,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// TODO add tasks for all flavors to run app.
task runGooglePro(type: Exec, description: 'install iGPR and run') {
commandLine 'bash', '-c', 'adb shell am start -n com.mapswithme.maps.pro/com.mapswithme.maps.DownloadResourcesActivity'
}
// temprorary workaround of bug on android L with gradle plugin
// details here https://groups.google.com/forum/#!topic/adt-dev/oHWbLdonsBU
gradle.projectsEvaluated {
installGoogleProRelease.dependsOn("uninstallGoogleProRelease")
runGooglePro.dependsOn("installGoogleProRelease")
}
}
//@{ Below are tasks needed to compile our NDK part