seperated stable and unstable branches so that docs are not generated for the unstable ones
This commit is contained in:
@ -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
|
||||
branches: [].concat(stable, unstable),
|
||||
stableBranches: stable,
|
||||
unstableBranches: unstable
|
||||
};
|
||||
|
||||
utils.branches._default = pkg.config.default_api_branch;
|
||||
|
||||
module.exports = utils;
|
||||
@ -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": {
|
||||
|
||||
@ -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();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -27,16 +27,22 @@ module.exports = function (branch, done) {
|
||||
aliases = require('./aliases');
|
||||
}
|
||||
|
||||
// generate the API
|
||||
async.series([
|
||||
var steps = [
|
||||
readSpecFiles,
|
||||
parseSpecFiles,
|
||||
writeApiFile,
|
||||
writeApiFile
|
||||
];
|
||||
|
||||
if (!~utils.unstableBranches.indexOf(branch)) {
|
||||
steps.push(
|
||||
ensureDocsDir,
|
||||
formatDocVars,
|
||||
writeMethodDocs
|
||||
], function (err) {
|
||||
console.log('');
|
||||
);
|
||||
}
|
||||
|
||||
// generate the API
|
||||
async.series(steps, function (err) {
|
||||
done(err);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user