mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Finish the transfer to grunt. Remove the bash script running the app
This commit is contained in:
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
applicationDir: pathModule.join(".testsapprun", "TestsApp"),
|
applicationDir: pathModule.join(".testsapprun", "TestsApp"),
|
||||||
appDir: pathModule.join(".testsapprun", "TestsApp", "app"),
|
appDir: pathModule.join(".testsapprun", "TestsApp", "app"),
|
||||||
pathToApk:"./platforms/android/build/outputs/apk/TestsApp-debug.apk",
|
pathToApk:"./platforms/android/build/outputs/apk/TestsApp-debug.apk",
|
||||||
deployedAppName:"org.nativescript.$testsAppName",
|
deployedAppName:"org.nativescript.TestsApp",
|
||||||
mainActivityName:"com.tns.NativeScriptActivity",
|
mainActivityName:"com.tns.NativeScriptActivity",
|
||||||
pathToCompiledTests: "bin/dist/apps/tests"
|
pathToCompiledTests: "bin/dist/apps/tests"
|
||||||
}
|
}
|
||||||
@@ -94,13 +94,38 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
restartAdb: {
|
restartAdb: {
|
||||||
cmd: "adb kill-server && adb start-server"
|
cmd: "adb kill-server && adb start-server"
|
||||||
|
},
|
||||||
|
uninstallExistingApp: {
|
||||||
|
cmd: "adb uninstall " + localCfg.deployedAppName
|
||||||
|
},
|
||||||
|
installNewApp: {
|
||||||
|
cmd: "adb install " + localCfg.pathToApk,
|
||||||
|
cwd: localCfg.applicationDir
|
||||||
|
},
|
||||||
|
startApp: {
|
||||||
|
cmd: "adb shell am start -n " + localCfg.deployedAppName + "/" + localCfg.mainActivityName
|
||||||
|
},
|
||||||
|
collectLog: {
|
||||||
|
cmd: "./expect.exp " + localCfg.outfile,
|
||||||
|
stdout: false,
|
||||||
|
strerr: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shell: {
|
||||||
|
collectLog: {
|
||||||
|
command: "./expect.exp " + localCfg.outfile,
|
||||||
|
options: {
|
||||||
|
execOptions: {
|
||||||
|
maxBuffer: Infinity
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// grunt.loadNpmTasks("grunt-tslint");
|
// grunt.loadNpmTasks("grunt-tslint");
|
||||||
// grunt.loadNpmTasks("grunt-multi-dest");
|
// grunt.loadNpmTasks("grunt-multi-dest");
|
||||||
// grunt.loadNpmTasks("grunt-shell");
|
grunt.loadNpmTasks("grunt-shell");
|
||||||
// grunt.loadNpmTasks("grunt-env");
|
// grunt.loadNpmTasks("grunt-env");
|
||||||
// grunt.loadNpmTasks("grunt-simple-mocha");
|
// grunt.loadNpmTasks("grunt-simple-mocha");
|
||||||
grunt.loadNpmTasks("grunt-exec");
|
grunt.loadNpmTasks("grunt-exec");
|
||||||
@@ -109,19 +134,24 @@ module.exports = {
|
|||||||
grunt.loadNpmTasks("grunt-contrib-copy");
|
grunt.loadNpmTasks("grunt-contrib-copy");
|
||||||
|
|
||||||
grunt.registerTask("testsapp", [
|
grunt.registerTask("testsapp", [
|
||||||
"clean:workingDir",
|
// "clean:workingDir",
|
||||||
"mkdir:workingDir",
|
// "mkdir:workingDir",
|
||||||
"exec:killEmulator",
|
// "exec:killEmulator",
|
||||||
"exec:startEmulator",
|
// "exec:startEmulator",
|
||||||
|
//
|
||||||
"exec:createApp",
|
// "exec:createApp",
|
||||||
"clean:originalAppDir",
|
// "clean:originalAppDir",
|
||||||
"copy:testsAppToRunDir",
|
// "copy:testsAppToRunDir",
|
||||||
|
//
|
||||||
"exec:addAndroidPlatform",
|
// "exec:addAndroidPlatform",
|
||||||
"copy:addAndroidPermissions",
|
// "copy:addAndroidPermissions",
|
||||||
"exec:buildAppAndroid",
|
// "exec:buildAppAndroid",
|
||||||
"exec:restartAdb",
|
// "exec:restartAdb",
|
||||||
|
//
|
||||||
|
"exec:uninstallExistingApp",
|
||||||
|
"exec:installNewApp",
|
||||||
|
"exec:startApp",
|
||||||
|
"shell:collectLog",
|
||||||
|
|
||||||
|
|
||||||
// "exec:killEmulator",
|
// "exec:killEmulator",
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
workingdir=./.testsapprun
|
|
||||||
startdir=$(pwd)
|
|
||||||
|
|
||||||
emuProcId=".*emulator64-x86"
|
|
||||||
emuAvdName=Api19
|
|
||||||
androidRuntimePath=/Users/erjan/tns-android.tgz
|
|
||||||
outfile=./TestRunResult.txt
|
|
||||||
|
|
||||||
testsAppName=TestsApp
|
|
||||||
pathToApk=./platforms/android/build/outputs/apk/$testsAppName-debug.apk
|
|
||||||
deployedAppName=org.nativescript.$testsAppName
|
|
||||||
mainActivityName=com.tns.NativeScriptActivity
|
|
||||||
|
|
||||||
# Creating the emulator with:
|
|
||||||
#android create avd -t "android-21" -n Api21 -b "default/x86"
|
|
||||||
|
|
||||||
# GET THIS ONE FROM SOME PLACE...
|
|
||||||
cp /Volumes/distributions/DailyBuilds/NativeScript/android-widgets/Stable/widgets.jar platforms/android/libs/
|
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
|
||||||
echo "Uninstalling the app..."
|
|
||||||
time adb uninstall $deployedAppName
|
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
|
||||||
echo "Installing the app..."
|
|
||||||
time adb install $pathToApk
|
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
|
||||||
echo "Starting the app..."
|
|
||||||
time adb shell am start -n $deployedAppName/$mainActivityName
|
|
||||||
|
|
||||||
cd $startdir
|
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
|
||||||
echo "Waiting for the tests to finish executing..."
|
|
||||||
time ./expect.exp $outfile
|
|
||||||
|
|
||||||
rm -rd $workingdir
|
|
||||||
Reference in New Issue
Block a user