forked from fgpv-vpgf/fgpv-vpgf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulp.config.js
219 lines (178 loc) · 7.56 KB
/
gulp.config.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
var path = require('path');
var bowerFiles = require('main-bower-files');
module.exports = function () {
'use strict';
/* var client = './src/client/';
var server = './src/server/';
var clientApp = client + 'app/';
var specRunnerFile = 'specs.html';
var wiredep = require('wiredep'); */
var bowerModules = './lib/';
var root = path.resolve('./');
var src = './src/'; // source files
var build = './build/'; // build target, suitable for usage as a dev server
var libBuild = build + 'lib/';
var sampleBuild = build + 'samples/';
var dist = './dist/'; // contains packaged builds (ex: tgz and zip)
var app = src + 'app/';
var tmp = '.tmp/';
var report = './report/';
var bowerdir = './lib/';
// var nodedir = './node_modules/';
var config = {
index: [
src + 'index-many.html',
src + 'index-one.html',
src + 'index-wet.html',
src + 'index-jso.html',
src + 'index-fgp-en.html',
src + 'index-fgp-fr.html',
src + 'bookmark-decode.html'
],
indexProtractor: src + 'index-protractor.html',
js: [
app + '*/**/*.js',
app + 'app.module.js',
'!' + app + '**/*.spec.js'
],
jsOrder: [
'lib.js',
'global-registry.js',
'app.js',
'templates.js',
'app-seed.js'
],
injectorOrder: [
'polyfills.js',
'bootstrap.js'
],
jsPolyfills: src + 'polyfill/es7-*.js',
jsPolyfillsFile: 'polyfills.js',
jsIePolyfills: src + 'polyfill/ie-*.js',
jsIePolyfillsFile: 'ie-polyfills.js',
// please rename if there are better shorter names
jsSingleFile: 'app.js',
jsSingleFilePath: build + 'app.js', // too annoying to hoist jsSingleFile
jsLibFile: 'lib.js',
jsLibFilePath: build + 'lib.js',
scss: src + 'content/styles/main.scss',
css: build + 'main.css',
csslib: [ ],
csserror: src + 'content/styles/_error.css',
// all html template files
htmltemplates: app + '**/*.html',
// angular template cache file to be injected
templates: tmp + 'templates.js',
jsAppSeed: app + 'app-seed.js', // initializes viewer instances
jsGlobalRegistry: app + 'global-registry.js', // create global registry; loads gapi, etc.
jsInjectorFile: app + 'bootstrap.js',
jsInjectorDest: 'bootstrap.js',
jsInjectorFilePath: libBuild + 'bootstrap.js',
jsCoreFile: 'core.js',
specHelpers: [src + 'test/*.js'], // bind-polyfill,
specs: [app + '**/*.spec.js'],
staticAssets: [src + 'config*.json'],
svgCache: `${src}content/svgCache`,
schema: src + 'schema.json',
vetjs: [src + '**/*.js', '*.js', 'e2e-test/**/*.js', 'test/**/*.js', 'docs/app/js/app.js',
'docs/config/**/*.js', '!docs/config/templates/*.js', '!docs/config/tag-defs/*.js'],
watchsass: `${src}content/styles/**/*.scss`,
watchjs: `${src}**/*.js`,
watchhtml: `${src}**/*.html`,
watchconfig: `${src}*.json`,
xslt: `${src}content/metadata/xstyle_default_i18n.xsl`,
plato: {
js: app + '**/*.js'
},
/**
* Template cache settings.
*/
templateCache: {
file: 'templates.js',
options: {
module: 'app.templates',
root: 'app/',
standAlone: false
}
},
app,
src,
build,
libBuild,
sampleBuild,
dist,
root,
tmp,
report,
libdir: bowerdir,
// alljs: [
// './src/**/*.js',
// './*.js'
// ],
// build: './build/',
// client: client,
// fonts: bowerdir + 'font-awesome/fonts/**/*.*',
// images: client + 'images/**/*.*',
// // app js, with no specs
// optimized: {
// app: 'app.js',
// lib: 'lib.js'
// },
// browserReloadDelay: 1000,
// packages: [
// './package.json',
// './bower.json'
// ],
defaultPort: '6001'
};
config.karma = getKarmaOptions();
// jscs:disable maximumLineLength
config.iconCache = [
{ file: 'content/images/iconsets/default-icons.svg', prefix: 'default', icons: 'check'.split(' '), isDefault: true },
{ file: 'content/images/iconsets/action-icons.svg', prefix: 'action', icons: 'search home history description delete settings info visibility visibility_off zoom_in zoom_out check_circle open_in_new print shopping_cart opacity'.split(' ') },
{ file: 'content/images/iconsets/alert-icons.svg', prefix: 'alert', icons: 'error'.split(' ') },
{ file: 'content/images/iconsets/communication-icons.svg', prefix: 'communication', icons: 'location_on'.split(' ') },
{ file: 'content/images/iconsets/mdi-icons.svg', prefix: 'community', icons: 'filter chevron-double-left emoticon-sad emoticon-happy vector-square table-large map-marker-off apple-keyboard-control vector-point vector-polygon vector-polyline'.split(' ') },
{ file: 'content/images/iconsets/content-icons.svg', prefix: 'content', icons: 'create add remove'.split(' ') },
{ file: 'content/images/iconsets/editor-icons.svg', prefix: 'editor', icons: 'insert_drive_file drag_handle'.split(' ') },
{ file: 'content/images/iconsets/file-icons.svg', prefix: 'file', icons: 'file_upload cloud'.split(' ') },
{ file: 'content/images/iconsets/hardware-icons.svg', prefix: 'hardware', icons: 'keyboard_arrow_right keyboard_arrow_down'.split(' ') },
{ file: 'content/images/iconsets/image-icons.svg', prefix: 'image', icons: 'tune photo'.split(' ') },
{ file: 'content/images/iconsets/maps-icons.svg', prefix: 'maps', icons: 'place layers my_location map layers_clear'.split(' ') },
{ file: 'content/images/iconsets/navigation-icons.svg', prefix: 'navigation', icons: 'menu check more_vert close more_horiz refresh'.split(' ') },
{ file: 'content/images/iconsets/social-icons.svg', prefix: 'social', icons: 'person'.split(' ') }
];
// jscs:enable maximumLineLength
config.svgSources = config.svgCache + '/*.svg';
function getKarmaOptions() {
var options = {
files: [].concat(
config.specHelpers, // order matters
bowerModules + 'jquery/dist/jquery.js',
bowerModules + 'datatables.net/js/jquery.dataTables.js',
bowerFiles(),
src + 'polyfill/*.js',
bowerModules + 'angular-mocks/angular-mocks.js',
bowerModules + 'sinon/index.js',
bowerModules + 'bardjs/dist/bard.js',
app + '**/*module*.js',
app + '**/!(app-seed|injector).js', // excluding injector
config.templates,
config.specs
),
coverage: {
dir: report + 'coverage',
reporters: [
// reporters not supporting the `file` property
{ type: 'html', subdir: 'report-html' },
{ type: 'lcov', subdir: 'report-lcov' },
{ type: 'text-summary' } // , subdir: '.', file: 'text-summary.txt'}
]
},
preprocessors: {}
};
options.preprocessors[app + '**/*.js'] = ['coverage', 'babel'];
return options;
}
return config;
};