Skip to content

Commit

Permalink
Merge adc135c into d70411c
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed May 20, 2016
2 parents d70411c + adc135c commit 1db8272
Show file tree
Hide file tree
Showing 19 changed files with 1,803 additions and 800 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
web/bundles/*
web/css/*
web/js/*
web/fonts/*
web/img/*
app/bootstrap.php.cache
app/cache/*
app/logs/*
Expand All @@ -12,9 +14,8 @@ web/uploads/*
!web/uploads/.gitkeep
!web/js/.gitkeep
!web/css/.gitkeep
!web/fonts/.gitkeep
!web/img/.gitkeep
app/config/parameters.yml
/.idea
web/js/fos_js_routes.js
web/js/require-config.js
web/js/hbs-templates.js
node_modules
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ before_install:

install:
- composer install --prefer-source -n
- npm install
- sed -i 's/base_url:\ null/base_url:\ http:\/\/localhost/g' app/config/parameters.yml
- php app/console cache:clear
- php app/console assets:install -n
- php app/console assetic:dump -n

before_script:
- npm install -g gulp
- mysql -e 'create database csbill;'
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm"* ]]; then echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
- php app/check.php
Expand All @@ -39,6 +41,7 @@ before_script:
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
- if [[ "$SAUCE_USERNAME" ]]; then bash travis/sauce.sh; fi;
- gulp

script:
- composer validate
Expand Down
85 changes: 85 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
var gulp = require('gulp'),

$ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'main-bower-files', 'del']
}),

glob = require("glob"),

options = {
less: 'web/bundles/csbill*/less',
css: 'web/bundles/csbill*/css',
images: 'web/bundles/csbill*/img/*'
};

gulp.task('fonts', function() {
return gulp.src('web/bundles/**/fonts/*')
.pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}'))
.pipe($.flatten())
.pipe(gulp.dest('web/fonts/'));
});

gulp.task('images', function() {
return gulp.src(options.images)
.pipe($.filter('**/*.{png,gif,jpg,jpeg}'))
.pipe($.flatten())
.pipe(gulp.dest('web/img/'));
});

gulp.task('clean', function() {
$.del(['web/css/**', '!web/css', '!web/css/.gitkeep']);
$.del(['web/fonts/**', '!web/fonts', '!web/fonts/.gitkeep']);
});

gulp.task('css:app', function() {
var lessOptions = {
'paths': glob.sync(options.less)
};

var files = [
'web/bundles/csbillcore/less/bootstrap/bootstrap.less',
'web/bundles/csbillcore/less/material/material.less',
'web/bundles/csbillcore/less/font-awesome/font-awesome.less',
options.less + '/*.less',
options.css + '/*.css',
'!' + options.less + '/email.less'
];

return gulp.src(files)
.pipe($.filter('**/*.{css,less}'))
.pipe($.flatten())
.pipe($.less(lessOptions))
.pipe($.cssmin())
.pipe($.concat('app.css'))
.pipe(gulp.dest('web/css/'))
;
});

gulp.task('css:email', function() {
var lessOptions = {
'paths': glob.sync(options.less)
};

var files = [options.less + '/email.less'];

return gulp.src(files)
.pipe($.filter('**/*.{css,less}'))
.pipe($.flatten())
.pipe($.less(lessOptions))
.pipe($.cssmin())
.pipe($.concat('email.css'))
.pipe(gulp.dest('web/css/'))
;
});

gulp.task('css', ['css:app', 'css:email']);

gulp.task('watch', ['css'], function() {
gulp.watch([options.less + '/*', options.css + '/*'], ['css']);
});

gulp.task('default', ['clean'], function() {
gulp.start('css');
gulp.start('fonts');
gulp.start('images');
});
Loading

0 comments on commit 1db8272

Please sign in to comment.