cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Koudritsky <>
Subject Cordova workflows based on build systems / task runners
Date Wed, 13 Aug 2014 22:18:50 GMT
Hi all,

Inspired by several recent conversations on this mailing list I've been
thinking about a Cordova workflow based on some build system. As an
experiment I've put together this  app using Gulp and cordova-lib:

To try it out
git clone
cd CordovaGulpTemplate
npm install
npm install gulp -g  # if you don't yet have gulp installed.
gulp recreate
gulp build|emulate|run

The important files are:
  * package.json
  * gulpfile.js
  * src/config.xml (the cordova config.xml)
  * src/www/  (copied as is from the default cordova www template)
The whole cordova project dir is treated as a build artifact. It lives
under ./build (ignored by git and nuked by "gulp clean").

Some benefits of this workflow:
 - Cordova can blend in as just another tool in the app workflow alongside
stuff like Sass, template and CoffeeScript/Dart preprocessing etc.
 - Can use any folder structure under ./src, the cordova project structure
is created under ./build by linking or copying from ./src (or by filtering
via transpilers).
 - Platforms are listed as app dependencies in package.json. As a result,
npm downloads them and platform version preferences are set just like with
any npm deps. (plugins are not treated this way, see comments in gulpfile).
 - No need to programmatically edit config.xml to store platform list.
 - As a bonus, people disliking XML can make a simple Gulp plugin that
would generate Cordova's config.xml from a more human friendly
json/yaml/ini/whatever file ;)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message