run bower during maven build

This commit is contained in:
Athou
2015-01-05 14:56:31 +01:00
parent 06151eab3b
commit 04c0833111
3 changed files with 16 additions and 18 deletions

View File

@@ -4,7 +4,6 @@ var revReplace = require('gulp-rev-replace');
var minifyCSS = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var filter = require('gulp-filter');
var bower = require('gulp-bower');
var connect = require('gulp-connect');
var modRewrite = require('connect-modrewrite');
var sass = require('gulp-sass');
@@ -15,16 +14,6 @@ var SRC_DIR = 'src/main/app/';
var TEMP_DIR = 'target/gulp/'
var BUILD_DIR = 'target/classes/assets/';
gulp.task('bower_prune', function() {
return bower({
cmd : 'prune'
});
});
gulp.task('bower', ['bower_prune'], function() {
return bower();
});
gulp.task('images', function() {
return gulp.src(SRC_DIR + 'images/**/*').pipe(gulp.dest(BUILD_DIR + 'images'));
});
@@ -44,20 +33,20 @@ gulp.task('sass', function() {
return gulp.src(SRC_DIR + 'sass/app.scss').pipe(sass()).pipe(gulp.dest(TEMP_DIR + 'css'));
});
gulp.task('fonts', ['bower'], function() {
gulp.task('fonts', function() {
var font_awesome = SRC_DIR + 'lib/font-awesome/font/fontawesome-webfont.*';
var zocial = SRC_DIR + 'lib/zocial-less/css/zocial-regular-*';
var readabilicons = SRC_DIR + 'lib/readabilicons/webfont/fonts/readabilicons-*';
return gulp.src([font_awesome, zocial, readabilicons]).pipe(gulp.dest(BUILD_DIR + 'font'));
});
gulp.task('select2', ['bower'], function() {
gulp.task('select2', function() {
var gif = SRC_DIR + 'lib/select2/*.gif';
var png = SRC_DIR + 'lib/select2/*.png';
return gulp.src([gif, png]).pipe(gulp.dest(BUILD_DIR + 'css'));
});
gulp.task('swagger-ui', ['bower'], function() {
gulp.task('swagger-ui', function() {
var index_html = SRC_DIR + 'api/index.html';
var lib = SRC_DIR + 'lib/swagger-ui/dist/**/*';
return gulp.src([lib, index_html]).pipe(gulp.dest(BUILD_DIR + 'api'));
@@ -71,7 +60,7 @@ gulp.task('template-cache', function() {
return gulp.src(SRC_DIR + 'templates/**/*.html').pipe(templateCache(options)).pipe(gulp.dest(TEMP_DIR + 'js'));
});
gulp.task('build-dev', ['images', 'i18n', 'favicons', 'sass', 'fonts', 'select2', 'swagger-ui', 'template-cache', 'bower'], function() {
gulp.task('build-dev', ['images', 'i18n', 'favicons', 'sass', 'fonts', 'select2', 'swagger-ui', 'template-cache'], function() {
var assets = useref.assets({
searchPath : [SRC_DIR, TEMP_DIR]
});
@@ -81,7 +70,7 @@ gulp.task('build-dev', ['images', 'i18n', 'favicons', 'sass', 'fonts', 'select2'
revReplace()).pipe(gulp.dest(BUILD_DIR)).pipe(connect.reload());
});
gulp.task('build', ['images', 'i18n', 'favicons', 'sass', 'fonts', 'select2', 'swagger-ui', 'template-cache', 'bower'], function() {
gulp.task('build', ['images', 'i18n', 'favicons', 'sass', 'fonts', 'select2', 'swagger-ui', 'template-cache'], function() {
var assets = useref.assets({
searchPath : [SRC_DIR, TEMP_DIR]
});

View File

@@ -4,13 +4,13 @@
"main": "main.js",
"private": true,
"devDependencies": {
"bower": "1.3.12",
"gulp": "3.8.10",
"gulp-rev": "2.0.1",
"gulp-rev-replace": "0.3.1",
"gulp-minify-css": "0.3.11",
"gulp-uglify": "1.0.2",
"gulp-filter": "1.0.2",
"gulp-bower": "0.0.7",
"gulp-connect": "2.2.0",
"connect-modrewrite": "0.7.9",
"gulp-sass": "1.2.4",

11
pom.xml
View File

@@ -99,7 +99,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.19</version>
<version>0.0.20</version>
<executions>
<execution>
<id>install node and npm</id>
@@ -119,6 +119,15 @@
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>gulp build</id>
<goals>