Skip to content
This repository
Browse code

Added package.json to build

  • Loading branch information...
commit 539a00f1e499182f62d7e48679b38a885a3dc317 1 parent 5c0bcc0
Roy Jacobs authored May 25, 2012
81  build/build-linux
... ...
@@ -1,37 +1,44 @@
1  
-#!/bin/sh
2  
-
3  
-OutDebugFile='output/intravenous-latest.debug.js'
4  
-OutMinFile='output/intravenous-latest.js'
5  
-
6  
-# Combine the source files
7  
-SourceFiles=`grep js < fragments/source-references.js | # Find JS references 
8  
-             sed "s/[ \',]//g" |                        # Strip off JSON fluff (whitespace, commas, quotes)
9  
-             sed -e 's/.*/..\/&/' |                     # Fix the paths by prefixing with ../
10  
-             tr '\n' ' '`                               # Combine into single line
11  
-cat fragments/amd-pre.js            > $OutDebugFile.temp
12  
-cat $SourceFiles                    >> $OutDebugFile.temp
13  
-cat fragments/amd-post.js           >> $OutDebugFile.temp
14  
-
15  
-# Now call Google Closure Compiler to produce a minified version
16  
-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
17  
-
18  
-# Finalise each file by prefixing with version header and surrounding in function closure
19  
-cp fragments/version-header.js $OutDebugFile
20  
-echo "(function(window,document,navigator,undefined){" >> $OutDebugFile
21  
-echo "var DEBUG=true;"                                 >> $OutDebugFile
22  
-cat $OutDebugFile.temp                                 >> $OutDebugFile
23  
-echo "})(window,document,navigator);"                  >> $OutDebugFile
24  
-rm $OutDebugFile.temp
25  
-
26  
-cp fragments/version-header.js $OutMinFile
27  
-echo "(function(window,document,navigator,undefined){" >> $OutMinFile
28  
-cat $OutMinFile.temp                                   >> $OutMinFile
29  
-echo "})(window,document,navigator);"                  >> $OutMinFile
30  
-rm $OutMinFile.temp
31  
-
32  
-# Inject the version number string
33  
-Version=`cat fragments/version.txt`
34  
-sed -i~ -e "s/##VERSION##/$Version/g" $OutDebugFile $OutMinFile
35  
-
36  
-# Delete the odd files left behind on Mac
37  
-rm -f output/*.js~
  1
+#!/bin/sh
  2
+
  3
+OutDebugFile='output/intravenous-latest.debug.js'
  4
+OutMinFile='output/intravenous-latest.js'
  5
+InNpmSpec='npm/package.json'
  6
+OutNpmSpec='output/package.json'
  7
+
  8
+# Combine the source files
  9
+SourceFiles=`grep js < fragments/source-references.js | # Find JS references 
  10
+             sed "s/[ \',]//g" |                        # Strip off JSON fluff (whitespace, commas, quotes)
  11
+             sed -e 's/.*/..\/&/' |                     # Fix the paths by prefixing with ../
  12
