-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
40 lines (34 loc) · 1.21 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
/*
* grunt-cubx-webpackage-upload
*
* Copyright (c) 2015 Hd Böhlau
* Licensed under the MIT license.
*/
'use strict';
const path = require('path');
module.exports = function (grunt) {
grunt.loadTasks('tasks'); // locally defined tasks
// Project configuration.
const workspacePath = path.join('test', 'webpackages');
const workspaceConfigPath = path.join(workspacePath, '.workspace');
const activeWebpackage = grunt.file.readJSON(workspaceConfigPath).activeWebpackage;
let webpackageRelatedOptions;
if (activeWebpackage && activeWebpackage.length > 0) {
// Webpackage related grunt options
webpackageRelatedOptions = {
activeWebpackage: activeWebpackage,
param: {
src: path.join(workspacePath, activeWebpackage)
}
};
} else {
grunt.fail.fatal('Declared \'activeWebpackage\' NOT found or missing one of the expected files\n' +
'* manifest.webpackage\n' +
'* .webpackage\n' +
'Please check ' + workspaceConfigPath + ' and the webpackage-folder.');
}
grunt.initConfig(webpackageRelatedOptions);
// Actually load this plugin's task(s).
const configs = require('load-grunt-configs')(grunt, webpackageRelatedOptions);
grunt.initConfig(configs);
};