mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Format gulpfile.
This commit is contained in:
parent
c1b4dc4af5
commit
ea0ec88b1f
1 changed files with 18 additions and 22 deletions
40
gulpfile.js
40
gulpfile.js
|
@ -10,12 +10,12 @@ var clean = require('gulp-clean')
|
||||||
|
|
||||||
gulp.task('jshint', function () {
|
gulp.task('jshint', function () {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'lib/**/*.js'
|
'lib/**/*.js'
|
||||||
, 'res/app/**/*.js'
|
, 'res/app/**/*.js'
|
||||||
, 'res/auth-ldap/**/*.js'
|
, 'res/auth-ldap/**/*.js'
|
||||||
, 'res/auth-mock/**/*.js'
|
, 'res/auth-mock/**/*.js'
|
||||||
, '*.js'
|
, '*.js'
|
||||||
])
|
])
|
||||||
.pipe(jshint())
|
.pipe(jshint())
|
||||||
.pipe(jshint.reporter('jshint-stylish'))
|
.pipe(jshint.reporter('jshint-stylish'))
|
||||||
})
|
})
|
||||||
|
@ -34,9 +34,7 @@ gulp.task('jsonlint', function () {
|
||||||
|
|
||||||
gulp.task('lint', ['jshint', 'jsonlint'])
|
gulp.task('lint', ['jshint', 'jsonlint'])
|
||||||
gulp.task('test', ['lint'])
|
gulp.task('test', ['lint'])
|
||||||
|
gulp.task('build', ['translate', 'webpack:build'])
|
||||||
gulp.task('build', ['translate', 'webpack:build'], function () {
|
|
||||||
})
|
|
||||||
|
|
||||||
// For production
|
// For production
|
||||||
gulp.task("webpack:build", function (callback) {
|
gulp.task("webpack:build", function (callback) {
|
||||||
|
@ -63,38 +61,36 @@ gulp.task("webpack:build", function (callback) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('translate', ['jade', 'translate:extract', 'translate:compile'],
|
gulp.task('translate', ['jade', 'translate:extract', 'translate:compile'])
|
||||||
function () {
|
|
||||||
})
|
|
||||||
|
|
||||||
gulp.task('jade', function (callback) {
|
gulp.task('jade', function () {
|
||||||
gulp.src(['./res/**/*.jade', '!./res/bower_components/**'])
|
return gulp.src([
|
||||||
|
'./res/**/*.jade'
|
||||||
|
, '!./res/bower_components/**'
|
||||||
|
])
|
||||||
.pipe(jade())
|
.pipe(jade())
|
||||||
.pipe(gulp.dest('./tmp/html/'))
|
.pipe(gulp.dest('./tmp/html/'))
|
||||||
|
|
||||||
callback()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('translate:extract', function (callback) {
|
gulp.task('translate:extract', function () {
|
||||||
gulp.src(['./tmp/html/**/*.html', './res/**/*.js',
|
return gulp.src([
|
||||||
'!./res/bower_components/**'])
|
'./tmp/html/**/*.html'
|
||||||
|
, './res/**/*.js'
|
||||||
|
, '!./res/bower_components/**'
|
||||||
|
])
|
||||||
.pipe(gettext.extract('stf.pot'))
|
.pipe(gettext.extract('stf.pot'))
|
||||||
.pipe(gulp.dest('./res/common/lang/po/'))
|
.pipe(gulp.dest('./res/common/lang/po/'))
|
||||||
|
|
||||||
callback()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('translate:compile', function (callback) {
|
gulp.task('translate:compile', function () {
|
||||||
gulp.src('./res/common/lang/po/**/*.po')
|
return gulp.src('./res/common/lang/po/**/*.po')
|
||||||
.pipe(gettext.compile({
|
.pipe(gettext.compile({
|
||||||
format: 'json'
|
format: 'json'
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('./res/common/lang/translations/'))
|
.pipe(gulp.dest('./res/common/lang/translations/'))
|
||||||
|
|
||||||
callback()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('clean', function () {
|
gulp.task('clean', function () {
|
||||||
gulp.src('./tmp', {read: false})
|
return gulp.src('./tmp', {read: false})
|
||||||
.pipe(clean())
|
.pipe(clean())
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue