buildr 1.3.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. data/CHANGELOG +780 -0
  2. data/DISCLAIMER +7 -0
  3. data/KEYS +151 -0
  4. data/LICENSE +176 -0
  5. data/NOTICE +31 -0
  6. data/README +173 -0
  7. data/Rakefile +63 -0
  8. data/addon/buildr/antlr.rb +65 -0
  9. data/addon/buildr/cobertura.rb +232 -0
  10. data/addon/buildr/hibernate.rb +142 -0
  11. data/addon/buildr/javacc.rb +85 -0
  12. data/addon/buildr/jdepend.rb +60 -0
  13. data/addon/buildr/jetty.rb +248 -0
  14. data/addon/buildr/nailgun.rb +892 -0
  15. data/addon/buildr/openjpa.rb +90 -0
  16. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  17. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  18. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  19. data/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  20. data/addon/buildr/xmlbeans.rb +93 -0
  21. data/bin/buildr +21 -0
  22. data/buildr.gemspec +50 -0
  23. data/doc/css/default.css +225 -0
  24. data/doc/css/print.css +95 -0
  25. data/doc/css/syntax.css +43 -0
  26. data/doc/images/apache-incubator-logo.png +0 -0
  27. data/doc/images/buildr-hires.png +0 -0
  28. data/doc/images/buildr.png +0 -0
  29. data/doc/images/note.png +0 -0
  30. data/doc/images/tip.png +0 -0
  31. data/doc/images/zbuildr.tif +0 -0
  32. data/doc/pages/artifacts.textile +317 -0
  33. data/doc/pages/building.textile +501 -0
  34. data/doc/pages/contributing.textile +178 -0
  35. data/doc/pages/download.textile +25 -0
  36. data/doc/pages/extending.textile +229 -0
  37. data/doc/pages/getting_started.textile +337 -0
  38. data/doc/pages/index.textile +63 -0
  39. data/doc/pages/mailing_lists.textile +17 -0
  40. data/doc/pages/more_stuff.textile +367 -0
  41. data/doc/pages/packaging.textile +592 -0
  42. data/doc/pages/projects.textile +449 -0
  43. data/doc/pages/recipes.textile +127 -0
  44. data/doc/pages/settings_profiles.textile +339 -0
  45. data/doc/pages/testing.textile +475 -0
  46. data/doc/pages/troubleshooting.textile +121 -0
  47. data/doc/pages/whats_new.textile +389 -0
  48. data/doc/print.haml +52 -0
  49. data/doc/print.toc.yaml +28 -0
  50. data/doc/scripts/buildr-git.rb +411 -0
  51. data/doc/scripts/install-jruby.sh +44 -0
  52. data/doc/scripts/install-linux.sh +64 -0
  53. data/doc/scripts/install-osx.sh +52 -0
  54. data/doc/site.haml +55 -0
  55. data/doc/site.toc.yaml +44 -0
  56. data/lib/buildr.rb +47 -0
  57. data/lib/buildr/core.rb +27 -0
  58. data/lib/buildr/core/application.rb +373 -0
  59. data/lib/buildr/core/application_cli.rb +134 -0
  60. data/lib/buildr/core/build.rb +262 -0
  61. data/lib/buildr/core/checks.rb +382 -0
  62. data/lib/buildr/core/common.rb +155 -0
  63. data/lib/buildr/core/compile.rb +594 -0
  64. data/lib/buildr/core/environment.rb +120 -0
  65. data/lib/buildr/core/filter.rb +258 -0
  66. data/lib/buildr/core/generate.rb +195 -0
  67. data/lib/buildr/core/help.rb +118 -0
  68. data/lib/buildr/core/progressbar.rb +156 -0
  69. data/lib/buildr/core/project.rb +890 -0
  70. data/lib/buildr/core/test.rb +690 -0
  71. data/lib/buildr/core/transports.rb +486 -0
  72. data/lib/buildr/core/util.rb +235 -0
  73. data/lib/buildr/ide.rb +19 -0
  74. data/lib/buildr/ide/eclipse.rb +181 -0
  75. data/lib/buildr/ide/idea.ipr.template +300 -0
  76. data/lib/buildr/ide/idea.rb +194 -0
  77. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  78. data/lib/buildr/ide/idea7x.rb +210 -0
  79. data/lib/buildr/java.rb +26 -0
  80. data/lib/buildr/java/ant.rb +71 -0
  81. data/lib/buildr/java/bdd_frameworks.rb +267 -0
  82. data/lib/buildr/java/commands.rb +210 -0
  83. data/lib/buildr/java/compilers.rb +432 -0
  84. data/lib/buildr/java/deprecated.rb +141 -0
  85. data/lib/buildr/java/groovyc.rb +137 -0
  86. data/lib/buildr/java/jruby.rb +99 -0
  87. data/lib/buildr/java/org/apache/buildr/BuildrNail$Main.class +0 -0
  88. data/lib/buildr/java/org/apache/buildr/BuildrNail.class +0 -0
  89. data/lib/buildr/java/org/apache/buildr/BuildrNail.java +41 -0
  90. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  91. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +116 -0
  92. data/lib/buildr/java/packaging.rb +706 -0
  93. data/lib/buildr/java/pom.rb +178 -0
  94. data/lib/buildr/java/rjb.rb +142 -0
  95. data/lib/buildr/java/test_frameworks.rb +290 -0
  96. data/lib/buildr/java/version_requirement.rb +172 -0
  97. data/lib/buildr/packaging.rb +21 -0
  98. data/lib/buildr/packaging/artifact.rb +729 -0
  99. data/lib/buildr/packaging/artifact_namespace.rb +957 -0
  100. data/lib/buildr/packaging/artifact_search.rb +140 -0
  101. data/lib/buildr/packaging/gems.rb +102 -0
  102. data/lib/buildr/packaging/package.rb +233 -0
  103. data/lib/buildr/packaging/tar.rb +104 -0
  104. data/lib/buildr/packaging/zip.rb +719 -0
  105. data/rakelib/apache.rake +126 -0
  106. data/rakelib/changelog.rake +56 -0
  107. data/rakelib/doc.rake +103 -0
  108. data/rakelib/package.rake +44 -0
  109. data/rakelib/release.rake +53 -0
  110. data/rakelib/rspec.rake +81 -0
  111. data/rakelib/rubyforge.rake +45 -0
  112. data/rakelib/scm.rake +49 -0
  113. data/rakelib/setup.rake +59 -0
  114. data/rakelib/stage.rake +45 -0
  115. data/spec/application_spec.rb +316 -0
  116. data/spec/archive_spec.rb +494 -0
  117. data/spec/artifact_namespace_spec.rb +635 -0
  118. data/spec/artifact_spec.rb +738 -0
  119. data/spec/build_spec.rb +193 -0
  120. data/spec/checks_spec.rb +537 -0
  121. data/spec/common_spec.rb +579 -0
  122. data/spec/compile_spec.rb +561 -0
  123. data/spec/groovy_compilers_spec.rb +239 -0
  124. data/spec/java_bdd_frameworks_spec.rb +238 -0
  125. data/spec/java_compilers_spec.rb +446 -0
  126. data/spec/java_packaging_spec.rb +1042 -0
  127. data/spec/java_test_frameworks_spec.rb +414 -0
  128. data/spec/packaging_helper.rb +63 -0
  129. data/spec/packaging_spec.rb +589 -0
  130. data/spec/project_spec.rb +739 -0
  131. data/spec/sandbox.rb +116 -0
  132. data/spec/scala_compilers_spec.rb +239 -0
  133. data/spec/spec.opts +6 -0
  134. data/spec/spec_helpers.rb +283 -0
  135. data/spec/test_spec.rb +871 -0
  136. data/spec/transport_spec.rb +300 -0
  137. data/spec/version_requirement_spec.rb +115 -0
  138. metadata +324 -0
