forked from mwitte/EmberChatAppServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
109 lines (97 loc) · 2.95 KB
/
Gruntfile.js
File metadata and controls
109 lines (97 loc) · 2.95 KB
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
'use strict';
var MergeBuildPropertiesClass = require('./build/MergeBuildProperties');
var propertyMerger = new MergeBuildPropertiesClass('buildDefaultProperties.json', 'buildProperties.json');
// LOAD AND MERGE BUILD PROPERTIES
var buildProperties = propertyMerger.merge();
// check if path to appshim got set
if(buildProperties.app === "/path/to/your/appshim"){
console.error('\n\nYou have to specify the correct path to your appshim!\n');
console.info('Create a buildProperties.json and define the app dir.');
console.info('Look into the buildDefaultProperties.json for help.\n\n');
return;
}
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
// package info
pkg: grunt.file.readJSON('package.json'),
// build properties("buildDefaultProperties.json" merged with "buildProperties.json")
buildProperties: buildProperties,
watch: {
src: {
files: ['<%= buildProperties.src %>/**/*'],
tasks: ['deploy']
}
},
clean: {
dist: {
files: [{
dot: true,
src: [
'<%= buildProperties.dist %>'
]
}]
},
deploy: {
files: [{
dot: true,
src: [
'<%= buildProperties.deploydir %>'
]
}]
}
},
// Put files not handled in other tasks here
copy: {
src: {
files: [{
expand: true,
dot: true,
cwd: '<%= buildProperties.src %>',
dest: '<%= buildProperties.dist %>',
src: '**/*'
}]
},
app: {
files: [{
expand: true,
dot: true,
cwd: '<%= buildProperties.app %>',
dest: '<%= buildProperties.dist %>',
src: '**/*'
}]
},
deploy: {
files: [{
expand: true,
dot: true,
cwd: '<%= buildProperties.dist %>',
dest: '<%= buildProperties.deploydir %>',
src: '**/*'
}]
}
}
});
grunt.registerTask('server', function (target) {
grunt.task.run([
'deploy',
'watch'
]);
});
grunt.registerTask('build', [
'clean:dist',
'copy:src',
'copy:app'
]);
grunt.registerTask('deploy', [
'build',
'clean:deploy',
'copy:deploy'
]);
grunt.registerTask('default', [
'build'
]);
};