This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.coffee
65 lines (59 loc) · 1.79 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
module.exports = (grunt) ->
gruntTasks = require('matchdep').filterDev 'grunt-*'
grunt.loadNpmTasks(task) for task in gruntTasks
AWS = grunt.file.readJSON('./config/aws-config.json')
PACKAGE = grunt.file.readJSON('./package.json')
version = ->
PACKAGE.version
topVersion = ->
semanticVersion = version().split('.')
while semanticVersion.length > 2
semanticVersion.pop()
semanticVersion.join('.')
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
browserify:
compile:
files:
'build/das.js': ['tmp/src/scripts/das.js']
coffee:
compile:
expand: true
cwd: 'lib'
src: ['**/*.coffee']
dest: 'tmp/src/scripts'
ext: ".js"
mochaTest:
acceptance:
options:
reporter: 'spec'
require: ['coffee-script', './spec/acceptance_helper.coffee']
src: ['spec/acceptance/**/*.coffee']
unit:
options:
reporter: 'spec'
require: ['coffee-script', './spec/spec_helper.coffee']
src: ['spec/unit/**/*.coffee']
uglify:
build:
files:
'build/das.min.js': ['build/das.js']
s3:
options:
# debug: true
key: AWS.AWSAccessKeyId
secret: AWS.AWSSecretKey
bucket: AWS.bucket
access: AWS.access
dev:
upload: [{
src: 'build/*.js'
dest: 'libs/das/v' + topVersion() + '/'
gzip: true
}]
grunt.registerTask 'test:integration', ['mochaTest:integration']
grunt.registerTask 'test:unit', ['mochaTest:unit']
grunt.registerTask 'test', ['mochaTest']
grunt.registerTask 'build', ['coffee', 'browserify', 'uglify']
grunt.registerTask 'deploy:production', ['test', 'build', 's3']
grunt.registerTask 'default', ['test', 'build']