forked from bitovi/funcunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
76 lines (69 loc) · 1.92 KB
/
build.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
load('steal/rhino/rhino.js')
load('funcunit/syn/build.js')
steal.File('funcunit/dist').mkdir()
steal.File('funcunit/dist/funcunit').mkdir()
steal.File('funcunit/dist/funcunit/java').mkdir()
steal.File('funcunit/dist/funcunit/qunit').mkdir()
steal.File('funcunit/dist/funcunit/scripts').mkdir()
steal.File('funcunit/dist/steal').mkdir()
steal.File('funcunit/dist/steal/rhino').mkdir()
/**
* Build funcunit, user-extensions
*/
steal('steal/build/pluginify', function(s){
steal.build.pluginify("funcunit",{
global: "true",
out: "funcunit/dist/funcunit/funcunit.js",
packagejquery: true
})
})
steal('steal/build/pluginify', function(s){
steal.build.pluginify("funcunit/qunit",{
global: "true",
out: "funcunit/dist/funcunit/qunit.js",
packagejquery: true
})
})
var i, fileName, cmd;
// read: wrapped, jQuery, json, syn
var userFiles =
["funcunit/browser/jquery.js",
"funcunit/browser/resources/json.js",
"funcunit/syn/dist/syn.js"],
fileText,
userExtensionsText = "";
for(var i=0; i<userFiles.length; i++){
fileText = readFile(userFiles[i]);
userExtensionsText += fileText+"\n";
print("appending "+userFiles[i])
}
steal.File("funcunit/java/user-extensions.js").save(userExtensionsText);
print("saved user-extensions.js")
/**
* Build the standalone funcunit
*/
var copyToDist = function(path){
steal.File(path).copyTo("funcunit/dist/"+path)
}
var filesToCopy = [
"funcunit/qunit/qunit.css",
"funcunit/java/selenium-server-standalone-2.0b3.jar",
"funcunit/java/selenium-java-client-driver.jar",
"funcunit/java/user-extensions.js",
"funcunit/scripts/run.js",
"steal/rhino/js.jar",
"steal/rhino/env.js",
"steal/rhino/loader.bat",
"steal/rhino/loader",
"funcunit/envjs",
"funcunit/envjs.bat",
"funcunit/settings.js",
"funcunit/loader.js",
"steal/rhino/rhino.js",
"steal/rhino/utils.js",
"steal/rhino/file.js"
]
for(var i = 0; i < filesToCopy.length; i++) {
copyToDist(filesToCopy[i])
}
print('FuncUnit is built')