forked from cosenonjaviste/blogzinga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile_commons.coffee
85 lines (72 loc) · 2.94 KB
/
gulpfile_commons.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
webdriver_update = require('gulp-protractor').webdriver_update
moment = require 'moment'
pkg = require './package.json'
gulp_pkg = require './node_modules/gulp/package.json'
commons =
gulp : require 'gulp'
rimraf : require 'gulp-rimraf'
fs : require 'fs'
implementation_version : if process.env.BUILD_NUMBER then pkg.version+'-b'+ process.env.BUILD_NUMBER else pkg.version+'-build_time_'+moment().format("YYYYMMDD_hhmmss")
paths :
appJs: ['./app/**/*.coffee','./app/**/*.js']
appCss: ['./app/**/*.less']
img:['./app/**/*.png','./app/**/*.gif','./app/**/*.jpg']
fonts:[
'./bower_components/bootstrap/fonts/*',
'./bower_components/font-awesome/fonts/*'
'./bower_components/octicons/octicons/fonts/*'
]
templates: [
'!./app/index.jade'
'!./app/index.html'
'!./app/jade_includes/**/*.jade'
'./app/**/*.html'
'./app/**/*.jade'
]
index: ['./app/index.jade']
i18n:[
'./bower_components/angular-i18n/angular-locale*it*',
'./bower_components/angular-i18n/angular-locale*en*',
'./bower_components/angular-i18n/angular-locale*en-us*',
'./bower_components/angular-i18n/angular-locale*ja-jp*',
'./bower_components/angular-i18n/angular-locale*fr-fr*',
'./bower_components/angular-i18n/angular-locale*de*',
'./bower_components/angular-i18n/angular-locale*es*',
'./bower_components/angular-i18n/angular-locale*pt-br*'
]
favicon: ['./app/favicon.ico']
ngClassifyDefinitions : (file, options) ->
##for windows
return appName: 'bloglist' if file.path.indexOf('components\\bloglist') isnt -1
return appName: 'about' if file.path.indexOf('components\\about') isnt -1
return appName: 'contribute' if file.path.indexOf('components\\contribute') isnt -1
##for unix
return appName: 'bloglist' if file.path.indexOf('components/bloglist') isnt -1
return appName: 'about' if file.path.indexOf('components/about') isnt -1
return appName: 'contribute' if file.path.indexOf('components/contribute') isnt -1
return appName: 'blogzinga'
commons.gulp.task 'dir_clean', ->
commons.gulp.src ['dist/', 'mvn_dist/', 'tests/reports/']
.pipe commons.rimraf
read: false
force: true
commons.gulp.task 'clean', ['dir_clean'], ->
commons.gulp.src commons.paths.i18n
.pipe commons.gulp.dest './dist/js/i18n'
commons.gulp.task 'manifest', ['clean'], ->
commons.fs.mkdir('./dist/META-INF/')
commons.fs.writeFile(
'./dist/META-INF/MANIFEST.MF'
[
'Manifest-Version: 1.0'
'Implementation-Version: ' + commons.implementation_version
'Built-By: ' + (process.env.USERNAME || process.env.USER)
'Built-Date: ' + moment().format()
'Class-Path: '
'Created-By: ' + gulp_pkg.name + " " + gulp_pkg.version
].join('\n')
)
commons.gulp.task 'update_driver', ->
webdriver_update ->
console.log("updated driver")
module.exports = commons