buildr 1.2.10 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. data/CHANGELOG +566 -268
  2. data/DISCLAIMER +7 -1
  3. data/KEYS +151 -0
  4. data/NOTICE +23 -8
  5. data/README +122 -22
  6. data/Rakefile +49 -229
  7. data/{lib → addon}/buildr/antlr.rb +23 -10
  8. data/addon/buildr/cobertura.rb +232 -0
  9. data/{lib → addon}/buildr/hibernate.rb +20 -4
  10. data/{lib → addon}/buildr/javacc.rb +27 -12
  11. data/addon/buildr/jdepend.rb +60 -0
  12. data/{lib → addon}/buildr/jetty.rb +34 -18
  13. data/addon/buildr/nailgun.rb +892 -0
  14. data/{lib → addon}/buildr/openjpa.rb +23 -6
  15. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  16. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  17. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  18. data/{lib/buildr/jetty → addon/buildr/org/apache/buildr}/JettyWrapper.java +19 -0
  19. data/{lib → addon}/buildr/xmlbeans.rb +39 -14
  20. data/bin/buildr +21 -7
  21. data/buildr.gemspec +50 -0
  22. data/doc/css/default.css +225 -0
  23. data/doc/css/print.css +95 -0
  24. data/doc/css/syntax.css +43 -0
  25. data/doc/images/apache-incubator-logo.png +0 -0
  26. data/doc/images/buildr-hires.png +0 -0
  27. data/doc/images/buildr.png +0 -0
  28. data/doc/images/note.png +0 -0
  29. data/doc/images/tip.png +0 -0
  30. data/doc/images/zbuildr.tif +0 -0
  31. data/doc/pages/artifacts.textile +317 -0
  32. data/doc/pages/building.textile +501 -0
  33. data/doc/pages/contributing.textile +178 -0
  34. data/doc/pages/download.textile +25 -0
  35. data/doc/pages/extending.textile +229 -0
  36. data/doc/pages/getting_started.textile +337 -0
  37. data/doc/pages/index.textile +63 -0
  38. data/doc/pages/mailing_lists.textile +17 -0
  39. data/doc/pages/more_stuff.textile +367 -0
  40. data/doc/pages/packaging.textile +592 -0
  41. data/doc/pages/projects.textile +449 -0
  42. data/doc/pages/recipes.textile +127 -0
  43. data/doc/pages/settings_profiles.textile +339 -0
  44. data/doc/pages/testing.textile +475 -0
  45. data/doc/pages/troubleshooting.textile +121 -0
  46. data/doc/pages/whats_new.textile +389 -0
  47. data/doc/print.haml +52 -0
  48. data/doc/print.toc.yaml +28 -0
  49. data/doc/scripts/buildr-git.rb +411 -0
  50. data/doc/scripts/install-jruby.sh +44 -0
  51. data/doc/scripts/install-linux.sh +64 -0
  52. data/doc/scripts/install-osx.sh +52 -0
  53. data/doc/site.haml +55 -0
  54. data/doc/site.toc.yaml +44 -0
  55. data/lib/buildr.rb +28 -45
  56. data/lib/buildr/core.rb +27 -0
  57. data/lib/buildr/core/application.rb +373 -0
  58. data/lib/buildr/core/application_cli.rb +134 -0
  59. data/lib/{core → buildr/core}/build.rb +91 -77
  60. data/lib/{core → buildr/core}/checks.rb +116 -95
  61. data/lib/buildr/core/common.rb +155 -0
  62. data/lib/buildr/core/compile.rb +594 -0
  63. data/lib/buildr/core/environment.rb +120 -0
  64. data/lib/buildr/core/filter.rb +258 -0
  65. data/lib/{core → buildr/core}/generate.rb +22 -5
  66. data/lib/buildr/core/help.rb +118 -0
  67. data/lib/buildr/core/progressbar.rb +156 -0
  68. data/lib/{core → buildr/core}/project.rb +468 -213
  69. data/lib/buildr/core/test.rb +690 -0
  70. data/lib/{core → buildr/core}/transports.rb +107 -127
  71. data/lib/buildr/core/util.rb +235 -0
  72. data/lib/buildr/ide.rb +19 -0
  73. data/lib/{java → buildr/ide}/eclipse.rb +86 -60
  74. data/lib/{java → buildr/ide}/idea.ipr.template +16 -0
  75. data/lib/buildr/ide/idea.rb +194 -0
  76. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  77. data/lib/buildr/ide/idea7x.rb +210 -0
  78. data/lib/buildr/java.rb +26 -0
  79. data/lib/buildr/java/ant.rb +71 -0
  80. data/lib/buildr/java/bdd_frameworks.rb +267 -0
  81. data/lib/buildr/java/commands.rb +210 -0
  82. data/lib/buildr/java/compilers.rb +432 -0
  83. data/lib/buildr/java/deprecated.rb +141 -0
  84. data/lib/buildr/java/groovyc.rb +137 -0
  85. data/lib/buildr/java/jruby.rb +99 -0
  86. data/lib/buildr/java/org/apache/buildr/BuildrNail$Main.class +0 -0
  87. data/lib/buildr/java/org/apache/buildr/BuildrNail.class +0 -0
  88. data/lib/buildr/java/org/apache/buildr/BuildrNail.java +41 -0
  89. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  90. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +116 -0
  91. data/lib/buildr/java/packaging.rb +706 -0
  92. data/lib/{java → buildr/java}/pom.rb +20 -4
  93. data/lib/buildr/java/rjb.rb +142 -0
  94. data/lib/buildr/java/test_frameworks.rb +290 -0
  95. data/lib/buildr/java/version_requirement.rb +172 -0
  96. data/lib/buildr/packaging.rb +21 -0
  97. data/lib/{java → buildr/packaging}/artifact.rb +170 -179
  98. data/lib/buildr/packaging/artifact_namespace.rb +957 -0
  99. data/lib/buildr/packaging/artifact_search.rb +140 -0
  100. data/lib/buildr/packaging/gems.rb +102 -0
  101. data/lib/buildr/packaging/package.rb +233 -0
  102. data/lib/{tasks → buildr/packaging}/tar.rb +18 -1
  103. data/lib/{tasks → buildr/packaging}/zip.rb +153 -105
  104. data/rakelib/apache.rake +126 -0
  105. data/rakelib/changelog.rake +56 -0
  106. data/rakelib/doc.rake +103 -0
  107. data/rakelib/package.rake +44 -0
  108. data/rakelib/release.rake +53 -0
  109. data/rakelib/rspec.rake +81 -0
  110. data/rakelib/rubyforge.rake +45 -0
  111. data/rakelib/scm.rake +49 -0
  112. data/rakelib/setup.rake +59 -0
  113. data/rakelib/stage.rake +45 -0
  114. data/spec/application_spec.rb +316 -0
  115. data/spec/archive_spec.rb +494 -0
  116. data/spec/artifact_namespace_spec.rb +635 -0
  117. data/spec/artifact_spec.rb +738 -0
  118. data/spec/build_spec.rb +193 -0
  119. data/spec/checks_spec.rb +537 -0
  120. data/spec/common_spec.rb +579 -0
  121. data/spec/compile_spec.rb +561 -0
  122. data/spec/groovy_compilers_spec.rb +239 -0
  123. data/spec/java_bdd_frameworks_spec.rb +238 -0
  124. data/spec/java_compilers_spec.rb +446 -0
  125. data/spec/java_packaging_spec.rb +1042 -0
  126. data/spec/java_test_frameworks_spec.rb +414 -0
  127. data/spec/packaging_helper.rb +63 -0
  128. data/spec/packaging_spec.rb +589 -0
  129. data/spec/project_spec.rb +739 -0
  130. data/spec/sandbox.rb +116 -0
  131. data/spec/scala_compilers_spec.rb +239 -0
  132. data/spec/spec.opts +6 -0
  133. data/spec/spec_helpers.rb +283 -0
  134. data/spec/test_spec.rb +871 -0
  135. data/spec/transport_spec.rb +300 -0
  136. data/spec/version_requirement_spec.rb +115 -0
  137. metadata +188 -77
  138. data/lib/buildr/cobertura.rb +0 -89
  139. data/lib/buildr/jdepend.rb +0 -40
  140. data/lib/buildr/jetty/JettyWrapper$1.class +0 -0
  141. data/lib/buildr/jetty/JettyWrapper$BuildrHandler.class +0 -0
  142. data/lib/buildr/jetty/JettyWrapper.class +0 -0
  143. data/lib/buildr/scala.rb +0 -368
  144. data/lib/core/application.rb +0 -188
  145. data/lib/core/common.rb +0 -562
  146. data/lib/core/help.rb +0 -72
  147. data/lib/core/rake_ext.rb +0 -81
  148. data/lib/java/ant.rb +0 -71
  149. data/lib/java/compile.rb +0 -589
  150. data/lib/java/idea.rb +0 -159
  151. data/lib/java/java.rb +0 -432
  152. data/lib/java/packaging.rb +0 -581
  153. data/lib/java/test.rb +0 -795
  154. data/lib/tasks/concat.rb +0 -35