@@ -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 ADDED
@@ -0,0 +1,324 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: buildr
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ platform: java
6
+ authors:
7
+ - Apache Buildr
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-25 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: "0.8"
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: builder
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: "2.1"
32
+ version:
33
+ - !ruby/object:Gem::Dependency
34
+ name: net-ssh
35
+ version_requirement:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: "1.1"
41
+ version:
42
+ - !ruby/object:Gem::Dependency
43
+ name: net-sftp
44
+ version_requirement:
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: "1.1"
50
+ version:
51
+ - !ruby/object:Gem::Dependency
52
+ name: rubyzip
53
+ version_requirement:
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ version: "0.9"
59
+ version:
60
+ - !ruby/object:Gem::Dependency
61
+ name: highline
62
+ version_requirement:
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: "1.4"
68
+ version:
69
+ - !ruby/object:Gem::Dependency
70
+ name: Antwrap
71
+ version_requirement:
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: "0.7"
77
+ version:
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ version_requirement:
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: "1.1"
86
+ version:
87
+ - !ruby/object:Gem::Dependency
88
+ name: xml-simple
89
+ version_requirement:
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: "1.0"
95
+ version:
96
+ - !ruby/object:Gem::Dependency
97
+ name: archive-tar-minitar
98
+ version_requirement:
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
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
+ - !ruby/object:Gem::Version
112
+ version: "0.4"
113
+ version:
114
+ - !ruby/object:Gem::Dependency
115
+ name: ci_reporter
116
+ version_requirement:
117
+ version_requirements: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ~>
120
+ - !ruby/object:Gem::Version
121
+ version: "1.5"
122
+ version:
123
+ description:
124
+ email: buildr-user@incubator.apache.org
125
+ executables:
126
+ - buildr
127
+ extensions: []
128
+
129
+ extra_rdoc_files:
130
+ - README
131
+ - CHANGELOG
132
+ - LICENSE
133
+ - NOTICE
134
+ - DISCLAIMER
135
+ files:
136
+ - lib/buildr
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
210
+ - README
211
+ - CHANGELOG
212
+ - LICENSE
213
+ - NOTICE
214
+ - DISCLAIMER
215
+ - KEYS
216
+ - buildr.gemspec
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
288
+ has_rdoc: true
289
+ homepage: http://incubator.apache.org/buildr/
290
+ post_install_message:
291
+ rdoc_options:
292
+ - --title
293
+ - Buildr -- A build system that doesn't suck
294
+ - --main
295
+ - README
296
+ - --line-numbers
297
+ - --inline-source
298
+ - -p
299
+ - --webcvs
300
+ - http://svn.apache.org/repos/asf/incubator/#{spec.name}/trunk/
301
+ require_paths:
302
+ - lib
303
+ - addon
304
+ required_ruby_version: !ruby/object:Gem::Requirement
305
+ requirements:
306
+ - - ">="
307
+ - !ruby/object:Gem::Version
308
+ version: "0"
309
+ version:
310
+ required_rubygems_version: !ruby/object:Gem::Requirement
311
+ requirements:
312
+ - - ">="
313
+ - !ruby/object:Gem::Version
314
+ version: "0"
315
+ version:
316
+ requirements: []
317
+
318
+ rubyforge_project: buildr
319
+ rubygems_version: 1.1.1
320
+ signing_key:
321
+ specification_version: 2
322
+ summary: A build system that doesn't suck
323
+ test_files: []
324
+