mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Extract the variables in the runner script
This commit is contained in:
@ -1,5 +1,15 @@
|
|||||||
workingdir=./build/__TESTSAPP__
|
workingdir=./.testsapprun
|
||||||
startdir=$(pwd)
|
startdir=$(pwd)
|
||||||
|
|
||||||
|
emuProcId=".*emulator64-x86"
|
||||||
|
emuAvdName=Api19
|
||||||
|
androidRuntimePath=/Users/erjan/tns-android.tgz
|
||||||
|
|
||||||
|
testsAppName=TestsApp
|
||||||
|
pathToApk=./platforms/android/build/outputs/apk/$testsAppName-debug.apk
|
||||||
|
deployedAppName=org.nativescript.$testsAppName
|
||||||
|
mainActivityName=com.tns.NativeScriptActivity
|
||||||
|
|
||||||
rm -rd $workingdir
|
rm -rd $workingdir
|
||||||
mkdir $workingdir
|
mkdir $workingdir
|
||||||
cd $workingdir
|
cd $workingdir
|
||||||
@ -9,16 +19,16 @@ cd $workingdir
|
|||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Killing the emulator..."
|
echo "Killing the emulator..."
|
||||||
time pkill ".*emulator64-x86" && true
|
time pkill $emuProcId && true
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Starting the emulator..."
|
echo "Starting the emulator..."
|
||||||
time emulator -avd Api19 -no-audio -no-window &
|
time emulator -avd $emuAvdName -no-audio -no-window &
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Creating the app..."
|
echo "Creating the app..."
|
||||||
time tns create TestsApp
|
time tns create $testsAppName
|
||||||
cd TestsApp
|
cd $testsAppName
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Removing the original template files..."
|
echo "Removing the original template files..."
|
||||||
@ -26,18 +36,18 @@ time rm app/*.*
|
|||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Copying the test app files..."
|
echo "Copying the test app files..."
|
||||||
time cp -r ../../../bin/dist/apps/tests/* ./app/
|
time cp -r ../../bin/dist/apps/tests/* ./app/
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Adding the android platform..."
|
echo "Adding the android platform..."
|
||||||
time tns platform add android #--frameworkPath=/Users/erjan/tns-android.tgz
|
time tns platform add android --frameworkPath=$androidRuntimePath
|
||||||
|
|
||||||
# GET THIS ONE FROM SOME PLACE...
|
|
||||||
cp /Volumes/distributions/DailyBuilds/NativeScript/android-widgets/Stable/widgets.jar platforms/android/libs/
|
|
||||||
|
|
||||||
# #DO THE REPLACEMENTS IN THE Info.plist and AndroidManifest.xml
|
# #DO THE REPLACEMENTS IN THE Info.plist and AndroidManifest.xml
|
||||||
cp /Users/erjan/work/spikes/__DEL__/AndroidManifest.xml platforms/android/src/main/
|
cp /Users/erjan/work/spikes/__DEL__/AndroidManifest.xml platforms/android/src/main/
|
||||||
|
|
||||||
|
# GET THIS ONE FROM SOME PLACE...
|
||||||
|
cp /Volumes/distributions/DailyBuilds/NativeScript/android-widgets/Stable/widgets.jar platforms/android/libs/
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Building the application..."
|
echo "Building the application..."
|
||||||
time tns build android
|
time tns build android
|
||||||
@ -52,15 +62,15 @@ time adb start-server
|
|||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Uninstalling the app..."
|
echo "Uninstalling the app..."
|
||||||
time adb uninstall org.nativescript.TestsApp
|
time adb uninstall $deployedAppName
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Installing the app..."
|
echo "Installing the app..."
|
||||||
time adb install ./platforms/android/build/outputs/apk/TestsApp-debug.apk
|
time adb install $pathToApk
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Starting the app..."
|
echo "Starting the app..."
|
||||||
time adb shell am start -n org.nativescript.TestsApp/com.tns.NativeScriptActivity
|
time adb shell am start -n $deployedAppName/$mainActivityName
|
||||||
|
|
||||||
cd $startdir
|
cd $startdir
|
||||||
|
|
||||||
@ -68,4 +78,4 @@ echo "------------------------------------------------"
|
|||||||
echo "Waiting for the tests to finish executing..."
|
echo "Waiting for the tests to finish executing..."
|
||||||
time ./expect.exp
|
time ./expect.exp
|
||||||
|
|
||||||
pkill ".*emulator64-x86" && true
|
pkill $emuProcId && true
|
||||||
|
Reference in New Issue
Block a user