@@ -0,0 +1,300 @@
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 File.join(File.dirname(__FILE__), 'spec_helpers')
18
+
19
+
20
+ describe URI, '#download' do
21
+ before do
22
+ write @source = 'source', @content = 'Just a file'
23
+ @uri = URI("file://#{File.expand_path(@source)}")
24
+ @target = 'target'
25
+ end
26
+
27
+ it 'should download file if found' do
28
+ @uri.download @target
29
+ file(@target).should contain(@content)
30
+ end
31
+
32
+ it 'should fail if file not found' do
33
+ lambda { (@uri + 'missing').download @target }.should raise_error(URI::NotFoundError)
34
+ file(@target).should_not exist
35
+ end
36
+
37
+ it 'should work the same way from static method with URI' do
38
+ URI.download @uri, @target
39
+ file(@target).should contain(@content)
40
+ end
41
+
42
+ it 'should work the same way from static method with String' do
43
+ URI.download @uri.to_s, @target
44
+ file(@target).should contain(@content)
45
+ end
46
+
47
+ it 'should download to a task' do
48
+ @uri.download file(@target)
49
+ file(@target).should contain(@content)
50
+ end
51
+
52
+ it 'should download to a file' do
53
+ File.open(@target, 'w') { |file| @uri.download file }
54
+ file(@target).should contain(@content)
55
+ end
56
+ end
57
+
58
+
59
+ describe URI, '#upload' do
60
+ before do
61
+ write @source = 'source', @content = 'Just a file'
62
+ @target = 'target'
63
+ @uri = URI("file://#{File.expand_path(@target)}")
64
+ end
65
+
66
+ it 'should upload file if found' do
67
+ @uri.upload @source
68
+ file(@target).should contain(@content)
69
+ end
70
+
71
+ it 'should fail if file not found' do
72
+ lambda { @uri.upload @source.ext('missing') }.should raise_error(URI::NotFoundError)
73
+ file(@target).should_not exist
74
+ end
75
+
76
+ it 'should work the same way from static method with URI' do
77
+ URI.upload @uri, @source
78
+ file(@target).should contain(@content)
79
+ end
80
+
81
+ it 'should work the same way from static method with String' do
82
+ URI.upload @uri.to_s, @source
83
+ file(@target).should contain(@content)
84
+ end
85
+
86
+ it 'should upload from a task' do
87
+ @uri.upload file(@source)
88
+ file(@target).should contain(@content)
89
+ end
90
+
91
+ it 'should create MD5 hash' do
92
+ @uri.upload file(@source)
93
+ file(@target.ext('.md5')).should contain(Digest::MD5.hexdigest(@content))
94
+ end
95
+
96
+ it 'should create SHA1 hash' do
97
+ @uri.upload file(@source)
98
+ file(@target.ext('.sha1')).should contain(Digest::SHA1.hexdigest(@content))
99
+ end
100
+
101
+ it 'should upload an entire directory' do
102
+ mkpath 'dir' ; write 'dir/test', 'in directory'
103
+ mkpath 'dir/nested' ; write 'dir/nested/test', 'in nested directory'
104
+ @uri.upload 'dir'
105
+ file(@target).should contain('test', 'nested/test')
106
+ file(@target + '/test').should contain('in directory')
107
+ file(@target + '/nested/test').should contain('in nested directory')
108
+ end
109
+ end
110
+
111
+
112
+ describe URI::FILE do
113
+ it 'should complain about file:' do
114
+ lambda { URI('file:') }.should raise_error(URI::InvalidURIError)
115
+ end
116
+
117
+ it 'should accept file:something as file:///something' do
118
+ URI('file:something').should eql(URI('file:///something'))
119
+ end
120
+
121
+ it 'should accept file:/ as file:///' do
122
+ URI('file:/').should eql(URI('file:///'))
123
+ end
124
+
125
+ it 'should accept file:/something as file:///something' do
126
+ URI('file:/something').should eql(URI('file:///something'))
127
+ end
128
+
129
+ it 'should complain about file://' do
130
+ lambda { URI('file://').should eql(URI('file:///')) }.should raise_error(URI::InvalidURIError)
131
+ end
132
+
133
+ it 'should accept file://something as file://something/' do
134
+ URI('file://something').should eql(URI('file://something/'))
135
+ end
136
+
137
+ it 'should accept file:///something' do
138
+ URI('file:///something').should be_kind_of(URI::FILE)
139
+ URI('file:///something').to_s.should eql('file:///something')
140
+ URI('file:///something').path.should eql('/something')
141
+ end
142
+
143
+ it 'should treat host as path when host name is a Windows drive' do
144
+ URI('file://c:/something').should eql(URI('file:///c:/something'))
145
+ end
146
+ end
147
+
148
+
149
+ describe URI::FILE, '#read' do
150
+ before do
151
+ @filename = 'readme'
152
+ @uri = URI("file:///#{File.expand_path(@filename)}")
153
+ @content = 'Readme. Please!'
154
+ write 'readme', @content
155
+ end
156
+
157
+ it 'should not complain about excessive options' do
158
+ @uri.read :proxy=>[], :lovely=>true
159
+ end
160
+
161
+ it 'should read the file' do
162
+ @uri.read.should eql(@content)
163
+ end
164
+
165
+ it 'should read the file and yield to block' do
166
+ @uri.read { |content| content.should eql(@content) }
167
+ end
168
+
169
+ it 'should raise NotFoundError if file doesn\'t exist' do
170
+ lambda { (@uri + 'notme').read }.should raise_error(URI::NotFoundError)
171
+ end
172
+
173
+ it 'should raise NotFoundError if file is actually a directory' do
174
+ mkpath 'dir'
175
+ lambda { (@uri + 'dir').read }.should raise_error(URI::NotFoundError)
176
+ end
177
+ end
178
+
179
+
180
+ describe URI::FILE, '#write' do
181
+ before do
182
+ @filename = 'readme'
183
+ @uri = URI("file:///#{File.expand_path(@filename)}")
184
+ @content = 'Readme. Please!'
185
+ end
186
+
187
+ it 'should not complain about excessive options' do
188
+ @uri.write @content, :proxy=>[], :lovely=>true
189
+ end
190
+
191
+ it 'should write the file from a string' do
192
+ @uri.write @content
193
+ read(@filename).should eql(@content)
194
+ end
195
+
196
+ it 'should write the file from a reader' do
197
+ reader = Object.new
198
+ class << reader
199
+ def read(bytes) ; @array.pop ; end
200
+ end
201
+ reader.instance_variable_set :@array, [@content]
202
+ @uri.write reader
203
+ read(@filename).should eql(@content)
204
+ end
205
+
206
+ it 'should write the file from a block' do
207
+ array = [@content]
208
+ @uri.write { array.pop }
209
+ read(@filename).should eql(@content)
210
+ end
211
+
212
+ it 'should not create file if read fails' do
213
+ @uri.write { fail } rescue nil
214
+ file(@filename).should_not exist
215
+ end
216
+ end
217
+
218
+
219
+ describe URI::HTTP, '#read' do
220
+ before do
221
+ @proxy = 'http://john:smith@myproxy:8080'
222
+ @domain = 'domain'
223
+ @host_domain = "host.#{@domain}"
224
+ @uri = URI("http://#{@host_domain}")
225
+ @no_proxy_args = [@host_domain, 80]
226
+ @proxy_args = @no_proxy_args + ['myproxy', 8080, 'john', 'smith']
227
+ @http = mock('http')
228
+ @http.stub!(:request).and_yield(Net::HTTPNotModified.new(nil, nil, nil))
229
+ end
230
+
231
+ it 'should not use proxy unless proxy is set' do
232
+ Net::HTTP.should_receive(:new).with(*@no_proxy_args).and_return(@http)
233
+ @uri.read
234
+ end
235
+
236
+ it 'should use proxy from environment variable HTTP_PROXY' do
237
+ ENV['HTTP_PROXY'] = @proxy
238
+ Net::HTTP.should_receive(:new).with(*@proxy_args).and_return(@http)
239
+ @uri.read
240
+ end
241
+
242
+ it 'should not use proxy for hosts from environment variable NO_PROXY' do
243
+ ENV['HTTP_PROXY'] = @proxy
244
+ ENV['NO_PROXY'] = @host_domain
245
+ Net::HTTP.should_receive(:new).with(*@no_proxy_args).and_return(@http)
246
+ @uri.read
247
+ end
248
+
249
+ it 'should use proxy for hosts other than those specified by NO_PROXY' do
250
+ ENV['HTTP_PROXY'] = @proxy
251
+ ENV['NO_PROXY'] = 'whatever'
252
+ Net::HTTP.should_receive(:new).with(*@proxy_args).and_return(@http)
253
+ @uri.read
254
+ end
255
+
256
+ it 'should support comma separated list in environment variable NO_PROXY' do
257
+ ENV['HTTP_PROXY'] = @proxy
258
+ ENV['NO_PROXY'] = 'optimus,prime'
259
+ Net::HTTP.should_receive(:new).with('optimus', 80).and_return(@http)
260
+ URI('http://optimus').read
261
+ Net::HTTP.should_receive(:new).with('prime', 80).and_return(@http)
262
+ URI('http://prime').read
263
+ Net::HTTP.should_receive(:new).with('bumblebee', *@proxy_args[1..-1]).and_return(@http)
264
+ URI('http://bumblebee').read
265
+ end
266
+
267
+ it 'should support glob pattern in NO_PROXY' do
268
+ ENV['HTTP_PROXY'] = @proxy
269
+ ENV['NO_PROXY'] = "*.#{@domain}"
270
+ Net::HTTP.should_receive(:new).once.with(*@no_proxy_args).and_return(@http)
271
+ @uri.read
272
+ end
273
+
274
+ it 'should support specific port in NO_PROXY' do
275
+ ENV['HTTP_PROXY'] = @proxy
276
+ ENV['NO_PROXY'] = "#{@host_domain}:80"
277
+ Net::HTTP.should_receive(:new).with(*@no_proxy_args).and_return(@http)
278
+ @uri.read
279
+ ENV['NO_PROXY'] = "#{@host_domain}:800"
280
+ Net::HTTP.should_receive(:new).with(*@proxy_args).and_return(@http)
281
+ @uri.read
282
+ end
283
+
284
+ it 'should not die if content size is zero' do
285
+ ok = Net::HTTPOK.new(nil, nil, nil)
286
+ ok.stub!(:read_body)
287
+ @http.stub!(:request).and_yield(ok)
288
+ Net::HTTP.should_receive(:new).and_return(@http)
289
+ $stdout.should_receive(:isatty).and_return(false)
290
+ @uri.read :progress=>true
291
+ end
292
+
293
+ it 'should use HTTP Basic authentication' do
294
+ Net::HTTP.should_receive(:new).and_return(@http)
295
+ request = mock('request')
296
+ Net::HTTP::Get.should_receive(:new).and_return(request)
297
+ request.should_receive(:basic_auth).with('john', 'secret')
298
+ URI("http://john:secret@#{@host_domain}").read
299
+ end
300
+ end
@@ -0,0 +1,115 @@
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 File.join(File.dirname(__FILE__), 'spec_helpers')
18
+
19
+ describe Buildr::VersionRequirement, '.create' do
20
+ def create(str)
21
+ Buildr::VersionRequirement.create(str)
22
+ end
23
+
24
+ it 'should complain on invalid input' do
25
+ lambda { create }.should raise_error(Exception)
26
+ lambda { create('%') }.should raise_error(Exception, /invalid character/)
27
+ lambda { create('1#{0}') }.should raise_error(Exception, /invalid character/)
28
+ lambda { create('1.0rc`exit`') }.should raise_error(Exception, /invalid character/)
29
+ lambda { create(1.0) }.should raise_error(Exception)
30
+ lambda { create('1.0') }.should_not raise_error(Exception)
31
+ lambda { create('1.0rc3') }.should_not raise_error(Exception)
32
+ end
33
+
34
+ it 'should create a single version requirement' do
35
+ create('1.0').should_not have_alternatives
36
+ end
37
+ end
38
+
39
+ describe Buildr::VersionRequirement, '#satisfied_by?' do
40
+ def should_satisfy(str, valids = [], invalids = [])
41
+ req = Buildr::VersionRequirement.create(str)
42
+ valids.each { |v| req.should be_satisfied_by(v) }
43
+ invalids.each { |v| req.should_not be_satisfied_by(v) }
44
+ end
45
+
46
+ it 'should accept Gem version operators' do
47
+ should_satisfy '1.0', %w(1 1.0), %w(1.1 0.1)
48
+ should_satisfy '=1.0', %w(1 1.0), %w(1.1 0.1)
49
+ should_satisfy '= 1.0', %w(1 1.0), %w(1.1 0.1)
50
+ should_satisfy '!= 1.0', %w(0.9 1.1 2), %w(1 1.0 1.0.0)
51
+
52
+ should_satisfy '>1.0', %w(1.0.1), %w(1 1.0 0.1)
53
+ should_satisfy '>=1.0', %w(1.0.1 1 1.0), %w(0.9)
54
+
55
+ should_satisfy '<1.0', %w(0.9 0.9.9), %w(1 1.0 1.1 2)
56
+ should_satisfy '<=1.0', %w(0.9 0.9.9 1 1.0), %w(1.1 2)
57
+
58
+ should_satisfy '~> 1.2.3', %w(1.2.3 1.2.3.4 1.2.4), %w(1.2.1 0.9 1.4 2)
59
+ end
60
+
61
+ it 'should accept logic not operator' do
62
+ should_satisfy 'not 0.5', %w(0 1), %w(0.5)
63
+ should_satisfy '! 0.5', %w(0 1), %w(0.5)
64
+ should_satisfy '!= 0.5', %w(0 1), %w(0.5)
65
+ should_satisfy '!<= 0.5', %w(0.5.1 2), %w(0.5)
66
+ end
67
+
68
+ it 'should accept logic or operator' do
69
+ should_satisfy '0.5 or 2.0', %w(0.5 2.0), %w(1.0 0.5.1 2.0.9)
70
+ should_satisfy '0.5 | 2.0', %w(0.5 2.0), %w(1.0 0.5.1 2.0.9)
71
+ end
72
+
73
+ it 'should accept logic and operator' do
74
+ should_satisfy '>1.5 and <2.0', %w(1.6 1.9), %w(1.5 2 2.0)
75
+ should_satisfy '>1.5 & <2.0', %w(1.6 1.9), %w(1.5 2 2.0)
76
+ end
77
+
78
+ it 'should assume logic and if missing operator between expressions' do
79
+ should_satisfy '>1.5 <2.0', %w(1.6 1.9), %w(1.5 2 2.0)
80
+ end
81
+
82
+ it 'should allow combining logic operators' do
83
+ should_satisfy '>1.0 | <2.0 | =3.0', %w(1.5 3.0 1 2 4)
84
+ should_satisfy '>1.0 & <2.0 | =3.0', %w(1.3 3.0), %w(1 2)
85
+ should_satisfy '=1.0 | <2.0 & =0.5', %w(0.5 1.0), %w(1.1 0.1 2)
86
+ should_satisfy '~>1.1 | ~>1.3 | ~>1.5 | 2.0', %w(2 1.5.6 1.1.2 1.1.3), %w(1.0.9 0.5 2.2.1)
87
+ should_satisfy 'not(2) | 1', %w(1 3), %w(2)
88
+ end
89
+
90
+ it 'should allow using parens to group logic expressions' do
91
+ should_satisfy '(1.0)', %w(1 1.0), %w(0.9 1.1)
92
+ should_satisfy '!( !(1.0) )', %w(1 1.0), %w(0.9 1.1)
93
+ should_satisfy '1 | !(2 | 3)', %w(1), %w(2 3)
94
+ should_satisfy '!(2 | 3) | 1', %w(1), %w(2 3)
95
+ end
96
+ end
97
+
98
+ describe Buildr::VersionRequirement, '#default' do
99
+ it 'should return nil if missing default requirement' do
100
+ Buildr::VersionRequirement.create('>1').default.should be_nil
101
+ Buildr::VersionRequirement.create('<1').default.should be_nil
102
+ Buildr::VersionRequirement.create('!1').default.should be_nil
103
+ Buildr::VersionRequirement.create('!<=1').default.should be_nil
104
+ end
105
+
106
+ it 'should return the last version with a = requirement' do
107
+ Buildr::VersionRequirement.create('1').default.should == '1'
108
+ Buildr::VersionRequirement.create('=1').default.should == '1'
109
+ Buildr::VersionRequirement.create('<=1').default.should == '1'
110
+ Buildr::VersionRequirement.create('>=1').default.should == '1'
111
+ Buildr::VersionRequirement.create('1 | 2 | 3').default.should == '3'
112
+ Buildr::VersionRequirement.create('1 2 | 3').default.should == '3'
113
+ Buildr::VersionRequirement.create('1 & 2 | 3').default.should == '3'
114
+ end
115
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.10
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Buildr
8
- autorequire: buildr.rb
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-11-26 00:00:00 -08:00
12
+ date: 2008-04-25 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -17,108 +17,108 @@ dependencies:
17
17
  version_requirement:
