buildr.coffee 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. # Requires
  2. buildr = require 'buildr'
  3. util = require 'util'
  4. # Options
  5. options =
  6. watch: false
  7. compress: true
  8. # Configs
  9. configs =
  10. standard:
  11. # Options
  12. name: 'standard'
  13. watch: options.watch
  14. # Paths
  15. srcPath: __dirname+'/scripts/uncompressed'
  16. outPath: __dirname+'/scripts/compressed'
  17. # Checking
  18. checkScripts: true
  19. jshintOptions:
  20. browser: true
  21. laxbreak: true
  22. boss: true
  23. undef: true
  24. onevar: true
  25. strict: true
  26. noarg: true
  27. # Compression (without outPath only the generated bundle files are compressed)
  28. compressScripts: options.compress # Array or true or false
  29. other: [
  30. # -----------------------------
  31. # Dojo Toolkit
  32. {
  33. # Options
  34. name: 'html4+html5+dojo'
  35. watch: options.watch
  36. # Paths
  37. srcPath: __dirname+'/scripts/uncompressed'
  38. # Compression (without outPath only the generated bundle files are compressed)
  39. compressScripts: options.compress # Array or true or false
  40. # Order
  41. scriptsOrder: [
  42. 'json2.js'
  43. 'history.adapter.dojo.js'
  44. 'history.html4.js'
  45. 'history.js'
  46. ]
  47. # Bundling
  48. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/dojo.history.js'
  49. }
  50. {
  51. # Options
  52. name: 'html5+dojo'
  53. watch: options.watch
  54. # Paths
  55. srcPath: __dirname+'/scripts/uncompressed'
  56. # Compression (without outPath only the generated bundle files are compressed)
  57. compressScripts: options.compress # Array or true or false
  58. # Order
  59. scriptsOrder: [
  60. 'history.adapter.dojo.js'
  61. 'history.js'
  62. ]
  63. # Bundling
  64. bundleScriptPath: __dirname+'/scripts/bundled/html5/dojo.history.js'
  65. }
  66. # -----------------------------
  67. # ExtJS
  68. {
  69. # Options
  70. name: 'html4+html5+extjs'
  71. watch: options.watch
  72. # Paths
  73. srcPath: __dirname+'/scripts/uncompressed'
  74. # Compression (without outPath only the generated bundle files are compressed)
  75. compressScripts: options.compress # Array or true or false
  76. # Order
  77. scriptsOrder: [
  78. 'json2.js'
  79. 'history.adapter.extjs.js'
  80. 'history.html4.js'
  81. 'history.js'
  82. ]
  83. # Bundling
  84. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/extjs.history.js'
  85. }
  86. {
  87. # Options
  88. name: 'html5+extjs'
  89. watch: options.watch
  90. # Paths
  91. srcPath: __dirname+'/scripts/uncompressed'
  92. # Compression (without outPath only the generated bundle files are compressed)
  93. compressScripts: options.compress # Array or true or false
  94. # Order
  95. scriptsOrder: [
  96. 'history.adapter.extjs.js'
  97. 'history.js'
  98. ]
  99. # Bundling
  100. bundleScriptPath: __dirname+'/scripts/bundled/html5/extjs.history.js'
  101. }
  102. # -----------------------------
  103. # JQUERY
  104. {
  105. # Options
  106. name: 'html4+html5+jquery'
  107. watch: options.watch
  108. # Paths
  109. srcPath: __dirname+'/scripts/uncompressed'
  110. # Compression (without outPath only the generated bundle files are compressed)
  111. compressScripts: options.compress # Array or true or false
  112. # Order
  113. scriptsOrder: [
  114. 'json2.js'
  115. 'history.adapter.jquery.js'
  116. 'history.html4.js'
  117. 'history.js'
  118. ]
  119. # Bundling
  120. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/jquery.history.js'
  121. }
  122. {
  123. # Options
  124. name: 'html5+jquery'
  125. watch: options.watch
  126. # Paths
  127. srcPath: __dirname+'/scripts/uncompressed'
  128. # Compression (without outPath only the generated bundle files are compressed)
  129. compressScripts: options.compress # Array or true or false
  130. # Order
  131. scriptsOrder: [
  132. 'history.adapter.jquery.js'
  133. 'history.js'
  134. ]
  135. # Bundling
  136. bundleScriptPath: __dirname+'/scripts/bundled/html5/jquery.history.js'
  137. }
  138. # -----------------------------
  139. # MOOTOOLS
  140. {
  141. # Options
  142. name: 'html4+html5+mootools'
  143. watch: options.watch
  144. # Paths
  145. srcPath: __dirname+'/scripts/uncompressed'
  146. # Compression (without outPath only the generated bundle files are compressed)
  147. compressScripts: options.compress # Array or true or false
  148. # Order
  149. scriptsOrder: [
  150. 'json2.js'
  151. 'history.adapter.mootools.js'
  152. 'history.html4.js'
  153. 'history.js'
  154. ]
  155. # Bundling
  156. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/mootools.history.js'
  157. }
  158. {
  159. # Options
  160. name: 'html5+mootools'
  161. watch: options.watch
  162. # Paths
  163. srcPath: __dirname+'/scripts/uncompressed'
  164. # Compression (without outPath only the generated bundle files are compressed)
  165. compressScripts: options.compress # Array or true or false
  166. # Order
  167. scriptsOrder: [
  168. 'history.adapter.mootools.js'
  169. 'history.js'
  170. ]
  171. # Bundling
  172. bundleScriptPath: __dirname+'/scripts/bundled/html5/mootools.history.js'
  173. }
  174. # -----------------------------
  175. # NATIVE
  176. {
  177. # Options
  178. name: 'html4+html5+native'
  179. watch: options.watch
  180. # Paths
  181. srcPath: __dirname+'/scripts/uncompressed'
  182. # Compression (without outPath only the generated bundle files are compressed)
  183. compressScripts: options.compress # Array or true or false
  184. # Order
  185. scriptsOrder: [
  186. 'json2.js'
  187. 'history.adapter.native.js'
  188. 'history.html4.js'
  189. 'history.js'
  190. ]
  191. # Bundling
  192. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/native.history.js'
  193. }
  194. {
  195. # Options
  196. name: 'html5+native'
  197. watch: options.watch
  198. # Paths
  199. srcPath: __dirname+'/scripts/uncompressed'
  200. # Compression (without outPath only the generated bundle files are compressed)
  201. compressScripts: options.compress # Array or true or false
  202. # Order
  203. scriptsOrder: [
  204. 'history.adapter.native.js'
  205. 'history.js'
  206. ]
  207. # Bundling
  208. bundleScriptPath: __dirname+'/scripts/bundled/html5/native.history.js'
  209. }
  210. # -----------------------------
  211. # RIGHT.JS
  212. {
  213. # Options
  214. name: 'html4+html5+right'
  215. watch: options.watch
  216. # Paths
  217. srcPath: __dirname+'/scripts/uncompressed'
  218. # Compression (without outPath only the generated bundle files are compressed)
  219. compressScripts: options.compress # Array or true or false
  220. # Order
  221. scriptsOrder: [
  222. 'json2.js'
  223. 'history.adapter.right.js'
  224. 'history.html4.js'
  225. 'history.js'
  226. ]
  227. # Bundling
  228. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/right.history.js'
  229. }
  230. {
  231. # Options
  232. name: 'html5+right'
  233. watch: options.watch
  234. # Paths
  235. srcPath: __dirname+'/scripts/uncompressed'
  236. # Compression (without outPath only the generated bundle files are compressed)
  237. compressScripts: options.compress # Array or true or false
  238. # Order
  239. scriptsOrder: [
  240. 'history.adapter.right.js'
  241. 'history.js'
  242. ]
  243. # Bundling
  244. bundleScriptPath: __dirname+'/scripts/bundled/html5/right.history.js'
  245. }
  246. # -----------------------------
  247. # ZEPTO
  248. {
  249. # Options
  250. name: 'html4+html5+zepto'
  251. watch: options.watch
  252. # Paths
  253. srcPath: __dirname+'/scripts/uncompressed'
  254. # Compression (without outPath only the generated bundle files are compressed)
  255. compressScripts: options.compress # Array or true or false
  256. # Order
  257. scriptsOrder: [
  258. 'json2.js'
  259. 'history.adapter.zepto.js'
  260. 'history.html4.js'
  261. 'history.js'
  262. ]
  263. # Bundling
  264. bundleScriptPath: __dirname+'/scripts/bundled/html4+html5/zepto.history.js'
  265. }
  266. {
  267. # Options
  268. name: 'html5+zepto'
  269. watch: options.watch
  270. # Paths
  271. srcPath: __dirname+'/scripts/uncompressed'
  272. # Compression (without outPath only the generated bundle files are compressed)
  273. compressScripts: options.compress # Array or true or false
  274. # Order
  275. scriptsOrder: [
  276. 'history.adapter.zepto.js'
  277. 'history.js'
  278. ]
  279. # Bundling
  280. bundleScriptPath: __dirname+'/scripts/bundled/html5/zepto.history.js'
  281. }
  282. ]
  283. # Standard
  284. standardConfig = configs.standard
  285. standardConfig.successHandler = ->
  286. for config in configs.other
  287. buildrInstance = buildr.createInstance config
  288. buildrInstance.process()
  289. # Process
  290. standardBuildr = buildr.createInstance configs.standard
  291. standardBuildr.process()