forked from winjs/winjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
44 lines (33 loc) · 1.51 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
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
module.exports = function (grunt) {
var config = require("./config.js");
// Make sure that Grunt doesn't remove BOM from our utf8 files
// on read
grunt.file.preserveBOM = true;
// Helper function to load the config file
function loadConfig(path) {
var glob = require('glob');
var object = {};
var key;
glob.sync('*', {cwd: path}).forEach(function(option) {
key = option.replace(/\.js$/,'');
object[key] = require(path + option);
});
return object;
}
// Load task options
var gruntConfig = loadConfig('./tasks/options/');
// Package data
gruntConfig.pkg = grunt.file.readJSON("package.json");
// Project config
grunt.initConfig(gruntConfig);
// Load all grunt-tasks in package.json
require("load-grunt-tasks")(grunt);
// Register external tasks
grunt.loadTasks("tasks/");
// Task alias's
grunt.registerTask("default", ["clean", "less", "concat", "copy", "replace"]);
grunt.registerTask("css", ["less"]);
grunt.registerTask("base", ["clean:base", "concat:baseDesktop", "concat:basePhone", "concat:baseStringsDesktop", "concat:baseStringsPhone", "replace"]);
grunt.registerTask("ui", ["clean:ui", "concat:uiDesktop", "concat:uiPhone", "concat:uiStringsDesktop", "concat:uiStringsPhone", "replace", "less"]);
}