18
18
  version_requirements: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - "="
20
+ - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: 0.7.3
23
- version:
24
- - !ruby/object:Gem::Dependency
25
- name: facets
26
- version_requirement:
27
- version_requirements: !ruby/object:Gem::Requirement
28
- requirements:
29
- - - "="
30
- - !ruby/object:Gem::Version
31
- version: 1.8.54
22
+ version: "0.8"
32
23
  version:
33
24
  - !ruby/object:Gem::Dependency
34
25
  name: builder
35
26
  version_requirement:
36
27
  version_requirements: !ruby/object:Gem::Requirement
37
28
  requirements:
38
- - - "="
29
+ - - ~>
39
30
  - !ruby/object:Gem::Version
40
- version: 2.1.2
31
+ version: "2.1"
41
32
  version:
42
33
  - !ruby/object:Gem::Dependency
43
34
  name: net-ssh
44
35
  version_requirement:
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
- - - "="
38
+ - - ~>
48
39
  - !ruby/object:Gem::Version
49
- version: 1.1.2
40
+ version: "1.1"
50
41
  version:
51
42
  - !ruby/object:Gem::Dependency
52
43
  name: net-sftp
53
44
  version_requirement:
54
45
  version_requirements: !ruby/object:Gem::Requirement
55
46
  requirements:
