forked from bitovi/funcunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
79 lines (72 loc) · 2.07 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
77
78
79
load('steal/rhino/steal.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/pluginify', function(s){
steal.build.pluginify("funcunit",{
global: "true",
destination: "funcunit/dist/funcunit/funcunit.js",
packagejquery: true
})
})
steal('//steal/build/pluginify/pluginify', function(s){
steal.build.pluginify("funcunit/qunit",{
global: "true",
destination: "funcunit/dist/funcunit/qunit.js",
packagejquery: true
})
})
var i, fileName, cmd;
// read: wrapped, jQuery, json, syn
var userFiles =
["funcunit/java/extensions/fakesteal.js",
"funcunit/resources/jquery.js",
"funcunit/java/extensions/wrapped.js",
"funcunit/resources/json.js",
"funcunit/syn/dist/syn.js",
"funcunit/resources/selector.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/steal.js",
"steal/rhino/utils.js",
"steal/rhino/file.js"
]
for(var i = 0; i < filesToCopy.length; i++) {
copyToDist(filesToCopy[i])
}
print('FuncUnit is built')