@@ -3,6 +3,7 @@ var connect = require('gulp-connect');
33var wiredep = require ( 'wiredep' ) . stream ;
44var $ = require ( 'gulp-load-plugins' ) ( ) ;
55var del = require ( 'del' ) ;
6+ var addsrc = require ( 'gulp-add-src' ) ;
67var jsReporter = require ( 'jshint-stylish' ) ;
78var annotateAdfPlugin = require ( 'ng-annotate-adf-plugin' ) ;
89var pkg = require ( './package.json' ) ;
@@ -13,10 +14,14 @@ var annotateOptions = {
1314 ]
1415} ;
1516
16- var templateOptions = {
17+ var redmineTemplate = {
1718 root : '{widgetsPath}/redmine/src/main' ,
1819 module : 'adf.widget.redmine'
1920} ;
21+ var easyRedmineTemplate = {
22+ root : '{widgetsPath}/redmine/src/main' ,
23+ module : 'adf.widget.easyredmine'
24+ } ;
2025
2126/** lint **/
2227
@@ -36,13 +41,19 @@ gulp.task('lint', ['csslint', 'jslint']);
3641
3742/** serve **/
3843
39- gulp . task ( 'templates ' , function ( ) {
40- return gulp . src ( 'src/**/*.html' )
41- . pipe ( $ . angularTemplatecache ( 'templates .tpl.js' , templateOptions ) )
42- . pipe ( gulp . dest ( '.tmp/dist' ) ) ;
44+ gulp . task ( 'redmineTemplate ' , function ( ) {
45+ return gulp . src ( 'src/main/ **/*.html' )
46+ . pipe ( $ . angularTemplatecache ( 'redmineTemplates .tpl.js' , redmineTemplate ) )
47+ . pipe ( gulp . dest ( '.tmp/dist' ) ) ;
4348} ) ;
4449
45- gulp . task ( 'sample' , [ 'templates' ] , function ( ) {
50+ gulp . task ( 'easyRedmineTemplate' , function ( ) {
51+ return gulp . src ( 'src/main/**/*.html' )
52+ . pipe ( $ . angularTemplatecache ( 'easyRedmineTemplates.tpl.js' , easyRedmineTemplate ) )
53+ . pipe ( gulp . dest ( '.tmp/dist' ) ) ;
54+ } ) ;
55+
56+ gulp . task ( 'sample' , [ 'redmineTemplate' , 'easyRedmineTemplate' ] , function ( ) {
4657 var files = gulp . src ( [ 'src/main/**/*.js' , 'src/main/**/*.css' , 'src/main/**/*.less' , '.tmp/dist/*.js' ] )
4758 . pipe ( $ . if ( '*.js' , $ . angularFilesort ( ) ) ) ;
4859
@@ -85,7 +96,10 @@ gulp.task('css', function(){
8596gulp . task ( 'js' , function ( ) {
8697 gulp . src ( [ 'src/main/**/*.js' , 'src/main/**/*.html' ] )
8798 . pipe ( $ . if ( '*.html' , $ . minifyHtml ( ) ) )
88- . pipe ( $ . if ( '*.html' , $ . angularTemplatecache ( pkg . name + '.tpl.js' , templateOptions ) ) )
99+ . pipe ( $ . if ( '*.html' , $ . angularTemplatecache ( pkg . name + '.js' , redmineTemplate ) ) )
100+ . pipe ( addsrc ( 'src/main/**/*.html' ) ) //Add again for easyredmine as angularTemplatecache purges all html files from the pipe
101+ . pipe ( $ . if ( '*.html' , $ . minifyHtml ( ) ) )
102+ . pipe ( $ . if ( '*.html' , $ . angularTemplatecache ( 'adf-widget-redmine.js' , easyRedmineTemplate ) ) )
89103 . pipe ( $ . angularFilesort ( ) )
90104 . pipe ( $ . if ( '*.js' , $ . replace ( / ' u s e s t r i c t ' ; / g, '' ) ) )
91105 . pipe ( $ . concat ( pkg . name + '.js' ) )
0 commit comments