56
- - - "="
47
+ - - ~>
57
48
  - !ruby/object:Gem::Version
58
- version: 1.1.0
49
+ version: "1.1"
59
50
  version:
60
51
  - !ruby/object:Gem::Dependency
61
52
  name: rubyzip
62
53
  version_requirement:
63
54
  version_requirements: !ruby/object:Gem::Requirement
64
55
  requirements:
65
- - - "="
56
+ - - ~>
66
57
  - !ruby/object:Gem::Version
67
- version: 0.9.1
58
+ version: "0.9"
68
59
  version:
69
60
  - !ruby/object:Gem::Dependency
70
61
  name: highline
71
62
  version_requirement:
72
63
  version_requirements: !ruby/object:Gem::Requirement
73
64
  requirements:
74
- - - "="
65
+ - - ~>
75
66
  - !ruby/object:Gem::Version
76
- version: 1.4.0
67
+ version: "1.4"
77
68
  version:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: Antwrap
80
71
  version_requirement:
81
72
  version_requirements: !ruby/object:Gem::Requirement
82
73
  requirements:
83
- - - "="
74
+ - - ~>
84
75
  - !ruby/object:Gem::Version
85
- version: 0.6.0
76
+ version: "0.7"
86
77
  version:
87
78
  - !ruby/object:Gem::Dependency
