mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Start moving the code to grunt
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,6 +15,7 @@ dist/
|
||||
!css-value/**/*.*
|
||||
!fetch/**/*.*
|
||||
!apps/TelerikNEXT/lib/**/*.*
|
||||
!build/*.*
|
||||
CrossPlatformModules.sln.ide/
|
||||
*.suo
|
||||
CrossPlatformModules.suo
|
||||
|
||||
67
build/run-testsapp.grunt.js
Normal file
67
build/run-testsapp.grunt.js
Normal 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"
|
||||
]);
|
||||
}
|
||||
}
|
||||
1073
gruntfile.js
1073
gruntfile.js
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user