forked from EdgeVerve/oe-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
188 lines (176 loc) · 9.37 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
©2015-2016 EdgeVerve Systems Limited (a fully owned Infosys subsidiary), Bangalore, India. All Rights Reserved.
The EdgeVerve proprietary software program ("Program"), is protected by copyrights laws, international treaties and other pending or existing intellectual property rights in India, the United States and other countries.
The Program may contain/reference third party or open source components, the rights to which continue to remain with the applicable third party licensors or the open source community as the case may be and nothing here transfers the rights to the third party and open source components, except as expressly permitted.
Any unauthorized reproduction, storage, transmission in any form or by any means (including without limitation to electronic, mechanical, printing, photocopying, recording or otherwise), or any distribution of this Program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.
*/
/*
©2015-2016 EdgeVerve Systems Limited (a fully owned Infosys subsidiary), Bangalore, India. All Rights Reserved.
The EdgeVerve proprietary software program ("Program"), is protected by copyrights laws, international treaties and other pending or existing intellectual property rights in India, the United States and other countries.
The Program may contain/reference third party or open source components, the rights to which continue to remain with the applicable third party licensors or the open source community as the case may be and nothing here transfers the rights to the third party and open source components, except as expressly permitted.
Any unauthorized reproduction, storage, transmission in any form or by any means (including without limitation to electronic, mechanical, printing, photocopying, recording or otherwise), or any distribution of this Program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.
*/
module.exports = function GruntConfig(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
'jshintrc': true,
ignores: ['server/dropdb.js']
},
all: ['common/**/*.js',
'data/**/*.js',
'lib/*.js',
'lib/common/**/*.js',
'lib/**/*.js',
'server/*.js',
'server/boot/**/*.js',
'server/middleware/**/*.js',
'server/models/**/*.js',
'server/util/**/*.js',
'Gruntfile.js'
]
},
jscs: {
all: {
options: {
config: '.jscs.json',
fix: false
},
files: {
src: ['common/**/*.js',
'data/**/*.js',
'lib/*.js',
'lib/common/**/*.js',
'lib/**/*.js',
'server/*.js',
'server/boot/**/*.js',
'server/middleware/**/*.js',
'server/models/**/*.js',
'server/util/**/*.js',
'Gruntfile.js']
}
},
fixall: {
options: {
config: '.jscs.json',
fix: true
},
files: {
src: ['common/**/*.js',
'data/**/*.js',
'lib/*.js',
'lib/common/**/*.js',
'lib/**/*.js',
'server/*.js',
'server/boot/**/*.js',
'server/middleware/**/*.js',
'server/models/**/*.js',
'server/util/**/*.js',
'Gruntfile.js']
}
}
},
mkdir: {
all: {
options: {
create: ['dist']
}
}
},
copy: {
main: {
files: [
// includes files within path and its sub-directories
{
expand: true,
src: ['**', '!node_modules/**', '!coverage/**'],
dest: 'dist/'
}
]
}
},
usebanner: {
all: {
options: {
position: 'top',
banner: '/*\n' +
'©2015-2016 EdgeVerve Systems Limited (a fully owned Infosys subsidiary), Bangalore, India. All Rights Reserved.\n' +
'The EdgeVerve proprietary software program ("Program"), is protected by copyrights laws, international treaties and other pending or existing intellectual property rights in India, the United States and other countries. \n' +
'The Program may contain/reference third party or open source components, the rights to which continue to remain with the applicable third party licensors or the open source community as the case may be and nothing here transfers the rights to the third party and open source components, except as expressly permitted.\n' +
'Any unauthorized reproduction, storage, transmission in any form or by any means (including without limitation to electronic, mechanical, printing, photocopying, recording or otherwise), or any distribution of this Program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.\n' +
'*/',
linebreak: true
},
files: {
src: ['**/*.js']
}
}
},
mochaTest: {
test: {
options: {
quiet: false,
clearRequireCache: true,
timeout: 60000
},
src: ['test/*.js']
},
integrationTest: {
options: {
quiet: false,
clearRequireCache: true,
timeout: 60000
},
src: ['test/integration-test/*.js']
},
postgres: {
options: {
quiet: false,
clearRequireCache: true,
timeout: 60000
},
src: ['test/audit-field-mixin-test.js', 'test/auto-fields-test.js', 'test/basic-api-test.js', 'test/basic-test.js', 'test/bootstrap.js', 'test/business-rule-mixin-test.js', 'test/caching-test.js', 'test/composite-model-test.js', 'test/concurrency-test.js', 'test/config-merge-test.js', 'test/cr-model-test.js', 'test/crypto-test.js', 'test/data-acl-test.js', 'test/data-hierarchy-test.js', 'test/data-personalization-test.js', 'test/datasource-personalization.js', 'test/decision-table-test.js', 'test/delete-test.js', 'test/designer-boot-test.js', 'test/embedded-many-test.js', 'test/enum-test.js', 'test/failsafe-observer-test.js', 'test/fail-test.js', 'test/gridconfig-test.js', 'test/gridmetadata-test.js', 'test/health-test.js', 'test/history-mixin-test.js', 'test/idempotent-behavior-test.js', 'test/idempotent-mixin-test.js', 'test/import-export-test.js', 'test/integration-test.js', 'test/job-scheduler-test.js', 'test/literal-test.js', 'test/misclaneous-test.js', 'test/model-collection-test.js', 'test/model-definition-ACL-test.js', 'test/model-definition-inheritance-test.js', 'test/model-definition-relation-test.js', 'test/model-definition-test.js', 'test/model-definition-test2.js', 'test/model-definition-validation-test.js', 'test/model-personalization-test.js', 'test/model-transaction-test.js', 'test/model-validation-composite-uniqueness-test.js', 'test/model-validation-embeddedModel-test.js', 'test/model-validation-oeValidation-custom-test.js', 'test/model-validation-oeValidation-test.js', 'test/model-validation-relation-test.js', 'test/model-validation-test.js', 'test/model-validation-validateWhen.js', 'test/model-validation-xmodelvalidate-test.js', 'test/model-variant-of-test.js', 'test/multi-tenancy-test.js', 'test/node-red-test.js', 'test/otp-mixin-test.js', 'test/property-expressions-test.js', 'test/relation-has-one-test.js', 'test/service-personalization-relation-test.js', 'test/service-personalization-test.js', 'test/soft-delete-mixin-test.js', 'test/switch-data-source-test.js', 'test/uicomponent-test.js', 'test/uimetadata-test.js', 'test/unauthorised-write.js', 'test/update-data-acl-test.js', 'test/update-test.js', 'test/version-mixin-test.js', 'test/z-jwt-assertion-test.js', 'test/z-remove-demo-user-test.js', 'test/z-z-ap-state-test.js', 'test/z-z-business-validations-tests.js', 'test/z-z-rest-api-actors-mixin-tests.js', 'test/z-z-z-actor-pattern-test.js', 'test/z-z-z-logger-config-test.js']
}
},
clean: {
coverage: {
src: ['coverage/']
},
dist: {
src: ['dist/']
}
},
mocha_istanbul: {
coverage: {
src: 'test',
options: {
excludes: ['lib/expression-language/expression-syntax-parser.js', 'lib/tenant-util.js', 'common/models/framework/cache-manager.js'],
timeout: 60000,
// check: {
// lines: 70,
// statements: 70,
// functions: 70,
// branches: 70
// },
reportFormats: ['lcov']
}
}
}
});
// Load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
// Add the grunt-mocha-test tasks.
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-banner');
grunt.registerTask('default', ['jshint', 'jscs']);
grunt.registerTask('test-with-coverage', ['clean:coverage', 'mocha_istanbul']);
grunt.registerTask('addbanner', ['clean:dist', 'mkdir', 'copy', 'usebanner']);
grunt.registerTask('all', ['jshint', 'jscs', 'clean:coverage', 'mocha_istanbul']);
};