Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
459 changed files
with
47,774 additions
and
28,216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'), | ||
rev = require('gulp-rev'), | ||
plumber = require('gulp-plumber'), | ||
es = require('event-stream'), | ||
flatten = require('gulp-flatten'), | ||
replace = require('gulp-replace'), | ||
bowerFiles = require('main-bower-files'), | ||
changed = require('gulp-changed'); | ||
|
||
var handleErrors = require('./handle-errors'); | ||
var config = require('./config'); | ||
|
||
module.exports = { | ||
i18n: i18n, | ||
languages: languages, | ||
fonts: fonts, | ||
common: common, | ||
swagger: swagger, | ||
images: images | ||
} | ||
|
||
var yorc = require('../.yo-rc.json')['generator-jhipster']; | ||
|
||
function i18n() { | ||
return gulp.src(config.app + 'i18n/**') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.dist + 'i18n/')) | ||
.pipe(gulp.dest(config.dist + 'i18n/')); | ||
} | ||
|
||
function languages() { | ||
var locales = yorc.languages.map(function (locale) { | ||
return config.bower + 'angular-i18n/angular-locale_' + locale + '.js'; | ||
}); | ||
return gulp.src(locales) | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.app + 'i18n/')) | ||
.pipe(gulp.dest(config.app + 'i18n/')); | ||
} | ||
|
||
function fonts() { | ||
return es.merge(gulp.src(config.bower + 'bootstrap/fonts/*.*') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.dist + 'content/fonts/')) | ||
.pipe(rev()) | ||
.pipe(gulp.dest(config.dist + 'content/fonts/')) | ||
.pipe(rev.manifest(config.revManifest, { | ||
base: config.dist, | ||
merge: true | ||
})) | ||
.pipe(gulp.dest(config.dist)), | ||
gulp.src(config.app + 'content/**/*.{woff,woff2,svg,ttf,eot,otf}') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.dist + 'content/fonts/')) | ||
.pipe(flatten()) | ||
.pipe(rev()) | ||
.pipe(gulp.dest(config.dist + 'content/fonts/')) | ||
.pipe(rev.manifest(config.revManifest, { | ||
base: config.dist, | ||
merge: true | ||
})) | ||
.pipe(gulp.dest(config.dist)) | ||
); | ||
} | ||
|
||
function common() { | ||
return gulp.src([config.app + 'robots.txt', config.app + 'favicon.ico', config.app + '.htaccess'], { dot: true }) | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.dist)) | ||
.pipe(gulp.dest(config.dist)); | ||
} | ||
|
||
function swagger() { | ||
return es.merge( | ||
gulp.src([config.bower + 'swagger-ui/dist/**', | ||
'!' + config.bower + 'swagger-ui/dist/index.html', | ||
'!' + config.bower + 'swagger-ui/dist/swagger-ui.min.js', | ||
'!' + config.bower + 'swagger-ui/dist/swagger-ui.js']) | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.swaggerDist)) | ||
.pipe(gulp.dest(config.swaggerDist)), | ||
gulp.src(config.app + 'swagger-ui/index.html') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.swaggerDist)) | ||
.pipe(replace('../bower_components/swagger-ui/dist/', '')) | ||
.pipe(replace('swagger-ui.js', 'lib/swagger-ui.min.js')) | ||
.pipe(gulp.dest(config.swaggerDist)), | ||
gulp.src(config.bower + 'swagger-ui/dist/swagger-ui.min.js') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.swaggerDist + 'lib/')) | ||
.pipe(gulp.dest(config.swaggerDist + 'lib/')) | ||
); | ||
} | ||
|
||
function images() { | ||
return gulp.src(bowerFiles({filter: ['**/*.{gif,jpg,png}']}), { base: config.bower }) | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(changed(config.dist + 'bower_components')) | ||
.pipe(gulp.dest(config.dist + 'bower_components')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
var notify = require("gulp-notify"); | ||
var argv = require('yargs').argv; | ||
|
||
module.exports = function() { | ||
|
||
var args = Array.prototype.slice.call(arguments); | ||
var notification = argv.notification === undefined ? true : argv.notification; | ||
// Send error to notification center with gulp-notify | ||
if(notification) { | ||
notify.onError({ | ||
title: "JHipster Gulp Build", | ||
subtitle: "Failure!", | ||
message: "Error: <%= error.message %>", | ||
sound: "Beep" | ||
}).apply(this, args); | ||
} | ||
// Keep gulp from hanging on this task | ||
this.emit('end'); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'), | ||
plumber = require('gulp-plumber'), | ||
inject = require('gulp-inject'), | ||
es = require('event-stream'), | ||
naturalSort = require('gulp-natural-sort'), | ||
angularFilesort = require('gulp-angular-filesort'), | ||
bowerFiles = require('main-bower-files'); | ||
|
||
var handleErrors = require('./handle-errors'); | ||
|
||
var config = require('./config'); | ||
|
||
module.exports = { | ||
app: app, | ||
vendor: vendor, | ||
test: test, | ||
troubleshoot: troubleshoot | ||
} | ||
|
||
function app() { | ||
return gulp.src(config.app + 'index.html') | ||
.pipe(inject(gulp.src(config.app + 'app/**/*.js') | ||
.pipe(naturalSort()) | ||
.pipe(angularFilesort()), {relative: true})) | ||
.pipe(gulp.dest(config.app)); | ||
} | ||
|
||
function vendor() { | ||
var stream = gulp.src(config.app + 'index.html') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(inject(gulp.src(bowerFiles(), {read: false}), { | ||
name: 'bower', | ||
relative: true | ||
})) | ||
.pipe(gulp.dest(config.app)); | ||
|
||
return stream; | ||
} | ||
|
||
function test() { | ||
return gulp.src(config.test + 'karma.conf.js') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
.pipe(inject(gulp.src(bowerFiles({includeDev: true, filter: ['**/*.js']}), {read: false}), { | ||
starttag: '// bower:js', | ||
endtag: '// endbower', | ||
transform: function (filepath) { | ||
return '\'' + filepath.substring(1, filepath.length) + '\','; | ||
} | ||
})) | ||
.pipe(gulp.dest(config.test)); | ||
} | ||
|
||
function troubleshoot() { | ||
/* this task removes the troubleshooting content from index.html*/ | ||
return gulp.src(config.app + 'index.html') | ||
.pipe(plumber({errorHandler: handleErrors})) | ||
/* having empty src as we dont have to read any files*/ | ||
.pipe(inject(gulp.src('', {read: false}), { | ||
starttag: '<!-- inject:troubleshoot -->', | ||
removeTags: true, | ||
transform: function () { | ||
return '<!-- Angular views -->'; | ||
} | ||
})) | ||
.pipe(gulp.dest(config.app)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'), | ||
util = require('./utils'), | ||
url = require('url'), | ||
|
Oops, something went wrong.