aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package.json8
-rw-r--r--tasks/docsite.js33
2 files changed, 27 insertions, 14 deletions
diff --git a/package.json b/package.json
index d64af08..e3eaa27 100644
--- a/package.json
+++ b/package.json
@@ -8,15 +8,15 @@
"bower": "latest",
"fs-extra": "latest",
"gulp": "latest",
+ "gulp-add-src": "latest",
"gulp-git": "latest",
"gulp-json-editor": "latest",
"gulp-markdown": "^1.0.0",
- "gulp-rename": "latest",
+ "gulp-modify": "^0.1.1",
+ "gulp-rename": "^1.2.2",
"gulp-replace": "latest",
"gulp-util": "latest",
- "yargs": "latest",
- "gulp-modify": "^0.1.1",
- "gulp-add-src": "latest"
+ "yargs": "latest"
},
"devDependencies": {
"chalk": "latest",
diff --git a/tasks/docsite.js b/tasks/docsite.js
index 3888808..9f39433 100644
--- a/tasks/docsite.js
+++ b/tasks/docsite.js
@@ -8,6 +8,7 @@ var gutil = require('gulp-util');
var zip = require('gulp-zip');
var args = require('yargs').argv;
var addsrc = require('gulp-add-src');
+var rename = require('gulp-rename');
var stagingBasePath = config.paths.staging.cdn;
var docPath = config.paths.staging.doc;
@@ -49,17 +50,23 @@ gulp.task('cdn:docsite:core-elements-integrations', function() {
return getDocModifyTask('demo/**', docPath + '/integrations');
});
-var doctasks = ['cdn:docsite:core-elements', 'cdn:docsite:core-elements-integrations'];
+gulp.task('cdn:docsite:core-elements-elements', ['cdn:docsite:bower_components'], function() {
+ var docsPaths = config.coreElements.map(function(c) {
+ return stagingPath + '/' + c + '/docs/**';
+ });
-config.coreElements.forEach(function (n) {
- var task = 'cdn:docsite:' + n;
- doctasks.push(task);
- gulp.task(task, ['cdn:docsite:bower_components'], function(done) {
- var elementDocsite = docPath + '/' + n;
- var elementDemo = stagingPath + '/' + n + '/demo/**';
+ return gulp.src(docsPaths, {base: stagingPath})
+ .pipe(rename(function (path) {
+ path.dirname = path.dirname.replace('/docs', '/'); //leaves docs folders empty.
+ }))
+ .pipe(gulp.dest(docPath + '/'));
+});
- return getDocModifyTask(elementDemo, elementDocsite, n);
- });
+gulp.task('cdn:docsite:vaadin-grid', ['cdn:docsite:bower_components'], function(done) {
+ var elementDocsite = docPath + '/vaadin-grid';
+ var elementDemo = stagingPath + '/vaadin-grid/demo/**';
+
+ return getDocModifyTask(elementDemo, elementDocsite, 'vaadin-grid');
});
function getDocModifyTask(sourceFiles, targetFolder, n) {
@@ -104,7 +111,13 @@ function getDocModifyTask(sourceFiles, targetFolder, n) {
.pipe(gulp.dest(targetFolder));
}
-gulp.task('cdn:docsite:zip', doctasks, function() {
+gulp.task('cdn:docsite:stage', ['cdn:docsite:core-elements',
+ 'cdn:docsite:core-elements-elements',
+ //separate task for vaadin-grid until it uses asciidocs
+ 'cdn:docsite:vaadin-grid',
+ 'cdn:docsite:core-elements-integrations']);
+
+gulp.task('cdn:docsite:zip', ['cdn:docsite:stage'], function() {
var src = docPath + '/**/*';
gutil.log("Creating docsite zip " + docPath + " -> " + rootZip + fileZip);
return gulp.src(src)