-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (67 loc) · 2.15 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
install: true,
layout: 'byComponent',
targetDir: 'source/src/ext',
cleanTargetDir: true,
copy: true
}
}
},
jasmine: {
src: ['source/src/*.js', 'source/src/lib/*.js'],
options: {
//keepRunner: true,
version: '2.0.0',
specs: 'source/tests/unit/specs/*_test.js',
vendor: [
"source/src/ext/jsrsasign/js/jsrsasign-4.7.0-all-min.js",
"source/src/ext/jsjws/js/json-sans-eval.js",
"source/src/ext/jsjws/js/jws-3.0.min.js",
"source/src/ext/jquery/js/jquery.min.js",
"source/src/lib/jsjws.patch.js",
],
helpers: 'source/tests/unit/helpers/*_helper.js'
}
},
clean: {
example_app: ['source/examples/app/public/src']
},
copy: {
example_src: {
files: [
{ expand: true, cwd: 'source/src/', src: ['**'], dest: 'source/examples/app/public/src' }
]
}
},
watch:{
app:{
files: ['source/examples/app/app.js']
}
}
});
// Load the plugins which are defined as devDependincies in the package.json
require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
grunt.registerTask('example_app', function(){
grunt.task.run('clean:example_app');
grunt.task.run('copy:example_src');
grunt.task.run('server');
grunt.task.run('watch:app');
});
grunt.registerTask('server', 'Start a custom web server', function() {
grunt.log.writeln('Started web server on https://saserver1:3000');
require('./source/examples/app/app.js').listen(3000);
});
grunt.registerTask('run_app', function () {
grunt.util.spawn({
cmd: "node",
args: ['source/examples/app/app.js'],
});
grunt.task.run('watch');
});
};