Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch '138-jQuery-extern'

  • Loading branch information...
commit f0edc52d2ca9b5253deb13af19e326b083057e8d 2 parents 365bfee + d48ce75
Steven Sanderson authored May 17, 2012
18  build/build-linux
@@ -15,25 +15,25 @@ SourceFiles=`grep js < fragments/source-references.js | # Find JS references
15 15
              sed "s/[ \',]//g" |                        # Strip off JSON fluff (whitespace, commas, quotes)
16 16
              sed -e 's/.*/..\/&/' |                     # Fix the paths by prefixing with ../
17 17
              tr '\n' ' '`                               # Combine into single line
18  
-cat fragments/amd-pre.js            > $OutDebugFile.temp
  18
+cat fragments/extern-pre.js         > $OutDebugFile.temp
  19
+cat fragments/amd-pre.js            >> $OutDebugFile.temp
19 20
 cat $SourceFiles                    >> $OutDebugFile.temp
20 21
 cat fragments/amd-post.js           >> $OutDebugFile.temp
  22
+cat fragments/extern-post.js        >> $OutDebugFile.temp
21 23
 
22 24
 # Now call Google Closure Compiler to produce a minified version
23  
-curl -d output_info=compiled_code -d output_format=text -d compilation_level=ADVANCED_OPTIMIZATIONS --data-urlencode "js_code=/**@const*/var DEBUG=false;" --data-urlencode js_code@$OutDebugFile.temp "http://closure-compiler.appspot.com/compile" > $OutMinFile.temp
  25
+curl -d output_info=compiled_code -d output_format=text -d compilation_level=ADVANCED_OPTIMIZATIONS --data-urlencode output_wrapper="(function() {%output%})();" --data-urlencode "js_code=/**@const*/var DEBUG=false;" --data-urlencode js_code@$OutDebugFile.temp "http://closure-compiler.appspot.com/compile" > $OutMinFile.temp
24 26
 
25 27
 # Finalise each file by prefixing with version header and surrounding in function closure
26 28
 cp fragments/version-header.js $OutDebugFile
27  
-echo "(function(window,document,navigator,undefined){" >> $OutDebugFile
28  
-echo "var DEBUG=true;"                                 >> $OutDebugFile
29  
-cat $OutDebugFile.temp                                 >> $OutDebugFile
30  
-echo "})(window,document,navigator);"                  >> $OutDebugFile
  29
+echo "(function(){"                 >> $OutDebugFile
  30
+echo "var DEBUG=true;"              >> $OutDebugFile
  31
+cat $OutDebugFile.temp              >> $OutDebugFile
  32
+echo "})();"                        >> $OutDebugFile
31 33
 rm $OutDebugFile.temp
32 34
 
33 35
 cp fragments/version-header.js $OutMinFile
34  
-echo "(function(window,document,navigator,undefined){" >> $OutMinFile
35  
-cat $OutMinFile.temp                                   >> $OutMinFile
36  
-echo "})(window,document,navigator);"                  >> $OutMinFile
  36
+cat $OutMinFile.temp                >> $OutMinFile
37 37
 rm $OutMinFile.temp
38 38
 
39 39
 # Inject the version number string
16  build/build-windows.bat
@@ -18,25 +18,25 @@ goto :Combine
18 18
 goto :EOF
19 19
 
20 20
 :Combine
21  
-type fragments\amd-pre.js         > %OutDebugFile%.temp
  21
+type fragments\extern-pre.js      > %OutDebugFile%.temp
  22
+type fragments\amd-pre.js         >> %OutDebugFile%.temp
22 23
 type %AllFiles%                   >> %OutDebugFile%.temp 2>nul
23 24
 type fragments\amd-post.js        >> %OutDebugFile%.temp
  25
+type fragments\extern-post.js     >> %OutDebugFile%.temp
24 26
 
25 27
 @rem Now call Google Closure Compiler to produce a minified version
26  
-tools\curl -d output_info=compiled_code -d output_format=text -d compilation_level=ADVANCED_OPTIMIZATIONS --data-urlencode "js_code=/**@const*/var DEBUG=false;" --data-urlencode js_code@%OutDebugFile%.temp "http://closure-compiler.appspot.com/compile" > %OutMinFile%.temp
  28
+tools\curl -d output_info=compiled_code -d output_format=text -d compilation_level=ADVANCED_OPTIMIZATIONS --data-urlencode output_wrapper="(function() {%%output%%})();" --data-urlencode "js_code=/**@const*/var DEBUG=false;" --data-urlencode js_code@%OutDebugFile%.temp "http://closure-compiler.appspot.com/compile" > %OutMinFile%.temp
27 29
 
28 30
 @rem Finalise each file by prefixing with version header and surrounding in function closure
29 31
 copy /y fragments\version-header.js %OutDebugFile% >nul
30  
-echo (function(window,document,navigator,undefined){>> %OutDebugFile%
  32
+echo (function(){>> %OutDebugFile%
31 33
 echo var DEBUG=true;>> %OutDebugFile%
32  
-type %OutDebugFile%.temp                            >> %OutDebugFile%
33  
-echo })(window,document,navigator);>> %OutDebugFile%
  34
+type %OutDebugFile%.temp          >> %OutDebugFile%
  35
+echo })();>> %OutDebugFile%
34 36
 del %OutDebugFile%.temp
35 37
 
36 38
 copy /y fragments\version-header.js %OutMinFile% >nul
37  
-echo (function(window,document,navigator,undefined){>> %OutMinFile%
38  
-type %OutMinFile%.temp                              >> %OutMinFile%
39  
-echo })(window,document,navigator);>> %OutMinFile%
  39
+type %OutMinFile%.temp            >> %OutMinFile%
40 40
 del %OutMinFile%.temp
41 41
 
42 42
 @rem Inject the version number string
1  build/fragments/extern-post.js
... ...
@@ -0,0 +1 @@
  1
+})(window,document,navigator,window["jQuery"]);
1  build/fragments/extern-pre.js
... ...
@@ -0,0 +1 @@
  1
+(function(window,document,navigator,jQuery,undefined){

0 notes on commit f0edc52

Please sign in to comment.
Something went wrong with that request. Please try again.