1
- /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
1
+ /* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
2
2
'use strict' ;
3
3
4
4
var
5
5
pkg = require ( './package.json' ) ,
6
+ head = {
7
+ cc : '/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */' ,
8
+ agpl : '/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */'
9
+ } ,
6
10
cfg = {
7
11
devVersion : '0.0.0' ,
8
12
releasesPath : 'build/dist/releases' ,
40
44
gutil = require ( 'gulp-util' )
41
45
;
42
46
47
+ function getHead ( )
48
+ {
49
+ return ! cfg . community ? head . cc : head . agpl ;
50
+ }
51
+
43
52
function regOtherMinTask ( sName , sPath , sInc , sOut , sHeader )
44
53
{
45
54
gulp . task ( sName , function ( ) {
@@ -330,23 +339,23 @@ gulp.task('js:webpack', ['js:webpack:clear'], function(callback) {
330
339
331
340
gulp . task ( 'js:app' , [ 'js:webpack' ] , function ( ) {
332
341
return gulp . src ( cfg . paths . staticJS + cfg . paths . js . app . name )
333
- . pipe ( header ( '/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ \n') )
342
+ . pipe ( header ( getHead ( ) + ' \n') )
334
343
. pipe ( eol ( '\n' , true ) )
335
344
. pipe ( gulp . dest ( cfg . paths . staticJS ) )
336
345
. on ( 'error' , gutil . log ) ;
337
346
} ) ;
338
347
339
348
gulp . task ( 'js:admin' , [ 'js:webpack' ] , function ( ) {
340
349
return gulp . src ( cfg . paths . staticJS + cfg . paths . js . admin . name )
341
- . pipe ( header ( '/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ \n') )
350
+ . pipe ( header ( getHead ( ) + ' \n') )
342
351
. pipe ( eol ( '\n' , true ) )
343
352
. pipe ( gulp . dest ( cfg . paths . staticJS ) )
344
353
. on ( 'error' , gutil . log ) ;
345
354
} ) ;
346
355
347
356
gulp . task ( 'js:chunks' , [ 'js:webpack' ] , function ( ) {
348
357
return gulp . src ( cfg . paths . staticJS + '*.subapp.js' )
349
- . pipe ( header ( '/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ \n') )
358
+ . pipe ( header ( getHead ( ) + ' \n') )
350
359
. pipe ( eol ( '\n' , true ) )
351
360
. pipe ( gulp . dest ( cfg . paths . staticJS ) )
352
361
. on ( 'error' , gutil . log ) ;
@@ -357,7 +366,7 @@ gulp.task('js:min', ['js:app', 'js:admin', 'js:chunks'], function() {
357
366
return gulp . src ( cfg . paths . staticJS + '*.js' )
358
367
. pipe ( replace ( / " r a i n l o o p \/ v \/ ( [ ^ \/ ] + ) \/ s t a t i c \/ j s \/ " / g, '"rainloop/v/$1/static/js/min/"' ) )
359
368
. pipe ( uglify ( cfg . uglify ) )
360
- . pipe ( header ( '/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ \n') )
369
+ . pipe ( header ( getHead ( ) + ' \n') )
361
370
. pipe ( eol ( '\n' , true ) )
362
371
. pipe ( gulp . dest ( cfg . paths . staticMinJS ) )
363
372
. on ( 'error' , gutil . log ) ;
@@ -482,6 +491,11 @@ gulp.task('rainloop:setup', ['rainloop:copy'], function() {
482
491
483
492
fs . writeFileSync ( dist + 'rainloop/v/' + versionFull + '/index.php.root' , fs . readFileSync ( dist + 'index.php' ) ) ;
484
493
494
+ if ( cfg . community )
495
+ {
496
+ require ( 'rimraf' ) . sync ( dist + 'rainloop/v/' + versionFull + '/app/libraries/RainLoop/Prem/' ) ;
497
+ }
498
+
485
499
cfg . destPath = cfg . releasesPath + '/webmail/' + versionFull + '/' ;
486
500
cfg . cleanPath = dist ;
487
501
cfg . zipSrcPath = dist ;
@@ -578,33 +592,51 @@ gulp.task('rainloop:owncloud:clean', ['rainloop:owncloud:copy', 'rainloop:ownclo
578
592
579
593
// MAIN
580
594
gulp . task ( 'default' , [ 'js:libs' , 'js:boot' , 'js:openpgp' , 'js:min' , 'css:main:min' , 'ckeditor' , 'fontastic' ] ) ;
581
- gulp . task ( 'fast' , [ 'js:app' , 'js:admin' , 'js:chunks' , 'css:main' ] ) ;
595
+ gulp . task ( 'fast-' , [ 'js:app' , 'js:admin' , 'js:chunks' , 'css:main' ] ) ;
596
+
597
+ gulp . task ( 'fast' , [ 'package:community-on' , 'fast-' ] ) ;
598
+ gulp . task ( 'fast+' , [ 'package:community-off' , 'fast-' ] ) ;
582
599
583
600
gulp . task ( 'rainloop:start' , [ 'js:lint' , 'rainloop:copy' , 'rainloop:setup' ] ) ;
584
601
585
- gulp . task ( 'rainloop' , [ 'package:community-on' , 'rainloop:start' , 'rainloop:zip' , 'rainloop:md5' , 'rainloop:clean' ] ) ;
586
- gulp . task ( 'rainloop+' , [ 'package:community-off' , 'rainloop' ] ) ;
602
+ gulp . task ( 'rainloop-' , [ 'rainloop:start' , 'rainloop:zip' , 'rainloop:md5' , 'rainloop:clean' ] ) ;
587
603
588
- gulp . task ( 'owncloud' , [ 'package:community-on' , 'rainloop:owncloud:copy' ,
604
+ gulp . task ( 'rainloop' , [ 'package:community-on' , 'rainloop-' ] ) ;
605
+ gulp . task ( 'rainloop+' , [ 'package:community-off' , 'rainloop-' ] ) ;
606
+
607
+ gulp . task ( 'owncloud-' , [ 'rainloop:owncloud:copy' ,
589
608
'rainloop:owncloud:copy-rainloop' , 'rainloop:owncloud:copy-rainloop:clean' ,
590
609
'rainloop:owncloud:setup' , 'rainloop:owncloud:zip' , 'rainloop:owncloud:md5' , 'rainloop:owncloud:clean' ] ) ;
591
610
592
- gulp . task ( 'owncloud+' , [ 'package:community-off' , 'owncloud' ] ) ;
611
+ gulp . task ( 'owncloud' , [ 'package:community-on' , 'owncloud-' ] ) ;
612
+ gulp . task ( 'owncloud+' , [ 'package:community-off' , 'owncloud-' ] ) ;
593
613
594
614
//WATCH
595
615
gulp . task ( 'watch' , [ 'fast' ] , function ( ) {
596
616
gulp . watch ( cfg . paths . globjs , { interval : 1000 } , [ 'js:app' , 'js:admin' ] ) ;
597
617
gulp . watch ( cfg . paths . less . main . watch , { interval : 1000 } , [ 'css:main' ] ) ;
598
618
} ) ;
599
619
620
+ gulp . task ( 'watch+' , [ 'fast+' ] , function ( ) {
621
+ gulp . watch ( cfg . paths . globjs , { interval : 1000 } , [ 'js:app' , 'js:admin' ] ) ;
622
+ gulp . watch ( cfg . paths . less . main . watch , { interval : 1000 } , [ 'css:main' ] ) ;
623
+ } ) ;
624
+
600
625
// ALIASES
601
626
gulp . task ( 'build' , [ 'rainloop' ] ) ;
627
+ gulp . task ( 'build+' , [ 'rainloop+' ] ) ;
602
628
gulp . task ( 'js:hint' , [ 'js:lint' ] ) ;
603
629
604
630
gulp . task ( 'w' , [ 'watch' ] ) ;
631
+ gulp . task ( 'w+' , [ 'watch+' ] ) ;
605
632
gulp . task ( 'f' , [ 'fast' ] ) ;
633
+ gulp . task ( 'f+' , [ 'fast+' ] ) ;
634
+
606
635
gulp . task ( 'b' , [ 'build' ] ) ;
607
636
gulp . task ( 'b+' , [ 'build+' ] ) ;
637
+
608
638
gulp . task ( 'o' , [ 'owncloud' ] ) ;
609
639
gulp . task ( 'o+' , [ 'owncloud+' ] ) ;
610
- gulp . task ( 'h' , [ 'js:lint' ] ) ;
640
+
641
+ gulp . task ( 'h' , [ 'js:lint' ] ) ;
642
+ gulp . task ( 'l' , [ 'js:lint' ] ) ;
0 commit comments