Skip to content

Commit 4db079f

Browse files
committed
Add typedoc api-ref grunt task
1 parent 2da344d commit 4db079f

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

gruntfile.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ module.exports = function(grunt) {
132132
outModulesDir: tsconfig.compilerOptions.outDir,
133133
outAppsDir: "./bin/dist/apps",
134134
outTsAppsDir: "./bin/dist/ts-apps",
135+
outApiRefDir: "./bin/dist/api-ref"
135136
};
136137

137138
var nodeTestEnv = JSON.parse(JSON.stringify(process.env));
@@ -150,6 +151,16 @@ module.exports = function(grunt) {
150151
"!android17.d.ts",
151152
"!libjs.d.ts"
152153
]);
154+
localCfg.srcTsdFiles = [
155+
"**/*.d.ts",
156+
"!apps/**",
157+
"!node-tests/**",
158+
"!org.nativescript.widgets.d.ts",
159+
"!android17.d.ts",
160+
"!**/*.android.d.ts",
161+
"!ios.d.ts",
162+
"!**/*.ios.d.ts"
163+
].concat(localCfg.defaultExcludes);
153164

154165
var tsOptions = tsconfig.compilerOptions;
155166
tsOptions.fast = 'never';
@@ -411,6 +422,26 @@ module.exports = function(grunt) {
411422
pathModule.join(localCfg.outDir, "**/*.xml")
412423
]
413424
}
425+
},
426+
typedoc: {
427+
build: {
428+
options: {
429+
// 'flag:undefined' will set flags without options.
430+
"module": 'commonjs',
431+
"target": 'es5',
432+
"out": localCfg.outApiRefDir,
433+
//"json": './dist/doc.json',
434+
"name": 'NativeScript',
435+
"includeDeclarations": undefined,
436+
//"excludeExternals": undefined,
437+
//"externalPattern": './declarations.d.ts',
438+
"mode": "file",
439+
//"readme": "source/README.md",
440+
//"entryPoint": '"a-module"'
441+
// verbose: undefined
442+
},
443+
src: localCfg.srcTsdFiles
444+
}
414445
}
415446
});
416447

@@ -424,6 +455,7 @@ module.exports = function(grunt) {
424455
grunt.loadNpmTasks("grunt-env");
425456
grunt.loadNpmTasks("grunt-simple-mocha");
426457
grunt.loadNpmTasks('grunt-bom-removal');
458+
grunt.loadNpmTasks('grunt-typedoc');
427459

428460
var cloneTasks = function(originalTasks, taskNameSuffix) {
429461
var clonedTasks = [];

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"grunt-simple-mocha": "0.4.0",
2929
"grunt-ts": "5.0.0-beta.5",
3030
"grunt-tslint": "2.5.0",
31+
"grunt-typedoc": "0.2.3",
3132
"grunt-untar": "0.0.1",
3233
"mocha": "2.2.5",
3334
"typescript": "1.6.2"

0 commit comments

Comments
 (0)