/
Gruntfile.js
159 lines (156 loc) · 5.96 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
ngdocs: {
options: {
dest: 'docs',
scripts: ['http://code.jquery.com/jquery-1.11.0.js',
'http://code.jquery.com/ui/1.10.4/jquery-ui.js',
'http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js',
'bower_components/angular/angular.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-route/angular-route.js',
'http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.js',
'http://cdnjs.cloudflare.com/ajax/libs/angular-ui-utils/0.1.1/angular-ui-utils.min.js',
'http://maps.google.com/maps/api/js?.js',
'http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js',
'node_modules/openlayers/dist/ol.js',
'dist/geo-web-toolkit-min.js'],
styles: ["https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.min.css",
'node_modules/openlayers/dist/ol.css',
"http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"],
html5Mode: false
},
api: {
src: ['src/**/*.js', '!src/**/*.spec.js'],
title: 'API Documentation'
}
},
uglify: {
options: {
mangle: false,
sourceMap: true,
sourceMapName: 'dist/geo-web-toolkit-min.js.map',
beautify: true
},
release: {
files: {
'dist/geo-web-toolkit-min.js': [
'src/main/js/config/*.js',
'src/main/js/core/*.js',
'src/main/js/vendor/*.js',
'src/main/js/map_services/*.js',
'src/main/js/ui/**/*.js'
]
}
},
webjar: {
files: {
'src/main/js/geo-web-toolkit-min.js': [
'src/main/js/config/*.js',
'src/main/js/core/*.js',
'src/main/js/vendor/*.js',
'src/main/js/map_services/*.js',
'src/main/js/ui/**/*.js'
]
}
}
},
ngtemplates: {
'geowebtoolkit.ui.templates': {
src: 'src/main/js/ui/**/*.html',
dest: 'src/main/js/toolkit-templates.js',
options: {
standalone: true
}
}
},
concat: {
options: {
separator: '\r\n\r\n'
},
dist: {
src: ['dist/geo-web-toolkit-min.js', 'src/main/js/toolkit-templates.js'],
dest: 'dist/geo-web-toolkit-min.js'
},
webjar: {
src: ['src/main/js/geo-web-toolkit-min.js', 'src/main/js/toolkit-templates.js'],
dest: 'src/main/js/geo-web-toolkit-min.js'
}
},
copy: {
main: {
files: [
{
expand: true,
cwd: 'src/main/js/',
src: [
'config/**',
'core/**',
'map_services/**',
'ui/**',
'vendor/**'
],
dest: 'dist/'
}
]
}
},
karma: {
unit: {
configFile: 'src/test/js/karma.conf.js',
runnerPort: 9999,
singleRun: true,
browsers: ['Chrome'],
logLevel: 'ERROR'
},
continuous: {
configFile: 'src/test/js/karma.ci.conf.js',
runnerPort: 9999,
singleRun: true,
browsers: ['PhantomJS'],
logLevel: 'ERROR'
}
},
bumpup: {
files: ['package.json', 'bower.json']
},
tagrelease: {
file: 'bower.json',
commit: true,
message: 'Release %version%',
prefix: 'v',
annotate: false
},
angular_architecture_graph: {
diagram: {
files: {
"architecture": [
"src/main/js/**/*.js"
]
}
}
}
});
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-ngdocs');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-bumpup');
grunt.loadNpmTasks('grunt-tagrelease');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-angular-architecture-graph');
grunt.loadNpmTasks('grunt-graphviz');
grunt.registerTask('default', ['uglify', 'ngdocs', 'ngtemplates', 'concat', 'copy']);
grunt.registerTask('test', ['default', 'karma']);
grunt.registerTask('build', ['default', 'karma:unit']);
grunt.registerTask('build-ci', ['default', 'karma:continuous']);
grunt.registerTask('fastbuild',['uglify', 'ngtemplates', 'concat', 'copy']);
grunt.registerTask('release', function (type) {
type = type ? type : 'patch';
grunt.task.run('default'); // Minify stuff, Build doco, Build templates,Concat templates with min
//grunt.task.run('bumpup:' + type); // Bump up the package version
//grunt.task.run('tagrelease'); // Commit & tag the changes from above
});
};