mguymon-buildr 1.4.5-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. data/CHANGELOG +1291 -0
  2. data/LICENSE +176 -0
  3. data/NOTICE +26 -0
  4. data/README.rdoc +134 -0
  5. data/Rakefile +44 -0
  6. data/_buildr +35 -0
  7. data/_jbuildr +35 -0
  8. data/addon/buildr/antlr.rb +65 -0
  9. data/addon/buildr/bnd.rb +147 -0
  10. data/addon/buildr/cobertura.rb +22 -0
  11. data/addon/buildr/drb.rb +281 -0
  12. data/addon/buildr/emma.rb +22 -0
  13. data/addon/buildr/hibernate.rb +149 -0
  14. data/addon/buildr/javacc.rb +85 -0
  15. data/addon/buildr/jaxb_xjc.rb +72 -0
  16. data/addon/buildr/jdepend.rb +60 -0
  17. data/addon/buildr/jetty.rb +248 -0
  18. data/addon/buildr/jibx.rb +86 -0
  19. data/addon/buildr/nailgun.rb +221 -0
  20. data/addon/buildr/openjpa.rb +88 -0
  21. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  22. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  23. data/addon/buildr/org/apache/buildr/BuildrNail.java +41 -0
  24. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  25. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  26. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  27. data/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  28. data/addon/buildr/protobuf.rb +88 -0
  29. data/addon/buildr/xmlbeans.rb +93 -0
  30. data/bin/buildr +19 -0
  31. data/buildr.buildfile +58 -0
  32. data/buildr.gemspec +78 -0
  33. data/doc/_config.yml +1 -0
  34. data/doc/_layouts/default.html +90 -0
  35. data/doc/_layouts/preface.html +22 -0
  36. data/doc/artifacts.textile +217 -0
  37. data/doc/building.textile +276 -0
  38. data/doc/contributing.textile +268 -0
  39. data/doc/css/default.css +236 -0
  40. data/doc/css/print.css +101 -0
  41. data/doc/css/syntax.css +23 -0
  42. data/doc/download.textile +151 -0
  43. data/doc/extending.textile +212 -0
  44. data/doc/images/1442160941-frontcover.jpg +0 -0
  45. data/doc/images/asf-logo.gif +0 -0
  46. data/doc/images/asf-logo.png +0 -0
  47. data/doc/images/buildr-hires.png +0 -0
  48. data/doc/images/buildr.png +0 -0
  49. data/doc/images/favicon.png +0 -0
  50. data/doc/images/growl-icon.tiff +0 -0
  51. data/doc/images/note.png +0 -0
  52. data/doc/images/project-structure.png +0 -0
  53. data/doc/images/tip.png +0 -0
  54. data/doc/images/zbuildr.png +0 -0
  55. data/doc/images/zbuildr.tif +0 -0
  56. data/doc/index.textile +109 -0
  57. data/doc/installing.textile +284 -0
  58. data/doc/languages.textile +599 -0
  59. data/doc/mailing_lists.textile +29 -0
  60. data/doc/more_stuff.textile +845 -0
  61. data/doc/packaging.textile +618 -0
  62. data/doc/preface.textile +54 -0
  63. data/doc/projects.textile +276 -0
  64. data/doc/quick_start.textile +210 -0
  65. data/doc/releasing.textile +117 -0
  66. data/doc/scripts/buildr-git.rb +512 -0
  67. data/doc/scripts/gitflow.rb +296 -0
  68. data/doc/scripts/install-jruby.sh +44 -0
  69. data/doc/scripts/install-linux.sh +73 -0
  70. data/doc/scripts/install-osx.sh +52 -0
  71. data/doc/settings_profiles.textile +287 -0
  72. data/doc/testing.textile +247 -0
  73. data/etc/KEYS +189 -0
  74. data/lib/buildr.rb +44 -0
  75. data/lib/buildr/clojure.rb +34 -0
  76. data/lib/buildr/clojure/shell.rb +52 -0
  77. data/lib/buildr/core.rb +34 -0
  78. data/lib/buildr/core/application.rb +700 -0
  79. data/lib/buildr/core/build.rb +516 -0
  80. data/lib/buildr/core/cc.rb +166 -0
  81. data/lib/buildr/core/checks.rb +253 -0
  82. data/lib/buildr/core/common.rb +151 -0
  83. data/lib/buildr/core/compile.rb +622 -0
  84. data/lib/buildr/core/doc.rb +276 -0
  85. data/lib/buildr/core/environment.rb +129 -0
  86. data/lib/buildr/core/filter.rb +404 -0
  87. data/lib/buildr/core/generate.rb +197 -0
  88. data/lib/buildr/core/help.rb +119 -0
  89. data/lib/buildr/core/jrebel.rb +42 -0
  90. data/lib/buildr/core/linux.rb +30 -0
  91. data/lib/buildr/core/osx.rb +46 -0
  92. data/lib/buildr/core/progressbar.rb +161 -0
  93. data/lib/buildr/core/project.rb +975 -0
  94. data/lib/buildr/core/run.rb +43 -0
  95. data/lib/buildr/core/shell.rb +137 -0
  96. data/lib/buildr/core/test.rb +843 -0
  97. data/lib/buildr/core/transports.rb +575 -0
  98. data/lib/buildr/core/util.rb +537 -0
  99. data/lib/buildr/groovy.rb +20 -0
  100. data/lib/buildr/groovy/bdd.rb +106 -0
  101. data/lib/buildr/groovy/compiler.rb +153 -0
  102. data/lib/buildr/groovy/doc.rb +76 -0
  103. data/lib/buildr/groovy/shell.rb +57 -0
  104. data/lib/buildr/ide.rb +19 -0
  105. data/lib/buildr/ide/eclipse.rb +427 -0
  106. data/lib/buildr/ide/eclipse/java.rb +53 -0
  107. data/lib/buildr/ide/eclipse/plugin.rb +71 -0
  108. data/lib/buildr/ide/eclipse/scala.rb +68 -0
  109. data/lib/buildr/ide/idea.rb +576 -0
  110. data/lib/buildr/java.rb +25 -0
  111. data/lib/buildr/java/ant.rb +94 -0
  112. data/lib/buildr/java/bdd.rb +460 -0
  113. data/lib/buildr/java/cobertura.rb +297 -0
  114. data/lib/buildr/java/commands.rb +223 -0
  115. data/lib/buildr/java/compiler.rb +135 -0
  116. data/lib/buildr/java/deprecated.rb +141 -0
  117. data/lib/buildr/java/doc.rb +86 -0
  118. data/lib/buildr/java/ecj.rb +69 -0
  119. data/lib/buildr/java/emma.rb +244 -0
  120. data/lib/buildr/java/external.rb +73 -0
  121. data/lib/buildr/java/jruby.rb +122 -0
  122. data/lib/buildr/java/jtestr_result.rb +295 -0
  123. data/lib/buildr/java/jtestr_runner.rb.erb +116 -0
  124. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  125. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +142 -0
  126. data/lib/buildr/java/packaging.rb +734 -0
  127. data/lib/buildr/java/pom.rb +178 -0
  128. data/lib/buildr/java/rjb.rb +154 -0
  129. data/lib/buildr/java/test_result.rb +101 -0
  130. data/lib/buildr/java/tests.rb +362 -0
  131. data/lib/buildr/java/version_requirement.rb +172 -0
  132. data/lib/buildr/packaging.rb +25 -0
  133. data/lib/buildr/packaging/archive.rb +535 -0
  134. data/lib/buildr/packaging/artifact.rb +904 -0
  135. data/lib/buildr/packaging/artifact_namespace.rb +984 -0
  136. data/lib/buildr/packaging/artifact_search.rb +140 -0
  137. data/lib/buildr/packaging/gems.rb +105 -0
  138. data/lib/buildr/packaging/package.rb +249 -0
  139. data/lib/buildr/packaging/repository_array.rb +108 -0
  140. data/lib/buildr/packaging/tar.rb +189 -0
  141. data/lib/buildr/packaging/version_requirement.rb +192 -0
  142. data/lib/buildr/packaging/zip.rb +178 -0
  143. data/lib/buildr/packaging/ziptask.rb +356 -0
  144. data/lib/buildr/resources/buildr.icns +0 -0
  145. data/lib/buildr/resources/completed.png +0 -0
  146. data/lib/buildr/resources/failed.png +0 -0
  147. data/lib/buildr/resources/icons-license.txt +17 -0
  148. data/lib/buildr/run.rb +195 -0
  149. data/lib/buildr/scala.rb +26 -0
  150. data/lib/buildr/scala/bdd.rb +118 -0
  151. data/lib/buildr/scala/compiler.rb +242 -0
  152. data/lib/buildr/scala/doc.rb +142 -0
  153. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  154. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
  155. data/lib/buildr/scala/shell.rb +52 -0
  156. data/lib/buildr/scala/tests.rb +171 -0
  157. data/lib/buildr/shell.rb +185 -0
  158. data/lib/buildr/version.rb +18 -0
  159. data/rakelib/all-in-one.rake +113 -0
  160. data/rakelib/checks.rake +57 -0
  161. data/rakelib/doc.rake +137 -0
  162. data/rakelib/metrics.rake +39 -0
  163. data/rakelib/package.rake +73 -0
  164. data/rakelib/release.rake +160 -0
  165. data/rakelib/rspec.rake +91 -0
  166. data/rakelib/setup.rake +66 -0
  167. data/rakelib/stage.rake +220 -0
  168. data/spec/addon/bnd_spec.rb +330 -0
  169. data/spec/addon/drb_spec.rb +328 -0
  170. data/spec/addon/jaxb_xjc_spec.rb +125 -0
  171. data/spec/core/application_spec.rb +631 -0
  172. data/spec/core/build_spec.rb +837 -0
  173. data/spec/core/cc_spec.rb +224 -0
  174. data/spec/core/checks_spec.rb +519 -0
  175. data/spec/core/common_spec.rb +725 -0
  176. data/spec/core/compile_spec.rb +658 -0
  177. data/spec/core/doc_spec.rb +195 -0
  178. data/spec/core/extension_spec.rb +201 -0
  179. data/spec/core/generate_spec.rb +33 -0
  180. data/spec/core/project_spec.rb +772 -0
  181. data/spec/core/run_spec.rb +93 -0
  182. data/spec/core/shell_spec.rb +146 -0
  183. data/spec/core/test_spec.rb +1320 -0
  184. data/spec/core/transport_spec.rb +544 -0
  185. data/spec/core/util_spec.rb +141 -0
  186. data/spec/groovy/bdd_spec.rb +80 -0
  187. data/spec/groovy/compiler_spec.rb +251 -0
  188. data/spec/groovy/doc_spec.rb +65 -0
  189. data/spec/ide/eclipse_spec.rb +739 -0
  190. data/spec/ide/idea_spec.rb +1145 -0
  191. data/spec/java/ant_spec.rb +37 -0
  192. data/spec/java/bdd_spec.rb +374 -0
  193. data/spec/java/cobertura_spec.rb +112 -0
  194. data/spec/java/commands_spec.rb +93 -0
  195. data/spec/java/compiler_spec.rb +252 -0
  196. data/spec/java/doc_spec.rb +56 -0
  197. data/spec/java/ecj_spec.rb +115 -0
  198. data/spec/java/emma_spec.rb +121 -0
  199. data/spec/java/external_spec.rb +56 -0
  200. data/spec/java/java_spec.rb +132 -0
  201. data/spec/java/packaging_spec.rb +1266 -0
  202. data/spec/java/run_spec.rb +78 -0
  203. data/spec/java/test_coverage_helper.rb +257 -0
  204. data/spec/java/tests_spec.rb +497 -0
  205. data/spec/packaging/archive_spec.rb +775 -0
  206. data/spec/packaging/artifact_namespace_spec.rb +743 -0
  207. data/spec/packaging/artifact_spec.rb +1074 -0
  208. data/spec/packaging/packaging_helper.rb +63 -0
  209. data/spec/packaging/packaging_spec.rb +719 -0
  210. data/spec/packaging/repository_array_spec.rb +109 -0
  211. data/spec/sandbox.rb +165 -0
  212. data/spec/scala/bdd_spec.rb +124 -0
  213. data/spec/scala/compiler_spec.rb +289 -0
  214. data/spec/scala/doc_spec.rb +88 -0
  215. data/spec/scala/scala.rb +38 -0
  216. data/spec/scala/tests_spec.rb +283 -0
  217. data/spec/spec_helpers.rb +369 -0
  218. data/spec/version_requirement_spec.rb +143 -0
  219. data/spec/xpath_matchers.rb +121 -0
  220. metadata +600 -0
