From 4997b9c3f508354dc5b021f01015dea8f6300eb2 Mon Sep 17 00:00:00 2001 From: Erjan Gavalji Date: Mon, 2 Nov 2015 23:17:12 +0200 Subject: [PATCH] Introduce a separate group task to make the runApp work as expected --- build/run-testsapp.grunt.js | 14 +++++++++++--- run.sh | 5 +++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/run-testsapp.grunt.js b/build/run-testsapp.grunt.js index 588b9e648..3ecb5ef01 100644 --- a/build/run-testsapp.grunt.js +++ b/build/run-testsapp.grunt.js @@ -63,6 +63,7 @@ module.exports = { if (localCfg.runAppOnly) { localCfg.pathToApp = localCfg.pathToApk = args.pathToApp; + localCfg.applicationDir = "./"; } grunt.initConfig({ @@ -200,7 +201,7 @@ module.exports = { }, startiOSApp: { cmd: "xcrun simctl launch " + localCfg.emuAvdName + " org.nativescript." + localCfg.testsAppName - }, + } }, untar: { modules: { @@ -305,13 +306,20 @@ module.exports = { ]); - grunt.registerTask("runApp", [ + grunt.registerTask("runOnly", [ getPlatformSpecificTask("doPreUninstallApp{platform}"), getPlatformSpecificTask("exec:uninstallExisting{platform}App"), getPlatformSpecificTask("exec:installNew{platform}App"), getPlatformSpecificTask("exec:start{platform}App"), getPlatformSpecificTask("collectLog{platform}"), + ]); + + grunt.registerTask("runApp", [ + "cleanup", + getPlatformSpecificTask("startEmulator{platform}"), + "runOnly", + "cleanup" ]); @@ -323,7 +331,7 @@ module.exports = { "mkdir:workingDir", getPlatformSpecificTask("startEmulator{platform}"), "buildOnly", - "runApp", + "runOnly", "cleanup" ]; } diff --git a/run.sh b/run.sh index 9036d9b96..701fea988 100755 --- a/run.sh +++ b/run.sh @@ -1,6 +1,7 @@ #! /bin/bash -androidRuntimePath=realpath ../../../LATEST_RUNTIMES/tns-android.tgz +androidRuntimePath=$(realpath ../../../LATEST_RUNTIMES/tns-android.tgz) +builtApkPath=$(realpath ../../../THE_APK/TestsApp-debug.apk) #grunt testsapp --verbose --platform=Android --emuPId=".*emulator64-x86" --avd="Api19" --logFilePath="./TestRunResult.txt" --runtimePath="/Users/erjan/tns-android.tgz" --showEmu=true --modulesPath=/Volumes/distributions/DailyBuilds/NativeScript/tns-modules/Stable/tns-core-modules.tgz @@ -11,4 +12,4 @@ androidRuntimePath=realpath ../../../LATEST_RUNTIMES/tns-android.tgz #grunt testsapp --verbose --platform=iOS --runAppOnly --logFilePath="./TestRunResult.txt" --runtimePath="/Users/erjan/tns-ios.tgz" --showEmu=true --modulesPath=/Volumes/distributions/DailyBuilds/NativeScript/tns-modules/Stable/tns-core-modules.tgz --avd="'iPhone 6 (9.0) ['" -grunt buildTestsApp --verbose --platform=Android --emuPId=".*emulator64-x86" --avd="Api21" --logFilePath="./TestRunResult.txt" --runtimePath=$androidRuntimePath --showEmu=true #--modulesPath=/Volumes/distributions/DailyBuilds/NativeScript/tns-modules/Stable/tns-core-modules.tgz +grunt testsapp --runAppOnly --verbose --pathToApp="$builtApkPath" --platform=Android --emuPId=".*emulator64-x86" --avd="Api21" --logFilePath="./TestRunResult.txt" --runtimePath=$androidRuntimePath --showEmu=true #--modulesPath=/Volumes/distributions/DailyBuilds/NativeScript/tns-modules/Stable/tns-core-modules.tgz