88
79
  name: rspec
89
80
  version_requirement:
90
81
  version_requirements: !ruby/object:Gem::Requirement
91
82
  requirements:
92
- - - "="
83
+ - - ~>
93
84
  - !ruby/object:Gem::Version
94
- version: 1.0.8
85
+ version: "1.1"
95
86
  version:
96
87
  - !ruby/object:Gem::Dependency
97
88
  name: xml-simple
98
89
  version_requirement:
99
90
  version_requirements: !ruby/object:Gem::Requirement
100
91
  requirements:
101
- - - "="
92
+ - - ~>
102
93
  - !ruby/object:Gem::Version
103
- version: 1.0.11
94
+ version: "1.0"
104
95
  version:
105
96
  - !ruby/object:Gem::Dependency
106
97
  name: archive-tar-minitar
107
98
  version_requirement:
108
99
  version_requirements: !ruby/object:Gem::Requirement
109
100
  requirements:
110
- - - "="
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: "0.5"
104
+ version:
105
+ - !ruby/object:Gem::Dependency
106
+ name: rubyforge
107
+ version_requirement:
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ~>
111
111
  - !ruby/object:Gem::Version
112
- version: 0.5.1
112
+ version: "0.4"
113
113
  version:
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: rjb
116
116
  version_requirement:
