mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Add the new snippet injector in grunt task
This commit is contained in:
35
gruntfile.js
35
gruntfile.js
@@ -139,12 +139,14 @@ module.exports = function(grunt) {
|
||||
var localCfg = {
|
||||
srcDir: ".",
|
||||
srcAppsDir: "./apps",
|
||||
srcAppsTests: "./apps/tests",
|
||||
packageJsonFilePath: "./package.json",
|
||||
outDir: "./bin/dist",
|
||||
outArticlesDir: "./bin/dist/articles",
|
||||
outModulesDir: tsconfig.compilerOptions.outDir || "./bin/dist/modules",
|
||||
outAppsDir: "./bin/dist/apps",
|
||||
outTsAppsDir: "./bin/dist/ts-apps",
|
||||
outApiRefDir: "./bin/dist/api-ref"
|
||||
outApiRefDir: "./bin/dist/apiref"
|
||||
};
|
||||
|
||||
var nodeTestEnv = JSON.parse(JSON.stringify(process.env));
|
||||
@@ -214,6 +216,12 @@ module.exports = function(grunt) {
|
||||
},
|
||||
readyAppFiles: {
|
||||
src: [localCfg.outModulesDir + "/apps/**"]
|
||||
},
|
||||
articles: {
|
||||
src: [ localCfg.outArticlesDir ]
|
||||
},
|
||||
"apiref": {
|
||||
src: [ localCfg.outApiRefDir ]
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
@@ -228,6 +236,12 @@ module.exports = function(grunt) {
|
||||
dest: localCfg.outModulesDir,
|
||||
cwd: localCfg.srcDir
|
||||
},
|
||||
articleMDs: {
|
||||
expand: true,
|
||||
src: [ "**/*.md" ],
|
||||
dest: localCfg.outArticlesDir,
|
||||
cwd: localCfg.srcAppsTests
|
||||
},
|
||||
license: {
|
||||
expand: true,
|
||||
src: [
|
||||
@@ -413,6 +427,9 @@ module.exports = function(grunt) {
|
||||
},
|
||||
mochaNode: {
|
||||
cmd: "grunt simplemocha:node"
|
||||
},
|
||||
injectArticles: {
|
||||
cmd: "./node_modules/.bin/mdinject --root=<%= localCfg.srcAppsTests %> --docsroot=<%= localCfg.outArticlesDir %>"
|
||||
}
|
||||
},
|
||||
multidest: {
|
||||
@@ -707,4 +724,20 @@ module.exports = function(grunt) {
|
||||
"ts:build-inplace",
|
||||
"generate-tns-core-modules-dev-dts"
|
||||
]);
|
||||
|
||||
grunt.registerTask("apiref", [
|
||||
"clean:apiref",
|
||||
"typedoc:build"
|
||||
]);
|
||||
|
||||
grunt.registerTask("articles", [
|
||||
"clean:articles",
|
||||
"copy:articleMDs",
|
||||
"exec:injectArticles"
|
||||
]);
|
||||
|
||||
grunt.registerTask("docs", [
|
||||
"apiref",
|
||||
"articles"
|
||||
]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user