From 0445173757cd01c25333b3fd20f25e5fcecd39f9 Mon Sep 17 00:00:00 2001 From: Erjan Gavalji Date: Mon, 26 Oct 2015 11:45:57 +0200 Subject: [PATCH] Now update the modules --- build/run-testsapp.grunt.js | 23 ++++++++++++++++++++++- package.json | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/build/run-testsapp.grunt.js b/build/run-testsapp.grunt.js index 6b1092a22..7e7c1c91a 100644 --- a/build/run-testsapp.grunt.js +++ b/build/run-testsapp.grunt.js @@ -63,6 +63,12 @@ module.exports = { localCfg.appDir + "/*", "!" + pathModule.join(localCfg.appDir, "App_Resources") + "" ] + }, + modules: { + src: pathModule.join(localCfg.applicationDir, "node_modules", "tns-core-modules") + }, + tempExtractedModules: { + src: pathModule.join(localCfg.applicationDir, "node_modules", "package") } }, mkdir: { @@ -80,6 +86,12 @@ module.exports = { cwd: localCfg.pathToCompiledTests, expand: true }, + modulesToDir: { + expand: true, + src: "**/*.*", + cwd: pathModule.join(localCfg.applicationDir, "node_modules", "package"), + dest: pathModule.join(localCfg.applicationDir, "node_modules", "tns-core-modules") + }, addAndroidPermissions: { src: "AndroidManifest.xml", dest: localCfg.applicationDir + "/platforms/android/src/main/", @@ -137,6 +149,12 @@ module.exports = { cmd: "adb shell am start -n " + localCfg.deployedAppName + "/" + localCfg.mainActivityName } }, + untar: { + modules: { + src: localCfg.modulesPath, + dest: pathModule.join(localCfg.applicationDir, "node_modules") + } + }, shell: { collectAndroidLog: { command: "./expect.exp " + localCfg.outfile, @@ -154,6 +172,7 @@ module.exports = { grunt.loadNpmTasks("grunt-mkdir"); grunt.loadNpmTasks("grunt-contrib-clean"); grunt.loadNpmTasks("grunt-contrib-copy"); + grunt.loadNpmTasks("grunt-untar"); var getPlatformSpecificTask = function(templatedTaskName) { return templatedTaskName.replace(/\{platform\}/, localCfg.platform); @@ -172,8 +191,10 @@ module.exports = { "exec:createApp", "clean:originalAppDir", "copy:testsAppToRunDir", + "clean:modules", "untar:modules", - "copy:updateModules", + "copy:modulesToDir", + "clean:tempExtractedModules", getPlatformSpecificTask("exec:add{platform}Platform"), getPlatformSpecificTask("copy:add{platform}Permissions"), diff --git a/package.json b/package.json index 487c4a0a3..bdfc82587 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "grunt-simple-mocha": "0.4.0", "grunt-ts": "5.0.0-beta.5", "grunt-tslint": "2.5.0", + "grunt-untar": "0.0.1", "mocha": "2.2.5", "typescript": "1.6.2" }