jenkins-bot has submitted this change and it was merged.

Change subject: build: Move pre/post 'doc' task into package.json
......................................................................


build: Move pre/post 'doc' task into package.json

Standard entry point.

Change-Id: Ic6cdc9ac1b266a64dcb1522ac36132c5ef844d3c
---
M Gruntfile.js
M bin/generateDocs.sh
M jsduck.json
M package.json
4 files changed, 22 insertions(+), 4 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Gruntfile.js b/Gruntfile.js
index 6c369d1..4f2b4c6 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -8,6 +8,7 @@
 module.exports = function ( grunt ) {
        var modules = grunt.file.readJSON( 'lib/ve/build/modules.json' );
 
+       grunt.loadNpmTasks( 'grunt-contrib-copy' );
        grunt.loadNpmTasks( 'grunt-contrib-csslint' );
        grunt.loadNpmTasks( 'grunt-contrib-jshint' );
        grunt.loadNpmTasks( 'grunt-contrib-watch' );
@@ -72,6 +73,13 @@
                banana: {
                        all: 'modules/ve-{mw,wmf}/i18n/'
                },
+               copy: {
+                       jsduck: {
+                               src: 'lib/ve/**/*',
+                               dest: 'docs/',
+                               expand: true
+                       }
+               },
                watch: {
                        files: [
                                '.{csslintrc,jscsrc,jshintignore,jshintrc}',
diff --git a/bin/generateDocs.sh b/bin/generateDocs.sh
index eeba646..4f0c5d5 100755
--- a/bin/generateDocs.sh
+++ b/bin/generateDocs.sh
@@ -1,4 +1,11 @@
 #!/usr/bin/env bash
+#
+# DEPRECATED: Use 'npm run-script doc' instead.
+#
+# This is kept as-is for back-compat with Jenkins jobs.
+# Don't forward to 'npm run-script' since Jenkins relies on it
+# being a symlink.
+#
 set -e
 cd $(dirname $0)/..
 jsduck
diff --git a/jsduck.json b/jsduck.json
index 33b4972..cb0ae96 100644
--- a/jsduck.json
+++ b/jsduck.json
@@ -1,14 +1,14 @@
 {
        "--title": "VisualEditor - Documentation",
+       "--output": "docs",
        "--categories": ".jsduck/categories.json",
        "--eg-iframe": ".jsduck/eg-iframe.html",
        "--tags": ".jsduck/CustomTags.rb",
-       "--warnings": ["-nodoc(class,public)"],
-       "--builtin-classes": true,
        "--processes": "0",
        "--warnings-exit-nonzero": true,
+       "--builtin-classes": true,
        "--external": 
"HTMLDocument,Window,Node,Set,Range,Selection,ClientRect,File,Blob,DataTransfer,DataTransferItem,KeyboardEvent,MouseEvent",
-       "--output": "docs",
+       "--warnings": ["-nodoc(class,public)"],
        "--": [
                ".jsduck/external.js",
                "lib/ve/.jsduck/external.js",
diff --git a/package.json b/package.json
index 8de3028..ae605a7 100644
--- a/package.json
+++ b/package.json
@@ -4,11 +4,14 @@
   "private": true,
   "description": "Build tools for the VisualEditor-MediaWiki extension.",
   "scripts": {
-    "test": "grunt test"
+    "test": "grunt test",
+    "doc": "jsduck",
+    "postdoc": "grunt copy:jsduck"
   },
   "devDependencies": {
     "grunt": "0.4.5",
     "grunt-banana-checker": "0.2.1",
+    "grunt-contrib-copy": "0.8.0",
     "grunt-contrib-csslint": "0.4.0",
     "grunt-contrib-jshint": "0.11.0",
     "grunt-contrib-watch": "0.6.1",

-- 
To view, visit https://gerrit.wikimedia.org/r/201685
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6cdc9ac1b266a64dcb1522ac36132c5ef844d3c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to