diff --git a/grunt/utils.js b/grunt/utils.js index 94aa8c938..b58133f23 100644 --- a/grunt/utils.js +++ b/grunt/utils.js @@ -2,12 +2,18 @@ var _ = require('../src/lib/utils'); var root = require('find-root')(__dirname); var pkg = require(root + '/package.json'); -var branches = pkg.config.supported_es_branches; -branches._default = pkg.config.default_api_branch; +var stable = pkg.config.supported_es_branches; +var unstable = pkg.config.unstable_es_branches; -module.exports = { +var utils = { branchSuffix: function (branch) { - return branch === branches._default ? '' : '_' + _.snakeCase(branch); + return branch === utils.branches._default ? '' : '_' + _.snakeCase(branch); }, - branches: branches -}; \ No newline at end of file + branches: [].concat(stable, unstable), + stableBranches: stable, + unstableBranches: unstable +}; + +utils.branches._default = pkg.config.default_api_branch; + +module.exports = utils; \ No newline at end of file diff --git a/package.json b/package.json index 6c308b1b3..3e5c0616a 100644 --- a/package.json +++ b/package.json @@ -20,12 +20,14 @@ "pattern": "specified in test/unit/coverage.js" }, "supported_es_branches": [ - "master", - "1.x", "1.1", "1.0", "0.90" ], + "unstable_es_branches": [ + "master", + "1.x" + ], "default_api_branch": "1.1" }, "devDependencies": { diff --git a/scripts/generate/index.js b/scripts/generate/index.js index 0edcc1b4c..d1f5b9ae9 100644 --- a/scripts/generate/index.js +++ b/scripts/generate/index.js @@ -93,7 +93,8 @@ function initStep() { } function fetchBranchesStep() { - return spawnStep('git', ['fetch', '--no-tags', 'origin'].concat(branches.map(function (b) { return b + ':' + b; })), sourceDir); + var branchArgs = branches.map(function (b) { return b + ':' + b; }); + return spawnStep('git', ['fetch', '--no-tags', '--force', 'origin'].concat(branchArgs), sourceDir); } function removePrevArchive(branch) { @@ -121,7 +122,10 @@ function generateStep(branch) { async.parallel([ argv.api && async.apply(require('./js_api'), branch), argv.tests && async.apply(require('./yaml_tests'), branch) - ].filter(Boolean), done); + ].filter(Boolean), function () { + console.log('----\n'); + done(); + }); }; } diff --git a/scripts/generate/js_api.js b/scripts/generate/js_api.js index d40e8159d..48b3051e2 100644 --- a/scripts/generate/js_api.js +++ b/scripts/generate/js_api.js @@ -27,16 +27,22 @@ module.exports = function (branch, done) { aliases = require('./aliases'); } - // generate the API - async.series([ + var steps = [ readSpecFiles, parseSpecFiles, - writeApiFile, - ensureDocsDir, - formatDocVars, - writeMethodDocs - ], function (err) { - console.log(''); + writeApiFile + ]; + + if (!~utils.unstableBranches.indexOf(branch)) { + steps.push( + ensureDocsDir, + formatDocVars, + writeMethodDocs + ); + } + + // generate the API + async.series(steps, function (err) { done(err); });