camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/7] camel git commit: CAMEL-11492 New Camel website
Date Thu, 06 Jul 2017 06:39:26 GMT
Repository: camel
Updated Branches:
  refs/heads/master 7c3064460 -> 7830a250a


CAMEL-11492 New Camel website

Improve gulp watch task to take into account only changed files and
reuse the pipe from the component tasks.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f8b992e3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f8b992e3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f8b992e3

Branch: refs/heads/master
Commit: f8b992e3c130adf08104fdd91a932a293bc6a274
Parents: 4c608ba
Author: Zoran Regvart <zregvart@apache.org>
Authored: Mon Jul 3 23:42:35 2017 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Thu Jul 6 08:37:29 2017 +0200

----------------------------------------------------------------------
 camel-website/gulpfile.js | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f8b992e3/camel-website/gulpfile.js
----------------------------------------------------------------------
diff --git a/camel-website/gulpfile.js b/camel-website/gulpfile.js
index 75b7ed5..5b36839 100644
--- a/camel-website/gulpfile.js
+++ b/camel-website/gulpfile.js
@@ -21,16 +21,23 @@ const replace = require('gulp-replace');
 
 const version = process.env.npm_package_version.replace(/-.*/, '');
 
-gulp.task('docs', ['component-doc']);
-
-gulp.task('component-doc', () => {
-  gulp.src('../components/readme.adoc')
-    .pipe(replace(/link:.*\/(.*).adoc(\[.*)/g, `link:components/${version}/$1$2`))
-    .pipe(rename('components.adoc'))
-    .pipe(gulp.dest('content'));
-  gulp.src('../components/**/src/main/docs/*.adoc')
-    .pipe(rename({dirname: ''}))
-    .pipe(gulp.dest(`content/components/${version}`));
+gulp.task('docs', ['components-readme', 'components']);
+
+const components = (path) => gulp.src(path || '../components/**/src/main/docs/*.adoc')
+  .pipe(rename({dirname: ''}))
+  .pipe(gulp.dest(`content/components/${version}`));
+
+gulp.task('components', () => {
+  return components();
+});
+
+const componentReadme = () => gulp.src('../components/readme.adoc')
+  .pipe(replace(/link:.*\/(.*).adoc(\[.*)/g, `link:components/${version}/$1$2`))
+  .pipe(rename('components.adoc'))
+  .pipe(gulp.dest('content'));
+
+gulp.task('components-readme', () => {
+  return componentReadme();
 });
 
 gulp.task('asciidoctor-shim', () => {
@@ -43,6 +50,11 @@ gulp.task('asciidoctor-shim', () => {
 gulp.task('default', ['docs', 'asciidoctor-shim']);
 
 gulp.task('watch', () => {
-  gulp.watch('../**/*.adoc', ['docs']);
-});
+  gulp.watch(['../components/**/*.adoc', '!../components/readme.adoc'], (event) => {
+    components(event.path);
+  });
 
+  gulp.watch('../components/readme.adoc', (event) => {
+    componentReadme();
+  });
+});


Mime
View raw message