data/etc/KEYS ADDED
@@ -0,0 +1,189 @@
1
+ This file contains the PGP keys of various developers.
2
+
3
+ Users: pgp < KEYS
4
+ gpg --import KEYS
5
+ Developers:
6
+ pgp -kxa <your name> and append it to this file.
7
+ (pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
8
+ (gpg --list-sigs <your name>
9
+ && gpg --armor --export <your name>) >> this file.
10
+
11
+
12
+ pub 1024D/4A9EA70E 2007-08-27
13
+ uid Matthieu Riou (CODE SIGNING KEY) <mriou@apache.org>
14
+ sig 3 4A9EA70E 2007-08-27 Matthieu Riou (CODE SIGNING KEY) <mriou@apache.org>
15
+ sub 2048g/2BB53026 2007-08-27
16
+ sig 4A9EA70E 2007-08-27 Matthieu Riou (CODE SIGNING KEY) <mriou@apache.org>
17
+
18
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
19
+ Version: GnuPG v1.4.6 (GNU/Linux)
20
+
21
+ mQGiBEbTJ5sRBADMkb8JsY99WJrjC4UhurXgVXpZgvYZos5g1emZsNh8CE13rPOF
22
+ LQEwBUsotxbbyLdvqp5o1wzWsZWMMe/4IL6Wx0CWDAXLkank/oogRvgrlckJBJ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jGOTO7OwBYkIR0GossAAwUIALvlj5JTYFWoj+u/pa5qovgx702G
39
+ Rrw4dgMiqKdVYWJZahjmUjs9uqCI1nVROKeSHs3j+3kxH8YGHBlkJo/6yicrZpIm
40
+ mO74Abxi0+yjN9T7GpuZ9rYnYNvBSUA5hqEuMGFOeSU8ZznPsG7fBTWhuknxxOrU
41
+ mGjHGOQZXwcq0GSzZwVGkBZ1gIb0a4wwsk86uMubi5bD3I0MSVWh2ZUBZfAr5MPg
42
+ dQ1PI9tib1G6J0JhKY+95yOwujdqrmpBxdRtxN3IMIzpe2nBwlkP9CDNKhJn+sKB
43
+ MRClYk6vHp6Q+W4ikln/P62H0CrOfh3jzAYfNcW/lxlp6ZbsRVrwhr+nM3mISQQY
44
+ EQIACQUCRtMnvQIbDAAKCRD6yNe+Sp6nDppoAJ0ZNcruq5Jc0aZ1yvNLQORewQa7
45
+ WQCgn7JcUG0i3/7Kk4101XIhgfNgXww=
46
+ =dGgn
47
+ -----END PGP PUBLIC KEY BLOCK-----
48
+
49
+
50
+ pub 1024D/2EED13CE 2007-05-09
51
+ uid Alex Boisvert (CODE SIGNING KEY) <alex.boisvert@gmail.com>
52
+ sig 3 2EED13CE 2007-05-09 Alex Boisvert (CODE SIGNING KEY) <alex.boisvert@gmail.com>
53
+ sub 1024g/54BC5E9F 2007-05-09
54
+ sig 2EED13CE 2007-05-09 Alex Boisvert (CODE SIGNING KEY) <alex.boisvert@gmail.com>
55
+
56
+
57
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
58
+ Version: GnuPG v1.4.6 (GNU/Linux)
59
+
60
+ mQGiBEZCQ80RBACdngN/JZod5XLn8Was2AbSutxP/H5WssX/StS+0BLNRn+FMhtn
61
+ xXKkJwqKtqbKoHzEKKziQHybD5AfXSBj21l2iZXPfcwfsJJVpDmwBr7p6SPXdNEY
62
+ eDoSW8ZVsA81m/Oc/kxbglVSiH39O3olrQ7bwaKyBMR2QkjxynJYGImtFwCg8FKy
63
+ tPJRTUaXH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Ptl8
79
+ sGH4v6GYUVHyfKnWKbg=
80
+ =X6Yk
81
+ -----END PGP PUBLIC KEY BLOCK-----
82
+
83
+
84
+ pub 1024D/14A8A2BA 2007-06-12
85
+ uid Assaf Arkin <assaf@apache.org>
86
+ sig 3 14A8A2BA 2007-06-12 Assaf Arkin <assaf@apache.org>
87
+ sub 2048g/8CA2779E 2007-06-12
88
+ sig 14A8A2BA 2007-06-12 Assaf Arkin <assaf@apache.org>
89
+
90
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
91
+ Version: GnuPG v1.4.7 (GNU/Linux)
92
+
93
+ mQGiBEZvELsRBADBaOF4FVOIkkzA6XlK4lX8TbV5J3crP4M+1I5BWuKsA5oZYCkX
94
+ ARjYfSC62K2fsTSwGTU6M684M+DOKljhjFhs24bL7Yr/1iAEh1RC+aQJ0HJw8ME4
95
+ yxU/WSez6KzQJ8fV7M6MOg9fwI3pf27USf91cdbjLMdi4mvAIbkA/ECi7wCgveA6
96
+ nXpXF8fsKkr+Ijl5FBWYlA0EAIQRzcX12CkFOtJsGHkzZpcInKZkimBKUxrL0lK0
97
+ /EahOPpWjzHdV64OVspgnFECmipwQBLzNAH16XEb9ikwum0PCKj4BnIgkmFjZfFA
98
+ lHLQTqN+JeSCDHI1vxwPfKh2MOrCbCU3EBQgcWhO/WakK/AXyu9bertGum1oNAc/
99
+ LkFkA/sE1/7A2ZMyQVYxwigcYjI5FpfA3PI/Irxup38bQ4atuQrLx/vLbNrDPStw
100
+ yECB6oo3/acjGDkoEH9dergxyID4aZaGb3vJmtuzNrxJzxIkHepodTN0hXi2kLft
101
+ K0B6Vo6Ufv9eaeHnEf/1460JbDAq7w2g5JTnFkRnnWKet+ghQLQeQXNzYWYgQXJr
102
+ aW4gPGFzc2FmQGFwYWNoZS5vcmc+iGAEExECACAFAkZvELsCGwMGCwkIBwMCBBUC
103
+ CAMEFgIDAQIeAQIXgAAKCRDXkC1vFKiiuoEUAJ9rm/RkZdJSP9bGmcE3cteTa/IG
104
+ JwCeOxg1QVZ0qv6kjOM2RxfaHJeD3EC5Ag0ERm8QuxAIAIeYs8PNbNLFnaXV7Y/N
105
+ UJ07s1D/0+USJwUVJ/SX4AVyx8CYVMXo+lu9le+JeJfVI2dRlbIes2H8o4WevOP8
106
+ k831oUfqgLF8FKjYE/2Gt6vDWRT9kcN/mxTo0NeVhAIEVSI1Nkppj1B+05IXEJvb
107
+ ZaS4GXW/tXXthVTtgHvjEA0maWMMFvUz1HlfEoepzsKTxxiGQJeRIz4hyRE1nuV+
108
+ bUIXItUYBBaj1Y5prQkzI2WjA75hw+4ZeHYM7wgzWP/1MZwylUicvYsEtJeKXZRw
109
+ IZrKZelffcIZB3OZMUQuJyFMcRz5AVgHLuFTfG7yMLTMxWTNa2b09p8l0TnJuhbI
110
+ 0g8AAwUH/iAEbtT42jvt+EsJIz37K1yV5RMKA6ApAsbRkNOAwXQgdEqky/c26KBa
111
+ Ug4nAdAUm+5Hkx/R3F2wKsxSWiWneNM93tInQH0xdfHPCICfmyUPzTS0igEktqQw
112
+ AWYpegKNXzKg+SmKJZsME50bgEZCB2zPIp/AHmG4SbI9THYvPjHbQKf0yzIO0dIw
113
+ xPxKI0dFSASg3oebANtLAUIPIV/QLNWhPwxT/Qe3aBNc5rfl7vSkVv7loBHE/1lj
114
+ ++MUlrkmzegJAg9u9GSEfoxFjVbK176IdlJoflZnv1pFkGRbBvOaaCVCllLVJMZS
115
+ HlzsreJCFPVgnK3/PMUn2XauF9Y9MjCISQQYEQIACQUCRm8QuwIbDAAKCRDXkC1v
116
+ FKiiuuCjAJ9UhVa0wHAzYXPJatNdgbkHJuQOqgCbB+lDb7ZGGjC9wToAI/ha1Pz+
117
+ T6Y=
118
+ =uoUw
119
+ -----END PGP PUBLIC KEY BLOCK-----
120
+
121
+
122
+ pub 1024D/E81722E2 2008-02-26
123
+ uid Victor Hugo Borja <vborja@apache.org>
124
+ sig 3 E81722E2 2008-02-26 Victor Hugo Borja <vborja@apache.org>
125
+ sub 1024g/699A572F 2008-02-26
126
+ sig E81722E2 2008-02-26 Victor Hugo Borja <vborja@apache.org>
127
+
128
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
129
+ Version: GnuPG v2.0.7 (GNU/Linux)
130
+
131
+ mQGiBEfEVisRBACR0KeNHllX/Vc8nSe/MSLRqjdPpbH4GR8UBZ18+CUBbx+Q98IQ
132
+ INOAOMNGcPdBoM9yzz01DBEfml6+DMlBGrUc375ZuxaML/UuD4V1kMqgHb7AaMNF
133
+ Wnyk1OMUHiYOiK3ycrYBvr955OLFX3EhUj9F6vJ9URiWczqyze3d5TJdpwCg6ar2
134
+ dAOdxAqhK8qRPSwU3Kt1K8EEAIGB9wifaDoaJmbHn1iV7ixnePh9I9/ZR1ZkaYS2
135
+ uiKprkG57H9b2D04hV178JGT4scCHMXkIYi0VscceDGSgcK0wbC51K8x9h+1rCev
136
+ ZwYm7jewE0luZiD0qN3yz0MHduiTbT7E/mzVRBgkM+xsiJ+miCUniIzZLqz3uKGf
137
+ bMk7A/wM1lQHJL1xNlHU38jYB+NiRTVSJhB8oxofJp21abDHfIPz/qQqswQRSTYb
138
+ G8RvfW5z2oo4AUCYCcKZ+UWR8bSVP2EJqCdu9reTd+6uXm+hv2c2nvZn/jMFWkXW
139
+ JW+aaZWUe3N3/OPXFG8ttpl19Un+FH0OGR7l+9AWoMS/I3Htr7QlVmljdG9yIEh1
140
+ Z28gQm9yamEgPHZib3JqYUBhcGFjaGUub3JnPohgBBMRAgAgBQJHxFYrAhsjBgsJ
141
+ CAcDAgQVAggDBBYCAwECHgECF4AACgkQkUCoHegXIuJL9ACfebcPLROkKM6XBYXL
142
+ M39R32m/NgkAn1i3x/Lp8Dzmt1uSIAQPwUXao/O+uQENBEfEVisQBAD97+MoNSit
143
+ YyGYtpXmYa30SB8rirX6zad+l2Vo6uPtT8xH8zOsmCLQuiLakbuia9QsWFkguw02
144
+ tfZsuAQ8Q4IJvWyPsoFIYXo6Ta4MSDFO2ids6LEJ6GRT2cc7zE4b77RuZkIYNSFO
145
+ XL10qAGQmbCnSWiYADnNv2jyp/NXEVz22wADBQP/T1tmohMlY2Q93cj8amBWP3ko
146
+ dYlP6WJj80iSjLOO5NGlw89aPG2K5mw2WpN729ImZYhzP13rx7uFovb4+103nrJQ
147
+ Ajt5Ierk8kbjO9yM75Y2+84McRiR8JCld2WJFNXXwKCIWuh6+UtGPqafxHccKQYv
148
+ 54Cy+AeemCKSdSlc3VqISQQYEQIACQUCR8RWKwIbDAAKCRCRQKgd6Bci4pE1AKCC
149
+ QKtVPfIqp4oI8qSfsZ0gMafFRwCfTqvRMVFyLEnygWnhpxgJRYk+8Fc=
150
+ =ryOG
151
+ -----END PGP PUBLIC KEY BLOCK-----
152
+
153
+
154
+ pub 2048R/191DFA62 2010-03-15
155
+ uid Antoine Toulme <antoine@lunar-ocean.com>
156
+ sig 3 191DFA62 2010-03-15 Antoine Toulme <antoine@lunar-ocean.com>
157
+ sub 2048R/F82CCCA4 2010-03-15
158
+ sig 191DFA62 2010-03-15 Antoine Toulme <antoine@lunar-ocean.com>
159
+
160
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
161
+ Version: GnuPG v1.4.10 (Darwin)
162
+
163
+ mQENBEud3FYBCACjGYLotue6+saF39/Yim+UrSnLgsM6hwPETpwOawQOKUuEd8/N
164
+ I07bCXI7HHgeBHQ0ENTWqH4hO1CoyKDsIChY37GYLZkx7KS8HVCxg/b6DNVp5vTi
165
+ oHm8XTGvdVzkvoKj4Se0T+jpTfVYoiq8CRY0jH3Wqxs8QGfVGVkVJ9hgz8UyJUyB
166
+ 7PidE0P4U/xmZ3lMzxWr9d1TabNjCQmtgRgoi8auX3VP0TXJbedPXPF3xuhbFSWl
167
+ LAZhujzZwefGvJk9XX1lsA2BnMvTBC9PJqCbfaRE+3/bl3Cwq8CtyOjJ4O9i1ie8
168
+ +exUX8RSitlP3uxMJoFR2z/qHeRTors5d1DfABEBAAG0KEFudG9pbmUgVG91bG1l
169
+ IDxhbnRv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2PExCIWHglmsaPPj4NBAQxg/M8Na
185
+ n5F6Rq2K6rOE1x882i5wNsgAEb1iOFEUE1ctYSNbmO6JQfFyvz0cKpdmW52/iC41
186
+ sIHg4pUCB3Z7wT6vvSs/eQ3jARt7mok3JE56JL0sV2+Z2SePiFUn/ixKdn1lKP8d
187
+ +THIYJ/ZdpxUZeNKy7f1djoctqAk5T7ujVJh2d6xRXwqvQcJKoeW
188
+ =6E9O
189
+ -----END PGP PUBLIC KEY BLOCK-----
data/lib/buildr.rb ADDED
@@ -0,0 +1,44 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ unless defined?(Buildr::VERSION)
17
+ require 'buildr/version'
18
+ end
19
+
20
+ require 'buildr/core'
21
+ require 'buildr/packaging'
22
+ require 'buildr/java'
23
+ require 'buildr/ide'
24
+ require 'buildr/shell'
25
+ require 'buildr/run'
26
+
27
+ # Methods defined in Buildr are both instance methods (e.g. when included in Project)
28
+ # and class methods when invoked like Buildr.artifacts().
29
+ module Buildr ; extend self ; end
30
+
31
+ # The Buildfile object (self) has access to all the Buildr methods and constants.
32
+ class << self ; include Buildr ; end
33
+
34
+ # All modules defined under Buildr::* can be referenced without Buildr:: prefix
35
+ # unless a conflict exists (e.g. Buildr::RSpec vs ::RSpec)
36
+ class Object #:nodoc:
37
+ Buildr.constants.each do |name|
38
+ const = Buildr.const_get(name)
39
+ if const.is_a?(Module)
40
+ const_set name, const unless const_defined?(name)
41
+ end
42
+ end
43
+ end
44
+
@@ -0,0 +1,34 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ require 'buildr/core/util'
18
+
19
+ module Buildr::Clojure
20
+
21
+ REQUIRES = ArtifactNamespace.for(self) do |ns|
22
+ ns.clojure! 'org.clojure:clojure:jar:1.2.0'
23
+ ns.jline! 'jline:jline:jar:0.9.94'
24
+ end
25
+
26
+ class << self
27
+ def dependencies #:nodoc:
28
+ REQUIRES.artifacts
29
+ end
30
+ end
31
+
32
+ end
33
+
34
+ require 'buildr/clojure/shell'
@@ -0,0 +1,52 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ module Buildr::Shell
17
+
18
+ class Clojure < Base
19
+ include JRebel
20
+
21
+ specify :name => :clj, :lang => :clojure
22
+
23
+ # don't build if it's *only* Clojure sources
24
+ def build?
25
+ !has_source?(:clojure) or has_source?(:java) or has_source?(:scala) or has_source?(:groovy)
26
+ end
27
+
28
+ def launch(task)
29
+ cp = project.compile.dependencies +
30
+ ::Buildr::Clojure.dependencies +
31
+ [ build? ? project.path_to(:target, :classes) : project.path_to(:src, :main, :clojure) ]
32
+
33
+ Java::Commands.java 'jline.ConsoleRunner', 'clojure.lang.Repl', {
34
+ :properties => jrebel_props(project).merge(task.properties),
35
+ :classpath => cp,
36
+ :java_args => jrebel_args + task.java_args
37
+ }
38
+ end
39
+
40
+ private
41
+ def clojure_home
42
+ @home ||= ENV['CLOJURE_HOME']
43
+ end
44
+
45
+ def has_source?(lang)
46
+ File.exists? project.path_to(:src, :main, lang)
47
+ end
48
+ end
49
+ end
50
+
51
+ Buildr::Shell.providers << Buildr::Shell::Clojure
52
+
@@ -0,0 +1,34 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'buildr/core/common'
17
+ require 'buildr/core/application'
18
+ require 'buildr/core/jrebel'
19
+ require 'buildr/core/project'
20
+ require 'buildr/core/environment'
21
+ require 'buildr/core/help'
22
+ require 'buildr/core/build'
23
+ require 'buildr/core/filter'
24
+ require 'buildr/core/compile'
25
+ require 'buildr/core/test'
26
+ require 'buildr/core/shell'
27
+ require 'buildr/core/run'
28
+ require 'buildr/core/checks'
29
+ require 'buildr/core/transports'
30
+ require 'buildr/core/generate'
31
+ require 'buildr/core/cc'
32
+ require 'buildr/core/osx' if RUBY_PLATFORM =~ /darwin/
33
+ require 'buildr/core/linux' if RUBY_PLATFORM =~ /linux/
34
+
@@ -0,0 +1,700 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ # Portion of this file derived from Rake.
18
+ # Copyright (c) 2003, 2004 Jim Weirich
19
+ #
20
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
21
+ # of this software and associated documentation files (the "Software"), to deal
22
+ # in the Software without restriction, including without limitation the rights
23
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24
+ # copies of the Software, and to permit persons to whom the Software is
25
+ # furnished to do so, subject to the following conditions:
26
+ #
27
+ # The above copyright notice and this permission notice shall be included in
28
+ # all copies or substantial portions of the Software.
29
+ #
30
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36
+ # SOFTWARE.
37
+
38
+
39
+ require 'rake'
40
+ require 'highline/import'
41
+ require 'rubygems/source_info_cache' if Gem::VERSION =~ /1.[0-4]/
42
+ require 'buildr/core/util'
43
+ Gem.autoload :SourceInfoCache, 'rubygems/source_info_cache' if Gem::VERSION =~ /1.[0-4]/
44
+
45
+
46
+ # Gem::user_home is nice, but ENV['HOME'] lets you override from the environment.
47
+ ENV['HOME'] ||= File.expand_path(Gem::user_home)
48
+ ENV['BUILDR_ENV'] ||= 'development'
49
+
50
+
51
+ module Buildr
52
+
53
+ # Provide settings that come from three sources.
54
+ #
55
+ # User settings are placed in the .buildr/settings.yaml file located in the user's home directory.
56
+ # They should only be used for settings that are specific to the user and applied the same way
57
+ # across all builds. Example for user settings are preferred repositories, path to local repository,
58
+ # user/name password for uploading to remote repository.
59
+ #
60
+ # Build settings are placed in the build.yaml file located in the build directory. They help keep
61
+ # the buildfile and build.yaml file simple and readable, working to the advantages of each one.
62
+ # Example for build settings are gems, repositories and artifacts used by that build.
63
+ #
64
+ # Profile settings are placed in the profiles.yaml file located in the build directory. They provide
65
+ # settings that differ in each environment the build runs in. For example, URLs and database
66
+ # connections will be different when used in development, test and production environments.
67
+ # The settings for the current environment are obtained by calling #profile.
68
+ class Settings
69
+
70
+ def initialize(application) #:nodoc:
71
+ @application = application
72
+ end
73
+
74
+ # User settings loaded from setting.yaml file in user's home directory.
75
+ def user
76
+ @user ||= load_from('settings', @application.home_dir)
77
+ end
78
+
79
+ # Build settings loaded from build.yaml file in build directory.
80
+ def build
81
+ @build ||= load_from('build')
82
+ end
83
+
84
+ # Profiles loaded from profiles.yaml file in build directory.
85
+ def profiles
86
+ @profiles ||= load_from('profiles')
87
+ end
88
+
89
+ # :call-seq:
90
+ # profile => hash
91
+ #
92
+ # Returns the profile for the current environment.
93
+ def profile
94
+ profiles[@application.environment] ||= {}
95
+ end
96
+
97
+ private
98
+
99
+ def load_from(name, path = nil)
100
+ unless path
101
+ fail "Internal error: attempting to access local setting before buildfile located" unless @application.rakefile
102
+ path = File.dirname(@application.rakefile)
103
+ end
104
+ file_name = ['yaml', 'yml'].map { |ext| File.join(path, "#{name}.#{ext}") }.find { |fn| File.exist?(fn) }
105
+ return {} unless file_name
106
+ yaml = YAML.load(File.read(file_name)) || {}
107
+ fail "Expecting #{file_name} to be a map (name: value)!" unless Hash === yaml
108
+ @application.buildfile.enhance [file_name]
109
+ yaml
110
+ end
111
+
112
+ end
113
+
114
+
115
+ class Application < Rake::Application #:nodoc:
116
+
117
+ # Deprecated: rakefile/Rakefile, removed in 1.5
118
+ DEFAULT_BUILDFILES = ['buildfile', 'Buildfile', 'buildfile.rb', 'Buildfile.rb'] + DEFAULT_RAKEFILES
119
+
120
+ attr_reader :rakefiles, :requires
121
+ private :rakefiles, :requires
122
+
123
+ def initialize
124
+ super
125
+ @rakefiles = DEFAULT_BUILDFILES.dup
126
+ @top_level_tasks = []
127
+ @home_dir = File.expand_path('.buildr', ENV['HOME'])
128
+ mkpath @home_dir if !File.exist?(@home_dir) && File.writable?(ENV['HOME'])
129
+ @settings = Settings.new(self)
130
+ @on_completion = []
131
+ @on_failure = []
132
+ end
133
+
134
+ def run
135
+ standard_exception_handling do
136
+ init 'Buildr'
137
+ load_buildfile
138
+ top_level
139
+ end
140
+ end
141
+
142
+ # Not for external consumption.
143
+ def switch_to_namespace(names) #:nodoc:
144
+ current, @scope = @scope, names
145
+ begin
146
+ yield
147
+ ensure
148
+ @scope = current
149
+ end
150
+ end
151
+
152
+ # Returns list of Gems associated with this buildfile, as listed in build.yaml.
153
+ # Each entry is of type Gem::Specification.
154
+ attr_reader :gems
155
+
156
+ # Buildr home directory, .buildr under user's home directory.
157
+ attr_reader :home_dir
158
+
159
+ # Copied from BUILD_ENV.
160
+ def environment
161
+ ENV['BUILDR_ENV']
162
+ end
163
+
164
+ # Returns the Settings associated with this build.
165
+ attr_reader :settings
166
+
167
+ # :call-seq:
168
+ # buildfile
169
+ # Returns the buildfile as a task that you can use as a dependency.
170
+ def buildfile
171
+ @buildfile_task ||= BuildfileTask.define_task(File.expand_path(rakefile))
172
+ end
173
+
174
+ # Files that complement the buildfile itself
175
+ def build_files #:nodoc:
176
+ deprecated 'Please call buildfile.prerequisites instead'
177
+ buildfile.prerequisites
178
+ end
179
+
180
+ # Yields to block on successful completion. Primarily used for notifications.
181
+ def on_completion(&block)
182
+ @on_completion << block
183
+ end
184
+
185
+ # Yields to block on failure with exception. Primarily used for notifications.
186
+ def on_failure(&block)
187
+ @on_failure << block
188
+ end
189
+
190
+ # Call on_completion hooks with the given title and message
191
+ def build_completed(title, message)
192
+ @on_completion.each do |block|
193
+ block.call(title, message) rescue nil
194
+ end
195
+ end
196
+
197
+ # Call on_failure hooks with the given title, message and exception
198
+ def build_failed(title, message, ex = nil)
199
+ @on_failure.each do |block|
200
+ block.call(title, message, ex) rescue nil
201
+ end
202
+ end
203
+
204
+ # :call-seq:
205
+ # deprecated(message)
206
+ #
207
+ # Use with deprecated methods and classes. This method automatically adds the file name and line number,
208
+ # and the text 'Deprecated' before the message, and eliminated duplicate warnings. It only warns when
209
+ # running in verbose mode.
210
+ #
211
+ # For example:
212
+ # deprecated 'Please use new_foo instead of foo.'
213
+ def deprecated(message) #:nodoc:
214
+ return unless verbose
215
+ "#{caller[1]}: Deprecated: #{message}".tap do |message|
216
+ @deprecated ||= {}
217
+ unless @deprecated[message]
218
+ @deprecated[message] = true
219
+ warn message
220
+ end
221
+ end
222
+ end
223
+
224
+ protected
225
+
226
+ def load_buildfile # replaces load_rakefile
227
+ standard_exception_handling do
228
+ find_buildfile
229
+ load_gems
230
+ load_artifact_ns
231
+ load_tasks
232
+ raw_load_buildfile
233
+ end
234
+ end
235
+
236
+ def top_level # adds on_completion hook
237
+ standard_exception_handling do
238
+ if options.show_tasks
239
+ display_tasks_and_comments
240
+ elsif options.show_prereqs
241
+ display_prerequisites
242
+ elsif options.execute
243
+ eval options.execute
244
+ else
245
+ @start = Time.now
246
+ top_level_tasks.each { |task_name| invoke_task(task_name) }
247
+ if verbose
248
+ elapsed = Time.now - @start
249
+ real = []
250
+ real << ('%ih' % (elapsed / 3600)) if elapsed >= 3600
251
+ real << ('%im' % ((elapsed / 60) % 60)) if elapsed >= 60
252
+ real << ('%.3fs' % (elapsed % 60))
253
+ puts $terminal.color("Completed in #{real.join}", :green)
254
+ end
255
+ # On OS X this will load Cocoa and Growl which takes half a second we
256
+ # don't want to measure, so put this after the console message.
257
+ title, message = "Your build has completed", "#{Dir.pwd}\nbuildr #{@top_level_tasks.join(' ')}"
258
+ build_completed(title, message)
259
+ end
260
+ end
261
+ end
262
+
263
+ def handle_options
264
+ options.rakelib = ['tasks']
265
+
266
+ OptionParser.new do |opts|
267
+ opts.banner = "buildr [-f rakefile] {options} targets..."
268
+ opts.separator ""
269
+ opts.separator "Options are ..."
270
+
271
+ opts.on_tail("-h", "--help", "-H", "Display this help message.") do
272
+ puts opts
273
+ exit 0
274
+ end
275
+ standard_buildr_options.each { |args| opts.on(*args) }
276
+ end.parse!
277
+ end
278
+
279
+ def standard_buildr_options # replaces standard_rake_options
280
+ [
281
+ ['--describe', '-D [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
282
+ lambda { |value|
283
+ options.show_tasks = true
284
+ options.full_description = true
285
+ options.show_task_pattern = Regexp.new(value || '')
286
+ }
287
+ ],
288
+ ['--execute', '-E CODE',
289
+ "Execute some Ruby code after loading the buildfile",
290
+ lambda { |value| options.execute = value }
291
+ ],
292
+ ['--environment', '-e ENV',
293
+ "Environment name (e.g. development, test, production).",
294
+ lambda { |value| ENV['BUILDR_ENV'] = value }
295
+ ],
296
+ ['--generate [PATH]',
297
+ "Generate buildfile from either pom.xml file or directory path.",
298
+ lambda { |value|
299
+ value ||= File.exist?('pom.xml') ? 'pom.xml' : Dir.pwd
300
+ raw_generate_buildfile value
301
+ exit 0
302
+ }
303
+ ],
304
+ ['--libdir', '-I LIBDIR', "Include LIBDIR in the search path for required modules.",
305
+ lambda { |value| $:.push(value) }
306
+ ],
307
+ ['--prereqs', '-P [PATTERN]', "Display the tasks and dependencies (matching optional PATTERN), then exit.",
308
+ lambda { |value|
309
+ options.show_prereqs = true
310
+ options.show_task_pattern = Regexp.new(value || '')
311
+ }
312
+ ],
313
+ ['--quiet', '-q', "Do not log messages to standard output.",
314
+ lambda { |value| verbose(false) }
315
+ ],
316
+ ['--buildfile', '-f FILE', "Use FILE as the buildfile.",
317
+ lambda { |value|
318
+ @rakefiles.clear
319
+ @rakefiles << value
320
+ }
321
+ ],
322
+ ['--rakelibdir', '--rakelib', '-R PATH',
323
+ "Auto-import any .rake files in PATH. (default is 'tasks')",
324
+ lambda { |value| options.rakelib = value.split(':') }
325
+ ],
326
+ ['--require', '-r MODULE', "Require MODULE before executing rakefile.",
327
+ lambda { |value|
328
+ begin
329
+ require value
330
+ rescue LoadError => ex
331
+ begin
332
+ rake_require value
333
+ rescue LoadError => ex2
334
+ raise ex
335
+ end
336
+ end
337
+ }
338
+ ],
339
+ ['--rules', "Trace the rules resolution.",
340
+ lambda { |value| options.trace_rules = true }
341
+ ],
342
+ ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Rakefile.",
343
+ lambda { |value| options.nosearch = true }
344
+ ],
345
+ ['--silent', '-s', "Like --quiet, but also suppresses the 'in directory' announcement.",
346
+ lambda { |value|
347
+ verbose(false)
348
+ options.silent = true
349
+ }
350
+ ],
351
+ ['--tasks', '-T [PATTERN]', "Display the tasks (matching optional PATTERN) with descriptions, then exit.",
352
+ lambda { |value|
353
+ options.show_tasks = true
354
+ options.show_task_pattern = Regexp.new(value || '')
355
+ options.full_description = false
356
+ }
357
+ ],
358
+ ['--trace', '-t [CATEGORIES]', "Turn on invoke/execute tracing, enable full backtrace.",
359
+ lambda { |value|
360
+ options.trace = true
361
+ options.trace_categories = value ? value.split(',').map { |v| v.downcase.to_sym } : []
362
+ options.trace_all = options.trace_categories.include? :all
363
+ verbose(true)
364
+ }
365
+ ],
366
+ ['--verbose', '-v', "Log message to standard output (default).",
367
+ lambda { |value| verbose(true) }
368
+ ],
369
+ ['--version', '-V', "Display the program version.",
370
+ lambda { |value|
371
+ puts "Buildr #{Buildr::VERSION}#{RUBY_PLATFORM[/java/] ? " (JRuby #{JRUBY_VERSION})" : ""}"
372
+ exit 0
373
+ }
374
+ ],
375
+ ['--offline', '-o', "Do not try to download anything",
376
+ lambda { |value|
377
+ trace 'Working in offline mode; snapshot will not be updated.'
378
+ options.work_offline = true
379
+ }
380
+ ],
381
+ ['--update-snapshots', '-u', "Force updating all dependencies whose version contains SNAPSHOT",
382
+ lambda { |value|
383
+ trace 'Force update of SNAPSHOT artifacts.'
384
+ options.update_snapshots = true
385
+ }
386
+ ]
387
+ ]
388
+ end
389
+
390
+ def find_buildfile
391
+ buildfile, location = find_rakefile_location || (tty_output? && ask_generate_buildfile)
392
+ fail "No Buildfile found (looking for: #{@rakefiles.join(', ')})" if buildfile.nil?
393
+ @rakefile = buildfile
394
+ Dir.chdir(location)
395
+ end
396
+
397
+ def ask_generate_buildfile
398
+ source = choose do |menu|
399
+ menu.header = "To use Buildr you need a buildfile. Do you want me to create one?"
400
+ menu.choice("From Maven2 POM file") { 'pom.xml' } if File.exist?('pom.xml')
401
+ menu.choice("From directory structure") { Dir.pwd }
402
+ menu.choice("Cancel") { }
403
+ end
404
+ if source
405
+ buildfile = raw_generate_buildfile(source)
406
+ [buildfile, File.dirname(buildfile)]
407
+ end
408
+ end
409
+
410
+ def raw_generate_buildfile(source)
411
+ # We need rakefile to be known, for settings.build to be accessible.
412
+ @rakefile = File.expand_path(DEFAULT_BUILDFILES.first)
413
+ fail "Buildfile already exists" if File.exist?(@rakefile) && !(tty_output? && agree('Buildfile exists, overwrite?'))
414
+ script = File.directory?(source) ? Generate.from_directory(source) : Generate.from_maven2_pom(source)
415
+ File.open @rakefile, 'w' do |file|
416
+ file.puts script
417
+ end
418
+ puts "Created #{@rakefile}" if verbose
419
+ @rakefile
420
+ end
421
+
422
+ def raw_load_buildfile # replaces raw_load_rakefile
423
+ puts "(in #{Dir.pwd}, #{environment})" unless options.silent
424
+ load File.expand_path(@rakefile) if @rakefile && @rakefile != ''
425
+ load_imports
426
+ Buildr.projects
427
+ end
428
+
429
+ # Load/install all Gems specified in build.yaml file.
430
+ def load_gems #:nodoc:
431
+ missing_deps, installed = listed_gems.partition { |gem| gem.is_a?(Gem::Dependency) }
432
+ unless missing_deps.empty?
433
+ newly_installed = Util::Gems.install(*missing_deps)
434
+ installed += newly_installed
435
+ end
436
+ installed.each do |spec|
437
+ if gem(spec.name, spec.version.to_s)
438
+ # TODO: is this intended to load rake tasks from the installed gems?
439
+ # We should use a convention like .. if the gem has a _buildr.rb file, load it.
440
+
441
+ #FileList[spec.require_paths.map { |path| File.expand_path("#{path}/*.rb", spec.full_gem_path) }].
442
+ # map { |path| File.basename(path) }.each { |file| require file }
443
+ #FileList[File.expand_path('tasks/*.rake', spec.full_gem_path)].each do |file|
444
+ # Buildr.application.add_import file
445
+ #end
446
+ end
447
+ end
448
+ @gems = installed
449
+ end
450
+
451
+ # Returns Gem::Specification for every listed and installed Gem, Gem::Dependency
452
+ # for listed and uninstalled Gem, which is the installed before loading the buildfile.
453
+ def listed_gems #:nodoc:
454
+ Array(settings.build['gems']).map do |dep|
455
+ name, trail = dep.scan(/^\s*(\S*)\s*(.*)\s*$/).first
456
+ versions = trail.scan(/[=><~!]{0,2}\s*[\d\.]+/)
457
+ versions = ['>= 0'] if versions.empty?
458
+ dep = Gem::Dependency.new(name, versions)
459
+ Gem::SourceIndex.from_installed_gems.search(dep).last || dep
460
+ end
461
+ end
462
+
463
+ # Load artifact specs from the build.yaml file, making them available
464
+ # by name ( ruby symbols ).
465
+ def load_artifact_ns #:nodoc:
466
+ hash = settings.build['artifacts']
467
+ return unless hash
468
+ raise "Expected 'artifacts' element to be a hash" unless Hash === hash
469
+ # Currently we only use one artifact namespace to rule them all. (the root NS)
470
+ Buildr::ArtifactNamespace.load(:root => hash)
471
+ end
472
+
473
+ # Loads buildr.rb files from home/.buildr directory and project directory.
474
+ # Loads custom tasks from .rake files in tasks directory.
475
+ def load_tasks #:nodoc:
476
+ # TODO: this might need to be split up, look for deprecated features, better method name.
477
+ old = File.expand_path('buildr.rb', ENV['HOME'])
478
+ new = File.expand_path('buildr.rb', home_dir)
479
+ if File.exist?(old) && !File.exist?(new)
480
+ warn "Deprecated: Please move buildr.rb from your home directory to the .buildr directory in your home directory"
481
+ end
482
+
483
+ # Load home/.buildr/buildr.rb in preference
484
+ files = [ File.exist?(new) ? new : old, 'buildr.rb' ].select { |file| File.exist?(file) }
485
+ files += [ File.expand_path('buildr.rake', ENV['HOME']), File.expand_path('buildr.rake') ].
486
+ select { |file| File.exist?(file) }.each { |file| warn "Please use '#{file.ext('rb')}' instead of '#{file}'" }
487
+ files += (options.rakelib || []).collect { |rlib| Dir["#{rlib}/*.rake"] }.flatten
488
+
489
+ # Load .buildr/_buildr.rb same directory as buildfile
490
+ %w{.buildr.rb _buildr.rb}.each do |f|
491
+ local_buildr = File.expand_path("#{File.dirname(Buildr.application.buildfile.to_s)}/#{f}")
492
+ files << local_buildr if File.exist?( local_buildr )
493
+ end
494
+
495
+ files.each do |file|
496
+ unless $LOADED_FEATURES.include?(file)
497
+ load file
498
+ $LOADED_FEATURES << file
499
+ end
500
+ end
501
+ buildfile.enhance files
502
+ true
503
+ end
504
+
505
+ def display_tasks_and_comments
506
+ displayable_tasks = tasks.select { |t| t.comment && t.name =~ options.show_task_pattern }
507
+ if options.full_description
508
+ displayable_tasks.each do |t|
509
+ puts "buildr #{t.name_with_args}"
510
+ t.full_comment.split("\n").each do |line|
511
+ puts " #{line}"
512
+ end
513
+ puts
514
+ end
515
+ else
516
+ width = displayable_tasks.collect { |t| t.name_with_args.length }.max || 10
517
+ max_column = truncate_output? ? terminal_width - name.size - width - 7 : nil
518
+ displayable_tasks.each do |t|
519
+ printf "buildr %-#{width}s # %s\n",
520
+ t.name_with_args, max_column ? truncate(t.comment, max_column) : t.comment
521
+ end
522
+ end
523
+ end
524
+
525
+ def display_prerequisites
526
+ displayable_tasks = tasks.select { |t| t.name =~ options.show_task_pattern }
527
+ displayable_tasks.each do |t|
528
+ puts "buildr #{t.name}"
529
+ t.prerequisites.each { |pre| puts " #{pre}" }
530
+ end
531
+ end
532
+
533
+ def standard_exception_handling # adds on_failure hook
534
+ begin
535
+ yield
536
+ rescue SystemExit => ex
537
+ # Exit silently with current status
538
+ exit(ex.status)
539
+ rescue OptionParser::ParseError => ex
540
+ $stderr.puts $terminal.color(ex.message, :red)
541
+ exit(1)
542
+ rescue Exception => ex
543
+ ex_msg = ex.class.name == "Exception" ? ex.message : "#{ex.class.name} : #{ex.message}"
544
+ title, message = "Your build failed with an error", "#{Dir.pwd}:\n#{ex_msg}"
545
+ build_failed(title, message, ex)
546
+ # Exit with error message
547
+ $stderr.puts "Buildr aborted!"
548
+ $stderr.puts $terminal.color(ex_msg, :red)
549
+ if options.trace
550
+ $stderr.puts ex.backtrace.join("\n")
551
+ else
552
+ $stderr.puts ex.backtrace.select { |str| str =~ /#{rakefile}/ }.map { |line| $terminal.color(line, :red) }.join("\n") if rakefile
553
+ $stderr.puts "(See full trace by running task with --trace)"
554
+ end
555
+ exit(1)
556
+ end
557
+ end
558
+
559
+ end
560
+
561
+
562
+ # This task stands for the buildfile and all its associated helper files (e.g., buildr.rb, build.yaml).
563
+ # By using this task as a prerequisite for other tasks, you can ensure these tasks will be needed
564
+ # whenever the buildfile changes.
565
+ class BuildfileTask < Rake::FileTask #:nodoc:
566
+
567
+ def timestamp
568
+ ([name] + prerequisites).map { |f| File.stat(f).mtime }.max rescue Time.now
569
+ end
570
+ end
571
+
572
+
573
+ class << self
574
+
575
+ # Returns the Buildr::Application object.
576
+ def application
577
+ Rake.application
578
+ end
579
+
580
+ def application=(app) #:nodoc:
581
+ Rake.application = app
582
+ end
583
+
584
+ # Returns the Settings associated with this build.
585
+ def settings
586
+ Buildr.application.settings
587
+ end
588
+
589
+ # Copied from BUILD_ENV.
590
+ def environment
591
+ Buildr.application.environment
592
+ end
593
+
594
+ end
595
+
596
+ Buildr.application = Buildr::Application.new
597
+
598
+ end
599
+
600
+
601
+ # Add a touch of color when available and running in terminal.
602
+ HighLine.use_color = false
603
+ if $stdout.isatty
604
+ begin
605
+ require 'Win32/Console/ANSI' if Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
606
+ HighLine.use_color = true
607
+ rescue LoadError
608
+ end
609
+ end
610
+
611
+
612
+ alias :warn_without_color :warn
613
+
614
+ # Show warning message.
615
+ def warn(message)
616
+ warn_without_color $terminal.color(message.to_s, :blue) if verbose
617
+ end
618
+
619
+ # Show error message. Use this when you need to show an error message and not throwing
620
+ # an exception that will stop the build.
621
+ def error(message)
622
+ puts $terminal.color(message.to_s, :red)
623
+ end
624
+
625
+ # Show optional information. The message is printed only when running in verbose
626
+ # mode (the default).
627
+ def info(message)
628
+ puts message if verbose
629
+ end
630
+
631
+ # Show message. The message is printed out only when running in trace mode.
632
+ def trace(message)
633
+ puts message if Buildr.application.options.trace
634
+ end
635
+
636
+ def trace?(*category)
637
+ options = Buildr.application.options
638
+ return options.trace if category.empty?
639
+ return true if options.trace_all
640
+ return false unless Buildr.application.options.trace_categories
641
+ options.trace_categories.include?(category.first)
642
+ end
643
+
644
+ module Rake #:nodoc
645
+ # Rake's circular dependency checks (InvocationChain) only applies to task prerequisites,
646
+ # all other cases result in the non too-descriptive thread sleeping error. This change can
647
+ # deal with circular dependencies that occur from direct task invocation, e.g:
648
+ # task 'foo'=>'bar'
649
+ # task 'bar' do
650
+ # task('foo').invoke
651
+ # end
652
+ class Task #:nodoc:
653
+ def invoke(*args)
654
+ task_args = TaskArguments.new(arg_names, args)
655
+ invoke_with_call_chain(task_args, Thread.current[:rake_chain] || InvocationChain::EMPTY)
656
+ end
657
+
658
+ def invoke_with_call_chain(task_args, invocation_chain)
659
+ new_chain = InvocationChain.append(self, invocation_chain)
660
+ @lock.synchronize do
661
+ if application.options.trace
662
+ puts "** Invoke #{name} #{format_trace_flags}"
663
+ end
664
+ return if @already_invoked
665
+ @already_invoked = true
666
+ begin
667
+ invoke_prerequisites(task_args, new_chain)
668
+ rescue
669
+ trace "Exception while invoking prerequisites of task #{self.inspect}"
670
+ raise
671
+ end
672
+ begin
673
+ old_chain, Thread.current[:rake_chain] = Thread.current[:rake_chain], new_chain
674
+ execute(task_args) if needed?
675
+ ensure
676
+ Thread.current[:rake_chain] = old_chain
677
+ end
678
+ end
679
+ end
680
+ end
681
+ end
682
+
683
+
684
+ module RakeFileUtils #:nodoc:
685
+ FileUtils::OPT_TABLE.each do |name, opts|
686
+ default_options = []
687
+ if opts.include?(:verbose) || opts.include?("verbose")
688
+ default_options << ':verbose => RakeFileUtils.verbose_flag == true'
689
+ end
690
+ next if default_options.empty?
691
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
692
+ def #{name}( *args, &block )
693
+ super(
694
+ *rake_merge_option(args,
695
+ #{default_options.join(', ')}
696
+ ), &block)
697
+ end
698
+ EOS
699
+ end
700
+ end