-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
158 lines (135 loc) · 5.61 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
#!/usr/bin/env node
/*!
* ----
* G®
* ----
* G® — A Next Generation Molecule Storage Environment by Quantumømics, Inc.
* ___________________________________________________________________________
*
* Grunt, http://gruntjs.com/ — The JavaScript Task Runner.
* ___________________________________________________________________________
*
* Architecture and Code Handcrafted by Prabhat Kumar.
* Architectuur en Code handgemaakt door Prabhat Kumar.
* @author : Prabhat Kumar [http://prabhatkumar.org/].
* @copyright : Prabhat Kumar [http://prabhatkumar.org/].
* @copyright : Quantumømics, Inc. [http://quantumomics.com/].
* @copyright : Sequømics, Inc. [http://sequomics.com/].
* ___________________________________________________________________________
*
* @date : 04-Sept-2018
* @license : Apache, version 2.0
* @require : Node.js®
* @require : NPM
* @require : grunt-cli
* @build : SEED™ — Skövde
* └────── A Sequømics Product — http://sequomics.com/.
* ___________________________________________________________________________
*
* --/The Heart of Build System/-- of "G®".
* ___________________________________________________________________________
*/
// global __dirname: true
// global require: true
// # Usage: $ node -v
// # Usage: $ npm -v
// # Usage: $ grunt -version
// Invoking the strict mode.
"use strict";
// To load required Node module.
// -----------------------------
var os = require('os');
var fs = require('fs');
// To load required NPM modules.
// -----------------------------
var chalk = require('chalk');
var glob = require('glob');
// Default color defined.
// ----------------------
var noop = chalk.red;
var yeep = chalk.green;
var okay = chalk.blue;
var boop = chalk.cyan;
var goop = chalk.gray;
///-------------------
// An object literals.
///-------------------
var build = {
// Non-identifier property names are quoted.
"system" : "SEED™",
"name" : "Skövde",
"year" : "2016",
"audience" : "for all scientist and computational biologist."
};
// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |------------------------------------------| 24/Dec/2016 | SEED™ — Skövde.
// Copyright © 2016, Prabhat Kumar, All rights reserved.
// ----------------------------------------------------------------------------------------------------------
module.exports = function(grunt) {
// Force use of Unix newlines.
// http://gruntjs.com/api/grunt.util
grunt.util.linefeed = '\n';
// 1. time-grunt ——> $ npm install time-grunt --save-dev
// Display the elapsed execution time of grunt tasks.
require('time-grunt')(grunt);
// Utility to load the different option files,
// based on their names — @using `glob`.
function loadConfig(path) {
var object = {};
var key;
glob.sync('*', {
cwd: path
}).forEach(function(option) {
key = option.replace(/\.js$/,'');
object[key] = require(path + option);
});
return object;
}
/// Initial Configurations.
var config = {
pkg: grunt.file.readJSON('./package.json')
};
/// Loading Externally-Defined Tasks.
grunt.loadTasks('tasks');
/// Loading all the tasks options in `tasks/options`,
/// based on the name:
/// \---------------- coffee.js => coffee{}
grunt.util._.extend(config, loadConfig('./tasks/options/'));
// Project configuration for -//G®//- Build.
grunt.initConfig(config);
// 2. load-grunt-tasks ——> $ npm install load-grunt-tasks --save-dev
// Load multiple grunt tasks using the globbing patterns.
require('load-grunt-tasks')(grunt, {
scope: [
'dependencies',
'devDependencies',
'peerDependencies',
'optionalDependencies'
],
// Traverse up the file hierarchy looking for dependencies like `require()`.
requireResolution: true
});
// A Default Task of SEED™.
grunt.registerTask('default', 'To know about the Build System.', function(){
// Build System License and Information.
var license = [
'/*! ',
' * Build System — ' + yeep(build.system) + ': ' + okay(build.name) ,
' * ' + boop(build.audience) ,
' * --------------------------------------------------------------------------------- ',
' * Copyright © 2015 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved. ',
' * Available via the Apache License, version 2.0. [http://www.apache.org/licenses/] ',
' * See: http://seed.sequomics.com/ — for details. ',
' * --------------------------------------------------------------------------------- ',
' * You are running O/S type —— ' + boop(os.type()) + ' and architecture is —— ' + noop(os.arch()) ,
' * --------------------------------------------------------------------------------- ',
' */ ',
'\n',
].map(function(s) {
return s.replace(/\s+$/, '');
}).join("\n");
// Printing about SEED™.
grunt.log.writeln(goop(license));
});
// Last Update: 31-12-2016 — 05:19:44 PM.
};