From 4db079f2b0e1120ca9a3c78e0900935463f8e61f Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Mon, 9 Nov 2015 15:17:23 +0200 Subject: [PATCH] Add typedoc api-ref grunt task --- gruntfile.js | 32 ++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 33 insertions(+) diff --git a/gruntfile.js b/gruntfile.js index d82386379..338f10a33 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -132,6 +132,7 @@ module.exports = function(grunt) { outModulesDir: tsconfig.compilerOptions.outDir, outAppsDir: "./bin/dist/apps", outTsAppsDir: "./bin/dist/ts-apps", + outApiRefDir: "./bin/dist/api-ref" }; var nodeTestEnv = JSON.parse(JSON.stringify(process.env)); @@ -150,6 +151,16 @@ module.exports = function(grunt) { "!android17.d.ts", "!libjs.d.ts" ]); + localCfg.srcTsdFiles = [ + "**/*.d.ts", + "!apps/**", + "!node-tests/**", + "!org.nativescript.widgets.d.ts", + "!android17.d.ts", + "!**/*.android.d.ts", + "!ios.d.ts", + "!**/*.ios.d.ts" + ].concat(localCfg.defaultExcludes); var tsOptions = tsconfig.compilerOptions; tsOptions.fast = 'never'; @@ -411,6 +422,26 @@ module.exports = function(grunt) { pathModule.join(localCfg.outDir, "**/*.xml") ] } + }, + typedoc: { + build: { + options: { + // 'flag:undefined' will set flags without options. + "module": 'commonjs', + "target": 'es5', + "out": localCfg.outApiRefDir, + //"json": './dist/doc.json', + "name": 'NativeScript', + "includeDeclarations": undefined, + //"excludeExternals": undefined, + //"externalPattern": './declarations.d.ts', + "mode": "file", + //"readme": "source/README.md", + //"entryPoint": '"a-module"' + // verbose: undefined + }, + src: localCfg.srcTsdFiles + } } }); @@ -424,6 +455,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks("grunt-env"); grunt.loadNpmTasks("grunt-simple-mocha"); grunt.loadNpmTasks('grunt-bom-removal'); + grunt.loadNpmTasks('grunt-typedoc'); var cloneTasks = function(originalTasks, taskNameSuffix) { var clonedTasks = []; diff --git a/package.json b/package.json index de79d000a..3cce63271 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "grunt-simple-mocha": "0.4.0", "grunt-ts": "5.0.0-beta.5", "grunt-tslint": "2.5.0", + "grunt-typedoc": "0.2.3", "grunt-untar": "0.0.1", "mocha": "2.2.5", "typescript": "1.6.2"