mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(grunt): Add platforms folder to produced NPM package (#6015)
This commit is contained in:
14
gruntfile.js
14
gruntfile.js
@@ -32,7 +32,7 @@ module.exports = function(grunt) {
|
|||||||
if (blockCommentPrivate.test(content)) {
|
if (blockCommentPrivate.test(content)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var processed = content;
|
var processed = content;
|
||||||
processed = processed.replace(/\/\/[\/\s]*@private[^]*?\/\/[\/\s]*?@endprivate/gm, "");
|
processed = processed.replace(/\/\/[\/\s]*@private[^]*?\/\/[\/\s]*?@endprivate/gm, "");
|
||||||
return processed;
|
return processed;
|
||||||
@@ -106,7 +106,7 @@ module.exports = function(grunt) {
|
|||||||
copyAppsSrc.push("!" + localCfg.srcAppDirs[i] + "/**/*.map");
|
copyAppsSrc.push("!" + localCfg.srcAppDirs[i] + "/**/*.map");
|
||||||
copyAppsSrc.push("!" + localCfg.srcAppDirs[i] + "/**/*.ts");
|
copyAppsSrc.push("!" + localCfg.srcAppDirs[i] + "/**/*.ts");
|
||||||
}
|
}
|
||||||
|
|
||||||
var nodeTestEnv = JSON.parse(JSON.stringify(process.env));
|
var nodeTestEnv = JSON.parse(JSON.stringify(process.env));
|
||||||
nodeTestEnv.NODE_PATH = localCfg.outTnsCoreModules;
|
nodeTestEnv.NODE_PATH = localCfg.outTnsCoreModules;
|
||||||
localCfg.nodeTestsDir = path.join(localCfg.outDir, 'unit-tests');
|
localCfg.nodeTestsDir = path.join(localCfg.outDir, 'unit-tests');
|
||||||
@@ -236,6 +236,11 @@ module.exports = function(grunt) {
|
|||||||
],
|
],
|
||||||
dest: localCfg.outDir + "/"
|
dest: localCfg.outDir + "/"
|
||||||
},
|
},
|
||||||
|
platformsFiles: {
|
||||||
|
expand: true,
|
||||||
|
src: "tns-core-modules/platforms/**/*.*",
|
||||||
|
dest: localCfg.outDir + "/"
|
||||||
|
},
|
||||||
apps: {
|
apps: {
|
||||||
expand: true,
|
expand: true,
|
||||||
src: copyAppsSrc,
|
src: copyAppsSrc,
|
||||||
@@ -321,6 +326,7 @@ module.exports = function(grunt) {
|
|||||||
// Register Tasks
|
// Register Tasks
|
||||||
grunt.registerTask("collect-modules-raw-files", [
|
grunt.registerTask("collect-modules-raw-files", [
|
||||||
"copy:jsLibs",
|
"copy:jsLibs",
|
||||||
|
"copy:platformsFiles",
|
||||||
"copy:license"
|
"copy:license"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -372,7 +378,7 @@ module.exports = function(grunt) {
|
|||||||
"copy:modulesPackageDef",
|
"copy:modulesPackageDef",
|
||||||
"exec:packModules"
|
"exec:packModules"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask("compile-modules", [
|
grunt.registerTask("compile-modules", [
|
||||||
"clean:build",
|
"clean:build",
|
||||||
"shell:getGitSHA",
|
"shell:getGitSHA",
|
||||||
@@ -446,7 +452,7 @@ module.exports = function(grunt) {
|
|||||||
shelljs.exec("npm pack", {cwd: outAppDir});
|
shelljs.exec("npm pack", {cwd: outAppDir});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerTask("get-ready-packages", ["copy:readyPackages"]);
|
grunt.registerTask("get-ready-packages", ["copy:readyPackages"]);
|
||||||
|
|
||||||
grunt.registerTask("default", (skipTsLint ? [] : ["shell:tslint"]).concat([
|
grunt.registerTask("default", (skipTsLint ? [] : ["shell:tslint"]).concat([
|
||||||
|
|||||||
Reference in New Issue
Block a user