+             tr '\n' ' '`                               # Combine into single line
  13
+cat fragments/amd-pre.js            > $OutDebugFile.temp
  14
+cat $SourceFiles                    >> $OutDebugFile.temp
  15
+cat fragments/amd-post.js           >> $OutDebugFile.temp
  16
+
  17
+# Now call Google Closure Compiler to produce a minified version
  18
+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
  19
+
  20
+# Finalise each file by prefixing with version header and surrounding in function closure
  21
+cp fragments/version-header.js $OutDebugFile
  22
+echo "(function(window,document,navigator,undefined){" >> $OutDebugFile
  23
+echo "var DEBUG=true;"                                 >> $OutDebugFile
  24
+cat $OutDebugFile.temp                                 >> $OutDebugFile
  25
+echo "})(window,document,navigator);"                  >> $OutDebugFile
  26
+rm $OutDebugFile.temp
  27
+
  28
+cp fragments/version-header.js $OutMinFile
  29
+echo "(function(window,document,navigator,undefined){" >> $OutMinFile
  30
+cat $OutMinFile.temp                                   >> $OutMinFile
  31
+echo "})(window,document,navigator);"                  >> $OutMinFile
  32
+rm $OutMinFile.temp
  33
+
  34
+# Inject the version number string
  35
+Version=`cat fragments/version.txt`
  36
+sed -i~ -e "s/##VERSION##/$Version/g" $OutDebugFile $OutMinFile
  37
+
  38
+# Create NPM
  39
+cp $InNpmSpec $OutNpmSpec
  40
+sed -i~ -e "s/##VERSION##/$Version/g" $OutNpmSpec
  41
+
  42
+# Delete the odd files left behind on Mac
  43
+rm -f output/*.js~
  44
+rm -f output/*.json~
102  build/build-windows.bat
... ...
@@ -1,48 +1,54 @@
1  
-@echo off 
2  
-set InPackageSpec=nuget\Package.nuspec
3  
-set OutPackageSpec=output\Package.nuspec
4  
-set OutDebugFile=output\intravenous-latest.debug.js
5  
-set OutMinFile=output\intravenous-latest.js
6  
-set AllFiles=
7  
-for /f "eol=] skip=1 delims=' " %%i in (fragments\source-references.js) do set Filename=%%i& call :Concatenate 
8  
-
9  
-goto :Combine
10  
-:Concatenate 
11  
-    if /i "%AllFiles%"=="" ( 
12  
-        set AllFiles=..\%Filename:/=\%
13  
-    ) else ( 
14  
-        set AllFiles=%AllFiles% ..\%Filename:/=\%
15  
-    ) 
16  
-goto :EOF 
17  
-
18  
-:Combine
19  
-type fragments\amd-pre.js         > %OutDebugFile%.temp
20  
-type %AllFiles%                   >> %OutDebugFile%.temp
21  
-type fragments\amd-post.js        >> %OutDebugFile%.temp
22  
-
23  
-@rem Now call Google Closure Compiler to produce a minified version
24  
-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
25  
-
26  
-@rem Finalise each file by prefixing with version header and surrounding in function closure
27  
-copy /y fragments\version-header.js %OutDebugFile%
28  
-echo (function(window,document,navigator,undefined){>> %OutDebugFile%
29  
-echo var DEBUG=true;>> %OutDebugFile%
30  
-type %OutDebugFile%.temp                            >> %OutDebugFile%
31  
-echo })(window,document,navigator);>> %OutDebugFile%
32  
-del %OutDebugFile%.temp
33  
-
34  
-copy /y fragments\version-header.js %OutMinFile%
35  
-echo (function(window,document,navigator,undefined){>> %OutMinFile%
36  
-type %OutMinFile%.temp                              >> %OutMinFile%
37  
-echo })(window,document,navigator);>> %OutMinFile%
38  
-del %OutMinFile%.temp
39  
-
40  
-@rem Inject the version number string
41  
-set /p Version= <fragments\version.txt
42  
-cscript tools\searchReplace.js "##VERSION##" %VERSION% %OutDebugFile% %OutMinFile%
43  
-cscript tools\searchReplace.js "\r\n" "\n" %OutDebugFile%  %OutMinFile%
44  
-
45  
-@rem Nuget stuff
46  
-copy /y %InPackageSpec% %OutPackageSpec%
47  
-cscript tools\searchReplace.js "##VERSION##" %VERSION% %OutPackageSpec%
48  
-nuget pack %OutPackageSpec% -OutputDirectory output
  1
+@echo off 
  2
+set InNuSpec=nuget\Package.nuspec
  3
+set OutNuSpec=output\Package.nuspec
  4
+set InNpmSpec=npm\package.json
  5
+set OutNpmSpec=output\package.json
  6
+set OutDebugFile=output\intravenous-latest.debug.js
  7
+set OutMinFile=output\intravenous-latest.js
  8
+set AllFiles=
  9
+for /f "eol=] skip=1 delims=' " %%i in (fragments\source-references.js) do set Filename=%%i& call :Concatenate 
  10
+
  11
+goto :Combine
  12
+:Concatenate 
  13
+    if /i "%AllFiles%"=="" ( 
  14
+        set AllFiles=..\%Filename:/=\%
  15
+    ) else ( 
  16
+        set AllFiles=%AllFiles% ..\%Filename:/=\%
  17
+    ) 
  18
+goto :EOF 
  19
+
  20
+:Combine
  21
+type fragments\amd-pre.js         > %OutDebugFile%.temp
  22
+type %AllFiles%                   >> %OutDebugFile%.temp
  23
+type fragments\amd-post.js        >> %OutDebugFile%.temp
  24
+
  25
+@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
  27
+
  28
+@rem Finalise each file by prefixing with version header and surrounding in function closure
  29
+copy /y fragments\version-header.js %OutDebugFile%
  30
+echo (function(window,document,navigator,undefined){>> %OutDebugFile%
  31
+echo var DEBUG=true;>> %OutDebugFile%
  32
+type %OutDebugFile%.temp                            >> %OutDebugFile%
  33
+echo })(window,document,navigator);>> %OutDebugFile%
  34
+del %OutDebugFile%.temp
  35
+
  36
+copy /y fragments\version-header.js %OutMinFile%
  37
+echo (function(window,document,navigator,undefined){>> %OutMinFile%
  38
+type %OutMinFile%.temp                              >> %OutMinFile%
  39
+echo })(window,document,navigator);>> %OutMinFile%
  40
+del %OutMinFile%.temp
  41
+
  42
+@rem Inject the version number string
  43
+set /p Version= <fragments\version.txt
  44
+cscript tools\searchReplace.js "##VERSION##" %VERSION% %OutDebugFile% %OutMinFile%
  45
+cscript tools\searchReplace.js "\r\n" "\n" %OutDebugFile%  %OutMinFile%
  46
+
  47
+@rem Nuget stuff
  48
+copy /y %InNuSpec% %OutNuSpec%
  49
+cscript tools\searchReplace.js "##VERSION##" %VERSION% %OutNuSpec%
  50
+nuget pack %OutNuSpec% -OutputDirectory output
  51
+
  52
+@rem NPM stuff
  53
+copy /y %InNpmSpec% %OutNpmSpec%
  54
+cscript tools\searchReplace.js "##VERSION##" %VERSION% %OutNpmSpec%
22  build/npm/package.json
... ...
@@ -0,0 +1,22 @@
  1
+{
  2
+	"name": "intravenous",
  3
+	"files": [
  4
+		"intravenous-latest.js"
  5
+	],
  6
+	"version": "##VERSION##",
  7
+	"description": "Lightweight dependency injection for Javascript",
  8
+	"homepage": "http://royjacobs.github.com/intravenous/",
  9
+	"keywords": [
  10
+		"di",
  11
+		"ioc",
  12
+		"injection"
  13
+	],
  14
+	"author": "Roy Jacobs <hello@royjacobs.org> (http://www.royjacobs.org)",
  15
+	"license": "MIT",
  16
+	"repositories": [
  17
+		{
  18
+			"type": "git",
  19
+			"url": "https://github.com/RoyJacobs/intravenous" 
  20
+		} 
  21
+	]
  22
+}

0 notes on commit 539a00f

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