Start moving the code to grunt

This commit is contained in:
Erjan Gavalji
2015-10-16 16:56:43 +03:00
parent 2f7329ca6f
commit a875096b08
5 changed files with 610 additions and 548 deletions

1
.gitignore vendored
View File

@@ -15,6 +15,7 @@ dist/
!css-value/**/*.*
!fetch/**/*.*
!apps/TelerikNEXT/lib/**/*.*
!build/*.*
CrossPlatformModules.sln.ide/
*.suo
CrossPlatformModules.suo

View File

@@ -0,0 +1,67 @@
module.exports = {
run: function(grunt) {
var localCfg = {
emulatorProcessIdentifier:".*emulator64-x86",
emuAvdName:"Api19",
androidRuntimePath:"/Users/erjan/tns-android.tgz",
outfile:"./TestRunResult.txt",
workingDir=".testsapprun",
testsAppName:"TestsApp",
pathToApk:"./platforms/android/build/outputs/apk/TestsApp-debug.apk",
deployedAppName:"org.nativescript.$testsAppName",
mainActivityName:"com.tns.NativeScriptActivity"
}
grunt.initConfig({
clean: {
workingDir: {
src: localCfg.workingDir
}
},
mkdir: {
workindDir: {
options: {
create [localCfg.workingDir],
mode: 0700
}
}
}
exec: {
killEmulator: {
cmd: "pkill '" + localCfg.emulatorProcessIdentifier + "'",
exitCode: [0, 1]
},
runTestsApp: {
cmd: "./runtestsapp.sh",
stdout: false,
cwd: "../"
}
}
});
// grunt.loadNpmTasks("grunt-contrib-copy");
// grunt.loadNpmTasks("grunt-tslint");
// grunt.loadNpmTasks("grunt-multi-dest");
// grunt.loadNpmTasks("grunt-shell");
// grunt.loadNpmTasks("grunt-env");
// grunt.loadNpmTasks("grunt-simple-mocha");
grunt.loadNpmTasks("grunt-exec");
grunt.loadNpmTasks("grunt-mkdir");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.registerTask("testsapp", [
"clean:workingDir",
"mkdir:workingDir",
"exec:killEmulator",
"exec:runTestsApp",
"exec:killEmulator",
"clean:workingDir"
]);
}
}

View File

File diff suppressed because it is too large Load Diff

View File

@@ -13,18 +13,19 @@
],
"license": "Apache-2.0",
"devDependencies": {
"chai": "3.2.0",
"grunt": "0.4.5",
"grunt-contrib-clean": "0.6.0",
"grunt-contrib-copy": "git+https://github.com/ErjanGavalji/grunt-contrib-copy.git#1c976a133210be4ce8c96313f5daf14833f7f8f9",
"grunt-env": "0.4.4",
"grunt-exec": "0.4.6",
"grunt-mkdir": "^0.1.2",
"grunt-multi-dest": "1.0.0",
"grunt-shell": "1.1.2",
"grunt-simple-mocha": "0.4.0",
"grunt-ts": "5.0.0-beta.5",
"grunt-tslint": "2.5.0",
"mocha": "2.2.5",
"grunt-simple-mocha": "0.4.0",
"grunt-env": "0.4.4",
"chai": "3.2.0",
"typescript": "1.6.2"
}
}

View File

@@ -11,17 +11,9 @@ pathToApk=./platforms/android/build/outputs/apk/$testsAppName-debug.apk
deployedAppName=org.nativescript.$testsAppName
mainActivityName=com.tns.NativeScriptActivity
rm -rd $workingdir
mkdir $workingdir
cd $workingdir
# Creating the emulator with:
#android create avd -t "android-21" -n Api21 -b "default/x86"
echo "------------------------------------------------"
echo "Killing the emulator..."
time pkill $emuProcId && true
echo "------------------------------------------------"
echo "Starting the emulator..."
time emulator -avd $emuAvdName -no-audio -no-window &
@@ -79,6 +71,4 @@ echo "------------------------------------------------"
echo "Waiting for the tests to finish executing..."
time ./expect.exp $outfile
pkill $emuProcId && true
rm -rd $workingdir