-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.js
119 lines (112 loc) · 3.12 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
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
pkg.version = pkg.version.split(".");
var subversion = pkg.version.pop();
subversion++;
pkg.version.push(subversion);
pkg.version = pkg.version.join(".");
grunt.file.write('package.json', JSON.stringify(pkg, null, 2));
console.log("---------------------------------------");
console.log(" Building jSQL Version "+pkg.version);
console.log("---------------------------------------");
grunt.initConfig({
pkg: pkg,
concat: {
options: {
banner: '/**\n * <%= pkg.name %> - v<%= pkg.version %>' +
'\n * <%= pkg.description %>' +
'\n * @author <%= pkg.author %>' +
'\n * @website <%= pkg.homepage %>' +
'\n * @license <%= pkg.license %>' +
'\n */\n\n'
},
dist: {
src: [
'src/wrapper/head.js.part',
'src/error_handling/jSQL_Error.js',
'src/error_handling/jSQL_Lexer_Error.js',
'src/error_handling/jSQL_Parse_Error.js',
'src/error_handling/error_handling.js',
'src/data_types/jSQLDataTypeList.js',
'src/table/jSQLTable.js',
'src/query_types/jSQLQuery.js',
'src/query_types/jSQLDeleteQuery.js',
'src/query_types/jSQLDropQuery.js',
'src/query_types/jSQLInsertQuery.js',
'src/query_types/jSQLSelectQuery.js',
'src/query_types/jSQLUpdateQuery.js',
'src/query_types/jSQLCreateQuery.js',
'src/lexer/jSQLLexer.js',
'src/lexer/token_types.js',
'src/lexer/token.js',
'src/parser/jSQLParseQuery.js',
'src/parser/jSQLParseCreateTokens.js',
'src/parser/jSQLParseInsertTokens.js',
'src/parser/jSQLParseSelectTokens.js',
'src/parser/jSQLParseUpdateTokens.js',
'src/parser/jSQLParseDeleteTokens.js',
'src/parser/jSQLParseDropTokens.js',
'src/parser/jSQLParseWhereClause.js',
'src/parser/jSQLWhereClause.js',
'src/persistence/API.js',
'src/persistence/persistenceManager.js',
'src/sugar/createTable.js',
'src/sugar/select.js',
'src/sugar/update.js',
'src/sugar/insertInto.js',
'src/sugar/dropTable.js',
'src/sugar/deleteFrom.js',
'src/sugar/tokenize.js',
'src/helpers/jSQLReset.js',
'src/helpers/jSQLMinifier.js',
'src/helpers/removeQuotes.js',
'src/import_export/export.js',
'src/import_export/import.js',
'src/wrapper/foot.js.part'
],
dest: 'jSQL.js',
},
},
'string-replace': {
source: {
files: {
"jSQL.js": "jSQL.js"
},
options: {
replacements: [{
pattern: /{{ VERSION }}/g,
replacement: '"<%= pkg.version %>"'
}]
}
},
readme: {
files: {
"README.md": "README.md"
},
options: {
replacements: [{
pattern: /\d+.\d+.\d+/g,
replacement: '<%= pkg.version %>'
}]
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> */'
},
build: {
src: 'jSQL.js',
dest: 'jSQL.min.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', [
'concat',
'string-replace',
'uglify'
]);
};