117
117
  version_requirements: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - ">="
119
+ - - ~>
120
120
  - !ruby/object:Gem::Version
121
- version: 1.0.11
121
+ version: "1.1"
122
122
  version:
123
123
  description:
124
124
  email: buildr-user@incubator.apache.org
@@ -130,54 +130,161 @@ extra_rdoc_files:
130
130
  - README
131
131
  - CHANGELOG
132
132
  - LICENSE
133
+ - NOTICE
134
+ - DISCLAIMER
133
135
  files:
134
- - lib/tasks
135
- - lib/tasks/tar.rb
136
- - lib/tasks/concat.rb
137
- - lib/tasks/zip.rb
138
- - lib/core
139
- - lib/core/generate.rb
140
- - lib/core/transports.rb
141
- - lib/core/application.rb
142
- - lib/core/build.rb
143
- - lib/core/checks.rb
144
- - lib/core/help.rb
145
- - lib/core/project.rb
146
- - lib/core/rake_ext.rb
147
- - lib/core/common.rb
148
- - lib/buildr.rb
149
136
  - lib/buildr
150
- - lib/buildr/jetty.rb
151
- - lib/buildr/hibernate.rb
152
- - lib/buildr/scala.rb
153
- - lib/buildr/xmlbeans.rb
154
- - lib/buildr/javacc.rb
155
- - lib/buildr/cobertura.rb
156
- - lib/buildr/jdepend.rb
157
- - lib/buildr/openjpa.rb
158
- - lib/buildr/antlr.rb
159
- - lib/buildr/jetty
160
- - lib/buildr/jetty/JettyWrapper.java
161
- - lib/buildr/jetty/JettyWrapper$1.class
162
- - lib/buildr/jetty/JettyWrapper$BuildrHandler.class
163
- - lib/buildr/jetty/JettyWrapper.class
164
- - lib/java
165
- - lib/java/test.rb
166
- - lib/java/idea.rb
167
- - lib/java/eclipse.rb
168
- - lib/java/pom.rb
169
- - lib/java/java.rb
170
- - lib/java/ant.rb
171
- - lib/java/artifact.rb
172
- - lib/java/idea.ipr.template
173
- - lib/java/packaging.rb
174
- - lib/java/compile.rb
175
- - CHANGELOG
137
+ - lib/buildr/core
138
+ - lib/buildr/core/application.rb
139
+ - lib/buildr/core/application_cli.rb
140
+ - lib/buildr/core/build.rb
141
+ - lib/buildr/core/checks.rb
142
+ - lib/buildr/core/common.rb
143
+ - lib/buildr/core/compile.rb
144
+ - lib/buildr/core/environment.rb
145
+ - lib/buildr/core/filter.rb
146
+ - lib/buildr/core/generate.rb
147
+ - lib/buildr/core/help.rb
148
+ - lib/buildr/core/progressbar.rb
149
+ - lib/buildr/core/project.rb
150
+ - lib/buildr/core/test.rb
151
+ - lib/buildr/core/transports.rb
152
+ - lib/buildr/core/util.rb
153
+ - lib/buildr/core.rb
154
+ - lib/buildr/ide
155
+ - lib/buildr/ide/eclipse.rb
156
+ - lib/buildr/ide/idea.ipr.template
157
+ - lib/buildr/ide/idea.rb
158
+ - lib/buildr/ide/idea7x.ipr.template
159
+ - lib/buildr/ide/idea7x.rb
160
+ - lib/buildr/ide.rb
161
+ - lib/buildr/java
162
+ - lib/buildr/java/ant.rb
163
+ - lib/buildr/java/bdd_frameworks.rb
164
+ - lib/buildr/java/commands.rb
165
+ - lib/buildr/java/compilers.rb
166
+ - lib/buildr/java/deprecated.rb
167
+ - lib/buildr/java/groovyc.rb
168
+ - lib/buildr/java/jruby.rb
169
+ - lib/buildr/java/org
170
+ - lib/buildr/java/org/apache
171
+ - lib/buildr/java/org/apache/buildr
172
+ - lib/buildr/java/org/apache/buildr/BuildrNail$Main.class
173
+ - lib/buildr/java/org/apache/buildr/BuildrNail.class
174
+ - lib/buildr/java/org/apache/buildr/BuildrNail.java
175
+ - lib/buildr/java/org/apache/buildr/JavaTestFilter.class
176
+ - lib/buildr/java/org/apache/buildr/JavaTestFilter.java
177
+ - lib/buildr/java/packaging.rb
178
+ - lib/buildr/java/pom.rb
179
+ - lib/buildr/java/rjb.rb
180
+ - lib/buildr/java/test_frameworks.rb
181
+ - lib/buildr/java/version_requirement.rb
182
+ - lib/buildr/java.rb
183
+ - lib/buildr/packaging
184
+ - lib/buildr/packaging/artifact.rb
185
+ - lib/buildr/packaging/artifact_namespace.rb
186
+ - lib/buildr/packaging/artifact_search.rb
187
+ - lib/buildr/packaging/gems.rb
188
+ - lib/buildr/packaging/package.rb
189
+ - lib/buildr/packaging/tar.rb
190
+ - lib/buildr/packaging/zip.rb
191
+ - lib/buildr/packaging.rb
192
+ - lib/buildr.rb
193
+ - addon/buildr
194
+ - addon/buildr/antlr.rb
195
+ - addon/buildr/cobertura.rb
196
+ - addon/buildr/hibernate.rb
197
+ - addon/buildr/javacc.rb
198
+ - addon/buildr/jdepend.rb
199
+ - addon/buildr/jetty.rb
200
+ - addon/buildr/nailgun.rb
201
+ - addon/buildr/openjpa.rb
202
+ - addon/buildr/org
203
+ - addon/buildr/org/apache
204
+ - addon/buildr/org/apache/buildr
205
+ - addon/buildr/org/apache/buildr/JettyWrapper$1.class
206
+ - addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class
207
+ - addon/buildr/org/apache/buildr/JettyWrapper.class
208
+ - addon/buildr/org/apache/buildr/JettyWrapper.java
209
+ - addon/buildr/xmlbeans.rb
176
210
  - README
