This repository has been archived by the owner on Apr 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
132 lines (107 loc) · 3.42 KB
/
Gruntfile.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Grunt configuration updated to latest Grunt.
module.exports = (grunt) ->
# Initialize the configuration.
grunt.initConfig
aws: grunt.file.readJSON('credentials.json')
clean:
main:
src: ['target/main']
unit:
src: ['target/test/unit']
e2e:
src: ['target/test/e2e']
copy:
main:
files: [
{expand: true, cwd: 'src/main/html', src: ['**'], dest: 'target/main/'}
{expand: true, cwd: 'src/main/css', src: ['**'], dest: 'target/main/css/'}
{expand: true, cwd: 'src/main/img', src: ['**'], dest: 'target/main/img/'}
{expand: true, cwd: 'src/main/lib', src: ['**'], dest: 'target/main/lib/'}
]
unit:
files: [
{expand: true, cwd: 'src/test/unit/lib', src: ['**'], dest: 'target/test/unit/lib/'}
]
e2e:
files: [
{expand: true, cwd: 'src/test/e2e/lib', src: ['**'], dest: 'target/test/e2e/lib/'}
]
# Lint CoffeeScripts
coffeelint:
options:
'max_line_length':
'value': 160,
'level': 'error'
main:
files:
src: ['src/main/coffee/**/*.coffee']
unit:
files:
src: ['src/test/unit/coffee/**/*.coffee']
e2e:
files:
src: ['src/test/e2e/coffee/**/*.coffee']
# Compile CoffeeScripts
coffee:
options:
join: true
main:
files:
'target/main/js/main.js': ['src/main/coffee/main.coffee', 'src/main/coffee/**/*.coffee']
unit:
files:
'target/test/unit/js/test.js': ['src/test/unit/coffee/**/*.coffee']
e2e:
files:
'target/test/e2e/js/test.js': ['src/test/e2e/coffee/**/*.coffee']
watch:
files: ['src/main/**/*', 'src/test/**/*']
tasks: ['build', 'karma:dev:run']
connect:
server:
options:
base: 'target/main'
karma:
options:
frameworks: ['jasmine']
browsers: ['Chrome']
files: ['target/main/lib/angular.js', 'target/test/unit/lib/angular-mocks.js', 'target/main/js/**/*.js', 'target/test/unit/js/**/*.js']
dev:
options:
background: true
reporters: 'dots'
build:
options:
singleRun: true
# Protractor doesn't work on mavericks at the moment.
protractor:
options:
keepAlive: false,
configFile: 'src/test/e2e/protractor.conf.js'
singlerun: {}
s3:
options:
accessKeyId: '<%= aws.accessKeyId %>'
secretAccessKey: '<%= aws.secretAccessKey %>'
region: '<%= aws.region %>'
bucket: '<%= aws.bucket %>'
build:
cwd: 'target/main'
src: '**'
dest: 'money-when/'
# Load external Grunt task plugins.
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-karma'
grunt.loadNpmTasks 'grunt-protractor-runner'
grunt.loadNpmTasks 'grunt-aws'
# Default task.
grunt.registerTask 'default', ['dev']
grunt.registerTask 'build', ['copy', 'coffeelint', 'coffee']
grunt.registerTask 'dev', ['build', 'connect', 'karma:dev:start', 'watch']
grunt.registerTask 'test', ['build', 'karma:build']
grunt.registerTask 'deploy', ['clean', 'test', 's3']