This repository has been archived by the owner on Aug 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
165 lines (158 loc) · 3.97 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
160
161
162
163
164
165
/*!
* SAP UI5 Scrum Board v0.0.1
* Copyright (c) 2015 abat AG
* Date: 2015-03-02
*/
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
karma: {
unit: {
// TODO: Use config file only
// openui5 options not found in karma.conf
configFile: 'karma.conf.js',
options: {
client: {
openui5: {
config: {
theme: 'sap_bluecrystal',
libs: 'sap.m',
resourceroots: {
'sap.m': '/base/bower_components/openui5-sap.m/resources/sap/m',
'de.abat.scrumui5.test': '/base/test',
'de.abat.scrumui5': '/base/app'
},
themeroots: {'sap_bluecrystal': '/base/bower_components/openui5-themelib_sap_bluecrystal/resources'},
preload: ''
},
mockserver: {
config: {autoRespond: true},
rootUri: 'http://user:pass@uri:8000/sap/opu/odata/sap/Z_ZAV_SCRUM_SRV/',
metadataURL: '/base/test/service/metadata.xml',
mockdataSettings: '/base/test/service'
}
}
},
preprocessors: {'app/**/*.js': ['coverage']},
reporters: ['progress', 'coverage'],
coverageReporter: {type: 'cobertura', dir: 'test-reports/'}
}
}
},
uglify: {
min: {
options: {
mangle: true,
banner: '/*! \n'
+ ' * <%= pkg.description %> v<%= pkg.version %>\n'
+ ' * Copyright (c) 2015 abat AG\n'
+ ' * Date: <%= grunt.template.today("yyyy-mm-dd") %>\n'
+ ' */\n'
},
files: grunt.file.expandMapping(['target/**/*.js', '!target/resources/**/*'], '', {
rename: function (destBase, destPath) {
return destBase + destPath.replace('.js', '.js');
}
})
},
beautify: {
options: {beautify: true, mangle: false},
files: grunt.file.expandMapping(['app/**/*.js', 'test/**/*.js'], '', {
rename: function (destBase, destPath) {
return destBase + destPath;
}
})
}
},
compress: {
main: {
options: {
archive: 'www.zip'
},
files: [
{
expand: true,
cwd: 'target',
src: ['**'],
dest: 'www'
}
]
}
},
"phonegap-build": {
main: {
options: {
keys: {ios: { "password": "abat" }},
archive: "www.zip",
"appId": "1334667",
"user": {
"email": "[email protected]",
"password": "phonegapbuild"
}
}
}
},
clean: ["target","test-reports", "test-reports/plato"],
copy: {
main: {
files: [
{
expand: true,
cwd: 'app/',
src: ['**'],
dest: 'target/'
},
{
expand: true,
cwd: 'bower_components/openui5-mobile/resources',
src: ['**', '!**/*dbg.js', '!sap-ui-core-nojQuery.js'],
dest: 'target/resources/'
},
{
src: ['config.xml'],
dest: 'target/'
}
]
}
},
plato: {
your_task: {
options : {
jshint : false,
complexity : {
logicalor : true,
switchcase : true,
forin : true,
trycatch : true,
newmi: true
}
},
files: {
'test-reports/plato': ['app/**/*.js']
}
}
},
eslint: {
options: {
configFile: '.eslintrc',
ignoreFile: '.eslintignore',
quiet: false,
format: 'checkstyle',
outputFile: 'test-reports/eslint-cov.xml'
}, target: ['app/**/*.js', 'test/**/*.js']
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-phonegap-build');
grunt.loadNpmTasks('grunt-plato');
grunt.registerTask('default', ['clean', 'eslint', 'karma:unit:start', 'copy' ,'uglify:min']);
grunt.registerTask('beautify', ['uglify:beautify']);
grunt.registerTask('build', ['clean', 'copy', 'uglify:min', 'compress', 'phonegap-build']);
grunt.registerTask('complete', ['clean', 'eslint', 'plato' , 'karma:unit:start', 'copy', 'uglify:min', 'compress', 'phonegap-build']);
};