211
+ - CHANGELOG
177
212
  - LICENSE
178
213
  - NOTICE
179
214
  - DISCLAIMER
215
+ - KEYS
216
+ - buildr.gemspec
180
217
  - Rakefile
218
+ - rakelib/apache.rake
219
+ - rakelib/changelog.rake
220
+ - rakelib/doc.rake
221
+ - rakelib/package.rake
222
+ - rakelib/release.rake
223
+ - rakelib/rspec.rake
224
+ - rakelib/rubyforge.rake
225
+ - rakelib/scm.rake
226
+ - rakelib/setup.rake
227
+ - rakelib/stage.rake
228
+ - spec/application_spec.rb
229
+ - spec/archive_spec.rb
230
+ - spec/artifact_namespace_spec.rb
231
+ - spec/artifact_spec.rb
232
+ - spec/build_spec.rb
233
+ - spec/checks_spec.rb
234
+ - spec/common_spec.rb
235
+ - spec/compile_spec.rb
236
+ - spec/groovy_compilers_spec.rb
237
+ - spec/java_bdd_frameworks_spec.rb
238
+ - spec/java_compilers_spec.rb
239
+ - spec/java_packaging_spec.rb
240
+ - spec/java_test_frameworks_spec.rb
241
+ - spec/packaging_helper.rb
242
+ - spec/packaging_spec.rb
243
+ - spec/project_spec.rb
244
+ - spec/sandbox.rb
245
+ - spec/scala_compilers_spec.rb
246
+ - spec/spec.opts
247
+ - spec/spec_helpers.rb
248
+ - spec/test_spec.rb
249
+ - spec/transport_spec.rb
250
+ - spec/version_requirement_spec.rb
251
+ - doc/css
252
+ - doc/css/default.css
253
+ - doc/css/print.css
254
+ - doc/css/syntax.css
255
+ - doc/images
256
+ - doc/images/apache-incubator-logo.png
257
+ - doc/images/buildr-hires.png
258
+ - doc/images/buildr.png
259
+ - doc/images/note.png
260
+ - doc/images/tip.png
261
+ - doc/images/zbuildr.tif
262
+ - doc/pages
263
+ - doc/pages/artifacts.textile
264
+ - doc/pages/building.textile
265
+ - doc/pages/contributing.textile
266
+ - doc/pages/download.textile
267
+ - doc/pages/extending.textile
268
+ - doc/pages/getting_started.textile
269
+ - doc/pages/index.textile
270
+ - doc/pages/mailing_lists.textile
271
+ - doc/pages/more_stuff.textile
272
+ - doc/pages/packaging.textile
273
+ - doc/pages/projects.textile
274
+ - doc/pages/recipes.textile
275
+ - doc/pages/settings_profiles.textile
276
+ - doc/pages/testing.textile
277
+ - doc/pages/troubleshooting.textile
278
+ - doc/pages/whats_new.textile
279
+ - doc/print.haml
280
+ - doc/print.toc.yaml
281
+ - doc/scripts
282
+ - doc/scripts/buildr-git.rb
283
+ - doc/scripts/install-jruby.sh
284
+ - doc/scripts/install-linux.sh
285
+ - doc/scripts/install-osx.sh
286
+ - doc/site.haml
287
+ - doc/site.toc.yaml
181
288
  has_rdoc: true
182
289
  homepage: http://incubator.apache.org/buildr/
183
290
  post_install_message:
@@ -187,9 +294,13 @@ rdoc_options:
187
294
  - --main
188
295
  - README
189
296
  - --line-numbers
190
- - -inline-source
297
+ - --inline-source
298
+ - -p
299
+ - --webcvs
300
+ - http://svn.apache.org/repos/asf/incubator/#{spec.name}/trunk/
191
301
  require_paths:
192
302
  - lib
303
+ - addon
193
304
  required_ruby_version: !ruby/object:Gem::Requirement
194
305
  requirements:
195
306
  - - ">="
@@ -205,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
316
  requirements: []
206
317
 
207
318
  rubyforge_project: buildr
208
- rubygems_version: 0.9.5
319
+ rubygems_version: 1.1.1
209
320
  signing_key:
210
321
  specification_version: 2
211
322
  summary: A build system that doesn't suck