Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7B7D9200CBD for ; Thu, 6 Jul 2017 08:39:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 78198165835; Thu, 6 Jul 2017 06:39:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BC5D816582C for ; Thu, 6 Jul 2017 08:39:27 +0200 (CEST) Received: (qmail 11701 invoked by uid 500); 6 Jul 2017 06:39:26 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 11692 invoked by uid 99); 6 Jul 2017 06:39:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jul 2017 06:39:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A7E7FE112D; Thu, 6 Jul 2017 06:39:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: acosentino@apache.org To: commits@camel.apache.org Date: Thu, 06 Jul 2017 06:39:26 -0000 Message-Id: <26970ffac06f4c86bbd70219a28610dc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/7] camel git commit: CAMEL-11492 New Camel website archived-at: Thu, 06 Jul 2017 06:39:28 -0000 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 Authored: Mon Jul 3 23:42:35 2017 +0200 Committer: Andrea Cosentino 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(); + }); +});