initial import
[roojs1] / buildSDK / bundle_build.js
1 /**
2  * Usage:
3  * 
4  * In the top level Roojs directory.. (you need to change the path of the jstoolkit)
5  * 
6  * roolite buildSDK/bundle_build.js -L/home/svn/svn/rooscript/examples/jstoolkit2
7  * 
8  * later we will have additional sections in the dep builder for adding/removeing files from list 
9  * for smaller builds..
10  * <script type="text/javascript">
11  */
12 // pack needs to be in the include path!!
13
14 include 'lib/Array.js';
15 include 'lib/JSDOC.js';
16 include 'lib/JSDOC/Identifier.js';
17 include 'lib/JSDOC/TokenReader.js';
18 include 'lib/JSDOC/Token.js';
19 include 'lib/JSDOC/TokenStream.js';
20
21 include 'lib/JSDOC/CompressWhite.js';
22 include 'lib/JSDOC/Scope.js';
23 include 'lib/JSDOC/ScopeParser.js';
24 include 'lib/JSDOC/Packer.js';
25
26
27
28 var argv = new Array();
29     var gotsep = false;
30     for (var i = 0 ; i < arguments.length; i++) {
31         if (arguments[i] == '--') {
32             gotsep = true;
33             continue;
34         }
35         if (!gotsep) {
36             continue;
37         }
38         argv.push(arguments[i]);
39     }
40
41 function main() {
42
43    
44     println(argv.toSource());
45     
46     var files = [];
47     var spath = File.getcwd();
48     var flist = File.read(spath+"/buildSDK/dependancy_order.txt" ).split("\n");
49     for(var i = 0; i < flist.length;i++) {
50         var f = flist[i];
51         if (/^\s*\//.test(f) || !/[a-z]+/i.test(f)) {
52             continue;
53         }
54         //println("ADD"+ f.replace(/\./g, '/'));
55         files.push(spath + '/' + f.replace(/\./g, '/').replace(/\s+/g,'')+'.js');
56         
57     }
58      
59     
60     println(files.toSource());
61     
62       
63     var bpath = spath + '/build';
64     if (!File.exists(bpath)) {
65         File.mkdir(bpath);
66     }
67     
68     
69     var debugfile = spath + "/roojs-debug.js";
70     
71     
72     var allfile = spath + "/roojs-all.js";
73     
74     
75     var pk = new JSDOC.Packer(files, spath);
76     pk.translate = false;
77     pk.packFiles(bpath, allfile, debugfile);
78      
79     
80     println("Finished!");
81   
82 }
83
84 main();
85