From b6916ac93989aac68eb1c584ee703f1d369bfb8b Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 29 Mar 2016 18:00:48 -0300 Subject: [PATCH] Build dist for all themes --- gulp/build.js | 2 +- gulp/conf.js | 10 ++++++---- index.html.erb | 2 +- package.json | 4 ++++ themes/default/.keep | 0 5 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 themes/default/.keep diff --git a/gulp/build.js b/gulp/build.js index ea7ec80..3f06a2b 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -3,7 +3,7 @@ var path = require('path'); var gulp = require('gulp'); var conf = require('./conf'); -var noosferoThemePrefix = "/designs/themes/angular-theme/dist/"; +var noosferoThemePrefix = path.join("/designs/themes/angular-theme", conf.paths.dist, '/'); var $ = require('gulp-load-plugins')({ pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del'] diff --git a/gulp/conf.js b/gulp/conf.js index ea681bc..4c62fca 100644 --- a/gulp/conf.js +++ b/gulp/conf.js @@ -19,12 +19,14 @@ exports.paths = { tmp: '.tmp', e2e: 'e2e', docs: 'docs', - theme: argv.theme ? path.join('themes', argv.theme) : null + themes: 'themes' }; -exports.paths.allSources = [exports.paths.src]; -if(exports.paths.theme) { - exports.paths.allSources.push(exports.paths.theme); +exports.configTheme = function(theme) { + exports.paths.theme = path.join(exports.paths.themes, theme || "default"); + exports.paths.allSources = [exports.paths.src, exports.paths.theme]; + exports.paths.dist = path.join("dist", exports.paths.theme); } +exports.configTheme(argv.theme); /** * Wiredep is the lib which inject bower dependencies in your project diff --git a/index.html.erb b/index.html.erb index dc972b6..b0f939d 120000 --- a/index.html.erb +++ b/index.html.erb @@ -1 +1 @@ -dist/index.html \ No newline at end of file +dist/themes/default/index.html \ No newline at end of file diff --git a/package.json b/package.json index e3fb2ff..88a0cd4 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,12 @@ "moment": "^2.11.2", "ng-forward": "0.0.1-alpha.12" }, + "config": { + "theme": "default" + }, "scripts": { "build": "webpack; gulp clean && gulp --theme=$npm_package_config_theme build", + "build-all": "gulp clean && for d in ./themes/* ; do (gulp --theme=`basename $d` build); done", "webpack": "webpack", "karma": "concurrently \"webpack -w\" \"karma start\"", "docs": "gulp ngdocs; static-server docs", diff --git a/themes/default/.keep b/themes/default/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/themes/default/.keep -- libgit2 0.21.2