This repository has been archived by the owner on Sep 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.js
116 lines (114 loc) · 3.29 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
var browsers = require('./grunt/browsers');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'dist/scion.js',
dest: 'dist/scion.min.js'
}
},
babel: {
options: {
sourceMap: true,
presets: ['es2015'],
plugins : ['transform-es2015-modules-umd']
},
dist: {
files: {
'dist/scion.js' : 'dist/scion.js'
}
}
},
nodeunit: {
all : ['test/harness/node/index.js']
},
browserify : {
dev: {
options: {
debug : true,
browserifyOptions : {
standalone: 'scion'
}
},
src: ['lib/Statechart.js'],
dest: 'dist/scion.js'
}
},
express: {
options: {
script: 'grunt/server.js',
port: 3000
},
dev: {
options: {
node_env: 'development'
}
},
prod: {
options: {
node_env: 'production'
}
},
"prod-require": {
options: {
node_env: 'production-require'
}
}
},
'saucelabs-custom': {
all: {
options: {
urls: [
'http://127.0.0.1:3000/'
],
browsers: browsers,
build: process.env.TRAVIS_JOB_ID,
testname: 'custom tests',
throttled: 5,
statusCheckAttempts : 180,
sauceConfig: {
'video-upload-on-pass': false
}
}
}
},
gitcommit: {
dist: {
options: {
message: 'Updated dist files',
},
files: {
src: [
'dist/scion.js',
'dist/scion.js.map',
'dist/scion.min.js'
]
}
}
},
release: {
options: {
beforeRelease : ['build', 'gitcommit:dist'],
additionalFiles: ['bower.json'],
github: {
repo: 'jbeard4/SCION-CORE', //put your user/repo here
accessTokenVar: 'GITHUB_ACCESS_TOKEN', //ENVIRONMENT VARIABLE that contains GitHub Access Token
}
}
}
});
grunt.registerTask('build-tests', ['browserify:dev']);
grunt.registerTask('test', ['run-tests']);
grunt.registerTask('run-tests', ['nodeunit']);
grunt.registerTask('run-browser-tests', [ 'run-browser-tests-dev', 'run-browser-tests-prod', 'run-browser-tests-prod-require']);
grunt.registerTask('run-browser-tests-dev', ['express:dev', 'saucelabs-custom', 'express:dev:stop' ]);
grunt.registerTask('run-browser-tests-prod', ['express:prod', 'saucelabs-custom', 'express:prod:stop' ]);
grunt.registerTask('run-browser-tests-prod-require', ['express:prod-require', 'saucelabs-custom','express:prod-require:stop' ]);
grunt.registerTask('build', ['browserify', 'babel', 'uglify']);
grunt.registerTask('default', ['build']);
};