1
- // load('jquery/build .js')
1
+ // load('jquery/buildAll .js')
2
2
3
3
load ( 'steal/rhino/rhino.js' )
4
4
@@ -10,30 +10,77 @@ load('steal/rhino/rhino.js')
10
10
steal ( 'steal/build/pluginify' , 'steal/build/apps' , 'steal/build/scripts' ) . then ( function ( s ) {
11
11
var ignore = / \. \w + | t e s t | g e n e r a t e | d i s t | q u n i t | f i x t u r e s | p a g e s /
12
12
13
- var plugins = [ ] ;
14
-
13
+ var plugins = [ ] ,
14
+ /**
15
+ * {"path/to/file.js" : ["file2/thing.js", ...]}
16
+ */
17
+ files = { } ;
18
+
15
19
s . File ( 'jquery' ) . contents ( function ( name , type , current ) {
16
20
if ( type !== 'file' && ! ignore . test ( name ) ) {
17
21
var folder = current + "/" + name ;
18
- print ( folder ) ;
19
- plugins . push ( folder ) ;
20
- steal . File ( folder ) . contents ( arguments . callee , folder )
22
+ if ( readFile ( folder + "/" + name + ".js" ) ) {
23
+ print ( folder ) ;
24
+ plugins . push ( folder ) ;
25
+ steal . File ( folder ) . contents ( arguments . callee , folder )
26
+ }
27
+
21
28
//steal.File(path + "/" + (current ? current + "/" : "") + name).contents(arguments.callee, (current ? current + "/" : "") + name);
22
29
}
23
30
} , "jquery" ) ;
24
31
25
32
// tell it to load all plugins into this page
26
- rhinoLoader = {
27
- callback : function ( s ) {
28
- s . apply ( s , plugins ) ;
29
- }
30
- } ;
33
+
31
34
32
- steal . win ( ) . build_in_progress = true ;
35
+ // steal.win().build_in_progress = true;
33
36
print ( " LOADING APP " )
37
+ steal . build . open ( 'steal/rhino/blank.html' , {
38
+ startFiles : plugins
39
+ } , function ( opener ) {
40
+
41
+ opener . each ( 'js' , function ( options , text , stl ) {
42
+ print ( options . rootSrc )
43
+ var dependencies = files [ options . rootSrc ] = [ ] ;
44
+ if ( stl . dependencies ) {
45
+ for ( var d = 0 ; d < stl . dependencies . length ; d ++ ) {
46
+ var depend = stl . dependencies [ d ] ;
47
+ if ( depend . options . rootSrc !== "jquery/jquery.js" ) {
48
+ dependencies . push ( depend . options . rootSrc ) ;
49
+ }
50
+ }
51
+ }
52
+ } )
53
+
54
+ s . File ( "jquery/dist/standalone" ) . mkdirs ( ) ;
55
+ s . File ( "jquery/dist/standalone/dependencies.json" ) . save ( $ . toJSON ( files ) ) ;
56
+ //get each file ...
57
+ print ( "Creating jquery/dist/standalone/" )
58
+ var compressor = s . build . builders . scripts . compressors [ "localClosure" ] ( )
59
+ for ( var path in files ) {
60
+ if ( path == "jquery/jquery.js" ) {
61
+ continue ;
62
+ }
63
+ var content = readFile ( path ) ;
64
+ var funcContent = s . build . pluginify . getFunction ( content ) ;
65
+ if ( typeof funcContent == "undefined" ) {
66
+ content = "" ;
67
+ } else {
68
+ content = "(" + s . build . pluginify . getFunction ( content ) + ")(jQuery);" ;
69
+ }
70
+ var out = path . replace ( / \/ \w + \. j s / , "" ) . replace ( / \/ / g, "." ) ;
71
+ content = s . build . builders . scripts . clean ( content ) ;
72
+ print ( " " + out + "" ) ;
73
+ content = s . build . builders . scripts . clean ( content ) ;
74
+ s . File ( "jquery/dist/standalone/" + out + ".js" ) . save ( content ) ;
75
+ s . File ( "jquery/dist/standalone/" + out + ".min.js" ) . save ( compressor ( content ) ) ;
76
+ }
77
+
78
+ } )
79
+
80
+ /*
34
81
var pageSteal = steal.build.open("steal/rhino/empty.html").steal,
35
82
steals = pageSteal.total,
36
- //hash of names to steals
83
+
37
84
files = {},
38
85
depends = function(stl, steals){
39
86
if(stl.dependencies){
@@ -75,31 +122,9 @@ steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( fu
75
122
}
76
123
}
77
124
}
78
- } )
125
+ })*/
126
+
79
127
80
- steal . File ( "jquery/dist/standalone" ) . mkdir ( ) ;
81
- steal . File ( "jquery/dist/standalone/dependencies.json" ) . save ( $ . toJSON ( files ) ) ;
82
- //get each file ...
83
- print ( "Creating jquery/dist/standalone/" )
84
- var compressor = steal . build . builders . scripts . compressors [ "localClosure" ] ( )
85
- for ( var path in files ) {
86
- if ( path == "jquery/jquery.js" ) {
87
- continue ;
88
- }
89
- var content = readFile ( path ) ;
90
- var funcContent = s . build . pluginify . getFunction ( content ) ;
91
- if ( typeof funcContent == "undefined" ) {
92
- content = "" ;
93
- } else {
94
- content = "(" + s . build . pluginify . getFunction ( content ) + ")(jQuery);" ;
95
- }
96
- var out = path . replace ( / \/ \w + \. j s / , "" ) . replace ( / \/ / g, "." ) ;
97
- content = steal . build . builders . scripts . clean ( content ) ;
98
- print ( " " + out + "" ) ;
99
- content = steal . build . builders . scripts . clean ( content ) ;
100
- s . File ( "jquery/dist/standalone/" + out + ".js" ) . save ( content ) ;
101
- s . File ( "jquery/dist/standalone/" + out + ".min.js" ) . save ( compressor ( content ) ) ;
102
- }
103
128
104
129
105
130
} )
0 commit comments