]> source.dussan.org Git - vaadin-core.git/commitdiff
Publish asciidocs from combo-box, upload, date-picker.
authorSauli Tähkäpää <sauli@vaadin.com>
Mon, 7 Mar 2016 09:32:05 +0000 (11:32 +0200)
committerTeemu Pöntelin <teemu@vaadin.com>
Wed, 27 Apr 2016 08:14:53 +0000 (11:14 +0300)
package.json
tasks/docsite.js

index d64af086da5600c851c4fed15124453f6ad8138e..e3eaa2785b1edd2b85e5a7141274590e94cdd853 100644 (file)
@@ -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",
index 38888081295ee29808d860edae53383bdb3d96d0..9f394333aa7c0255e4be2d21efb2023266297b1c 100644 (file)
@@ -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)