forked from c9/cloud9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.dryice.js
executable file
·82 lines (72 loc) · 2.17 KB
/
Makefile.dryice.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
#!/usr/bin/env node
var fs = require("fs");
var copy = require('dryice').copy;
var ACE_HOME = __dirname + "/support/ace"
function main(args) {
var target;
if (args.length == 3) {
target = args[2];
// Check if 'target' contains some allowed value.
if (target != "worker") {
target = null;
}
}
if (!target) {
console.log("--- Cloud9 Dryice Build Tool ---");
console.log("");
console.log("Options:");
console.log(" worker build workers");
process.exit(0);
}
var project = {
roots: [
ACE_HOME + "/lib",
__dirname + "/client",
__dirname + "/support/treehugger/lib"
],
textPluginPattern: /^ace\/requirejs\/text!/
};
if (target == "worker") {
worker(project);
}
}
function worker(project) {
console.log('# cloud9 worker ---------');
var worker = copy.createDataObject();
var workerProject = copy.createCommonJsProject(project);
copy({
source: [
copy.source.commonjs({
project: workerProject,
require: [
'ace/lib/fixoldbrowsers',
'ace/lib/event_emitter',
'ace/lib/oop',
'ext/language/worker',
'ext/codecomplete/local_completer',
'ext/codecomplete/snippet_completer',
'ext/codecomplete/open_files_local_completer',
'ext/jslanguage/parse',
'ext/jslanguage/scope_analyzer',
'ext/jslanguage/narcissus_jshint',
'ext/jslanguage/debugger'
]
})
],
filter: [ copy.filter.moduleDefines, filterTextPlugin ],
dest: worker
});
copy({
source: [
ACE_HOME + "/lib/ace/worker/worker.js",
worker
],
filter: [ /* copy.filter.uglifyjs */],
dest: __dirname + "/client/js/worker/worker.js"
});
}
function filterTextPlugin(text) {
return text.replace(/(['"])ace\/requirejs\/text\!/g, "$1text!");
}
if (!module.parent)
main(process.argv);