@@ -3,6 +3,7 @@ var connect = require('gulp-connect');
3
3
var wiredep = require ( 'wiredep' ) . stream ;
4
4
var $ = require ( 'gulp-load-plugins' ) ( ) ;
5
5
var del = require ( 'del' ) ;
6
+ var addsrc = require ( 'gulp-add-src' ) ;
6
7
var jsReporter = require ( 'jshint-stylish' ) ;
7
8
var annotateAdfPlugin = require ( 'ng-annotate-adf-plugin' ) ;
8
9
var pkg = require ( './package.json' ) ;
@@ -13,10 +14,14 @@ var annotateOptions = {
13
14
]
14
15
} ;
15
16
16
- var templateOptions = {
17
+ var redmineTemplate = {
17
18
root : '{widgetsPath}/redmine/src/main' ,
18
19
module : 'adf.widget.redmine'
19
20
} ;
21
+ var easyRedmineTemplate = {
22
+ root : '{widgetsPath}/redmine/src/main' ,
23
+ module : 'adf.widget.easyredmine'
24
+ } ;
20
25
21
26
/** lint **/
22
27
@@ -36,13 +41,19 @@ gulp.task('lint', ['csslint', 'jslint']);
36
41
37
42
/** serve **/
38
43
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' ) ) ;
43
48
} ) ;
44
49
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 ( ) {
46
57
var files = gulp . src ( [ 'src/main/**/*.js' , 'src/main/**/*.css' , 'src/main/**/*.less' , '.tmp/dist/*.js' ] )
47
58
. pipe ( $ . if ( '*.js' , $ . angularFilesort ( ) ) ) ;
48
59
@@ -85,7 +96,10 @@ gulp.task('css', function(){
85
96
gulp . task ( 'js' , function ( ) {
86
97
gulp . src ( [ 'src/main/**/*.js' , 'src/main/**/*.html' ] )
87
98
. 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 ) ) )
89
103
. pipe ( $ . angularFilesort ( ) )
90
104
. pipe ( $ . if ( '*.js' , $ . replace ( / ' u s e s t r i c t ' ; / g, '' ) ) )
91
105
. pipe ( $ . concat ( pkg . name + '.js' ) )
0 commit comments