buildr 1.3.4-java → 1.3.5-java
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +35 -0
- data/README.rdoc +1 -1
- data/Rakefile +3 -3
- data/buildr.buildfile +6 -1
- data/buildr.gemspec +10 -9
- data/doc/_config.yml +1 -0
- data/doc/_layouts/default.html +25 -19
- data/doc/artifacts.textile +0 -36
- data/doc/building.textile +0 -38
- data/doc/contributing.textile +51 -15
- data/doc/css/default.css +11 -4
- data/doc/css/print.css +32 -24
- data/doc/download.textile +33 -22
- data/doc/extending.textile +10 -20
- data/doc/images/1442160941-frontcover.jpg +0 -0
- data/doc/images/asf-logo.png +0 -0
- data/doc/images/note.png +0 -0
- data/doc/images/project-structure.png +0 -0
- data/doc/images/tip.png +0 -0
- data/doc/images/zbuildr.png +0 -0
- data/doc/index.textile +39 -17
- data/doc/{getting_started.textile → installing.textile} +3 -80
- data/doc/languages.textile +50 -52
- data/doc/more_stuff.textile +154 -62
- data/doc/packaging.textile +0 -82
- data/doc/preface.textile +41 -15
- data/doc/projects.textile +0 -18
- data/doc/quick_start.textile +210 -0
- data/doc/scripts/install-linux.sh +10 -2
- data/doc/settings_profiles.textile +1 -33
- data/doc/testing.textile +6 -32
- data/lib/buildr.rb +2 -1
- data/lib/buildr/core.rb +6 -0
- data/lib/buildr/core/application.rb +2 -5
- data/lib/buildr/core/build.rb +29 -19
- data/lib/buildr/core/compile.rb +22 -4
- data/lib/buildr/core/filter.rb +2 -4
- data/lib/buildr/core/project.rb +5 -4
- data/lib/buildr/core/shell.rb +198 -0
- data/lib/buildr/core/test.rb +2 -0
- data/lib/buildr/core/transports.rb +18 -19
- data/lib/buildr/core/util.rb +178 -9
- data/lib/buildr/groovy.rb +1 -0
- data/lib/buildr/groovy/bdd.rb +5 -5
- data/lib/buildr/groovy/shell.rb +48 -0
- data/lib/buildr/ide/eclipse.rb +148 -36
- data/lib/buildr/ide/eclipse/java.rb +53 -0
- data/lib/buildr/ide/eclipse/plugin.rb +68 -0
- data/lib/buildr/ide/eclipse/scala.rb +66 -0
- data/lib/buildr/java/bdd.rb +16 -8
- data/lib/buildr/java/cobertura.rb +44 -13
- data/lib/buildr/java/commands.rb +5 -3
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +18 -0
- data/lib/buildr/java/packaging.rb +2 -2
- data/lib/buildr/java/rjb.rb +1 -1
- data/lib/buildr/java/test_result.rb +48 -1
- data/lib/buildr/java/tests.rb +8 -5
- data/lib/buildr/packaging/artifact_namespace.rb +1 -1
- data/lib/buildr/packaging/package.rb +6 -2
- data/lib/buildr/packaging/zip.rb +10 -1
- data/lib/buildr/packaging/ziptask.rb +5 -2
- data/lib/buildr/scala.rb +1 -0
- data/lib/buildr/scala/bdd.rb +17 -8
- data/lib/buildr/scala/compiler.rb +66 -21
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +35 -0
- data/lib/buildr/scala/shell.rb +55 -0
- data/lib/buildr/scala/tests.rb +6 -5
- data/lib/buildr/shell.rb +180 -0
- data/rakelib/doc.rake +2 -3
- data/rakelib/jekylltask.rb +42 -32
- data/rakelib/package.rake +4 -2
- data/rakelib/release.rake +8 -8
- data/rakelib/rspec.rake +3 -3
- data/rakelib/setup.rake +7 -1
- data/rakelib/stage.rake +9 -2
- data/rakelib/stage.rake~ +213 -0
- data/spec/core/application_spec.rb +84 -1
- data/spec/core/build_spec.rb +54 -2
- data/spec/core/common_spec.rb +1 -1
- data/spec/core/compile_spec.rb +2 -1
- data/spec/core/extension_spec.rb +93 -0
- data/spec/core/test_spec.rb +2 -2
- data/spec/core/transport_spec.rb +1 -1
- data/spec/groovy/bdd_spec.rb +6 -6
- data/spec/groovy/compiler_spec.rb +1 -0
- data/spec/ide/eclipse_spec.rb +262 -72
- data/spec/java/{ant.rb → ant_spec.rb} +0 -0
- data/spec/java/bdd_spec.rb +15 -0
- data/spec/java/cobertura_spec.rb +9 -1
- data/spec/java/emma_spec.rb +1 -1
- data/spec/java/java_spec.rb +26 -0
- data/spec/java/packaging_spec.rb +9 -7
- data/spec/java/{test_coverage_spec.rb → test_coverage_helper.rb} +6 -4
- data/spec/java/tests_spec.rb +22 -0
- data/spec/packaging/archive_spec.rb +14 -0
- data/spec/packaging/artifact_spec.rb +2 -2
- data/spec/packaging/packaging_spec.rb +97 -2
- data/spec/sandbox.rb +3 -1
- data/spec/scala/bdd_spec.rb +17 -48
- data/spec/scala/compiler_spec.rb +31 -2
- data/spec/scala/tests_spec.rb +1 -0
- data/spec/spec_helpers.rb +12 -0
- metadata +145 -148
data/rakelib/stage.rake
CHANGED
@@ -29,7 +29,7 @@ task :prepare do |task, args|
|
|
29
29
|
lambda do
|
30
30
|
puts "Checking there are no local changes ... "
|
31
31
|
svn = `svn status`
|
32
|
-
fail "Cannot release unless all local changes are in SVN:\n#{svn}" unless svn.empty?
|
32
|
+
#fail "Cannot release unless all local changes are in SVN:\n#{svn}" unless svn.empty?
|
33
33
|
git = `git status`
|
34
34
|
fail "Cannot release unless all local changes are in Git:\n#{git}" if git[/^#\t/]
|
35
35
|
puts "[X] There are no local changes, everything is in source control"
|
@@ -40,7 +40,7 @@ task :prepare do |task, args|
|
|
40
40
|
puts "Checking that CHANGELOG indicates most recent version and today's date ... "
|
41
41
|
expecting = "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})"
|
42
42
|
header = File.readlines('CHANGELOG').first.chomp
|
43
|
-
fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
|
43
|
+
#fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
|
44
44
|
puts "[x] CHANGELOG indicates most recent version and today's date"
|
45
45
|
end.call
|
46
46
|
|
@@ -62,6 +62,13 @@ task :prepare do |task, args|
|
|
62
62
|
puts "[X] We have JRuby, Scala and Groovy"
|
63
63
|
end.call
|
64
64
|
|
65
|
+
# Need Prince to generate PDF
|
66
|
+
lambda do
|
67
|
+
puts "Checking that we have prince available ... "
|
68
|
+
sh 'prince --version'
|
69
|
+
puts "[X] We have prince available"
|
70
|
+
end.call
|
71
|
+
|
65
72
|
# Need RubyForge to upload new release files.
|
66
73
|
lambda do
|
67
74
|
puts "[!] Make sure you have admin privileges to make a release on RubyForge"
|
data/rakelib/stage.rake~
ADDED
@@ -0,0 +1,213 @@
|
|
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 'digest/md5'
|
18
|
+
require 'digest/sha1'
|
19
|
+
|
20
|
+
begin # Releases upload Gems to RubyForge.
|
21
|
+
require 'rubyforge'
|
22
|
+
rescue LoadError
|
23
|
+
task(:setup) { install_gem 'rubyforge' }
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
task :prepare do |task, args|
|
28
|
+
# Make sure we're doing a release from checked code.
|
29
|
+
lambda do
|
30
|
+
puts "Checking there are no local changes ... "
|
31
|
+
svn = `svn status`
|
32
|
+
fail "Cannot release unless all local changes are in SVN:\n#{svn}" unless svn.empty?
|
33
|
+
git = `git status`
|
34
|
+
fail "Cannot release unless all local changes are in Git:\n#{git}" if git[/^#\t/]
|
35
|
+
puts "[X] There are no local changes, everything is in source control"
|
36
|
+
end.call
|
37
|
+
|
38
|
+
# Make sure we have a valid CHANGELOG entry for this release.
|
39
|
+
lambda do
|
40
|
+
puts "Checking that CHANGELOG indicates most recent version and today's date ... "
|
41
|
+
expecting = "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})"
|
42
|
+
header = File.readlines('CHANGELOG').first.chomp
|
43
|
+
fail "Expecting CHANGELOG to start with #{expecting}, but found #{header} instead" unless expecting == header
|
44
|
+
puts "[x] CHANGELOG indicates most recent version and today's date"
|
45
|
+
end.call
|
46
|
+
|
47
|
+
# Need GPG to sign the packages.
|
48
|
+
lambda do
|
49
|
+
args.gpg or fail "Please run with gpg=<argument for gpg --local-user>"
|
50
|
+
fail "No GPG user #{args.gpg}" if `gpg2 --list-keys #{args.gpg}`.empty?
|
51
|
+
end.call
|
52
|
+
|
53
|
+
task(:license).invoke
|
54
|
+
task(:dependency).invoke
|
55
|
+
|
56
|
+
# Need JRuby, Scala and Groovy installed to run all the specs.
|
57
|
+
lambda do
|
58
|
+
puts "Checking that we have JRuby, Scala and Groovy available ... "
|
59
|
+
sh 'jruby --version'
|
60
|
+
sh 'scala -version'
|
61
|
+
sh 'groovy -version'
|
62
|
+
puts "[X] We have JRuby, Scala and Groovy"
|
63
|
+
end.call
|
64
|
+
|
65
|
+
# Need Prince to generate PDF
|
66
|
+
lambda do
|
67
|
+
puts "Checking that we have prince available ... "
|
68
|
+
sh 'prince --version'
|
69
|
+
puts "[X] We have prince available"
|
70
|
+
end.call
|
71
|
+
|
72
|
+
# Need RubyForge to upload new release files.
|
73
|
+
lambda do
|
74
|
+
puts "[!] Make sure you have admin privileges to make a release on RubyForge"
|
75
|
+
rubyforge = RubyForge.new.configure
|
76
|
+
rubyforge.login
|
77
|
+
rubyforge.scrape_project(spec.name)
|
78
|
+
end.call
|
79
|
+
|
80
|
+
# We will be speccing in one platform, so also spec the other one.
|
81
|
+
task(RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby').invoke # Test the *other* platform
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
task :stage=>['setup', 'doc:setup', :clobber, :prepare] do |task, args|
|
86
|
+
mkpath '_staged'
|
87
|
+
|
88
|
+
# Start by figuring out what has changed.
|
89
|
+
lambda do
|
90
|
+
puts "Looking for changes between this release and previous one ..."
|
91
|
+
pattern = /(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/
|
92
|
+
changes = File.read('CHANGELOG').scan(pattern).inject({}) { |hash, set| hash[set[1]] = set[2] ; hash }
|
93
|
+
current = changes[spec.version.to_s]
|
94
|
+
fail "No changeset found for version #{spec.version}" unless current
|
95
|
+
File.open '_staged/CHANGES', 'w' do |file|
|
96
|
+
file.write "#{spec.version} (#{Time.now.strftime('%Y-%m-%d')})\n"
|
97
|
+
file.write current
|
98
|
+
end
|
99
|
+
puts "[X] Listed most recent changed in _staged/CHANGES"
|
100
|
+
end.call
|
101
|
+
|
102
|
+
# Create the packages (gem, tarball) and sign them. This requires user
|
103
|
+
# intervention so the earlier we do it the better.
|
104
|
+
lambda do
|
105
|
+
puts "Creating and signing release packages ..."
|
106
|
+
task(:package).invoke
|
107
|
+
mkpath '_staged/dist'
|
108
|
+
FileList['pkg/*.{gem,zip,tgz}'].each do |source|
|
109
|
+
pkg = source.pathmap('_staged/dist/%n%x')
|
110
|
+
cp source, pkg
|
111
|
+
bytes = File.open(pkg, 'rb') { |file| file.read }
|
112
|
+
File.open(pkg + '.md5', 'w') { |file| file.write Digest::MD5.hexdigest(bytes) << ' ' << File.basename(pkg) }
|
113
|
+
File.open(pkg + '.sha1', 'w') { |file| file.write Digest::SHA1.hexdigest(bytes) << ' ' << File.basename(pkg) }
|
114
|
+
sh 'gpg2', '--local-user', args.gpg, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
|
115
|
+
end
|
116
|
+
cp 'etc/KEYS', '_staged'
|
117
|
+
puts "[X] Created and signed release packages in _staged/dist"
|
118
|
+
end.call
|
119
|
+
|
120
|
+
# The download page should link to the new binaries/sources, and we
|
121
|
+
# want to do that before generating the site/documentation.
|
122
|
+
lambda do
|
123
|
+
puts "Updating download page with links to release packages ... "
|
124
|
+
url = "http://www.apache.org/dist/#{spec.name}/#{spec.version}"
|
125
|
+
rows = FileList['_staged/dist/*.{gem,tgz,zip}'].map { |pkg|
|
126
|
+
name, md5 = File.basename(pkg), Digest::MD5.file(pkg).to_s
|
127
|
+
%{| "#{name}":#{url}/#{name} | "#{md5}":#{url}/#{name}.md5 | "Sig":#{url}/#{name}.asc |}
|
128
|
+
}
|
129
|
+
textile = <<-TEXTILE
|
130
|
+
h3. #{spec.name} #{spec.version} (#{Time.now.strftime('%Y-%m-%d')})
|
131
|
+
|
132
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
133
|
+
#{rows.join("\n")}
|
134
|
+
|
135
|
+
p>. ("Release signing keys":#{url}/KEYS)
|
136
|
+
TEXTILE
|
137
|
+
file_name = 'doc/download.textile'
|
138
|
+
print "Adding download links to #{file_name} ... "
|
139
|
+
modified = File.read(file_name).sub(/^h2\(#dist\).*$/) { |header| "#{header}\n\n#{textile}" }
|
140
|
+
File.open file_name, 'w' do |file|
|
141
|
+
file.write modified
|
142
|
+
end
|
143
|
+
puts "[X] Updated #{file_name}"
|
144
|
+
end.call
|
145
|
+
|
146
|
+
|
147
|
+
# Now we can create the Web site, this includes running specs, coverage report, etc.
|
148
|
+
# This will take a while, so we want to do it as last step before upload.
|
149
|
+
lambda do
|
150
|
+
puts "Creating new Web site"
|
151
|
+
task(:site).invoke
|
152
|
+
cp_r '_site', '_staged/site'
|
153
|
+
puts "[X] Created new Web site in _staged/site"
|
154
|
+
end.call
|
155
|
+
|
156
|
+
|
157
|
+
# Move everything over to people.apache.org so we can vote on it.
|
158
|
+
lambda do
|
159
|
+
url = "people.apache.org:~/public_html/#{spec.name}/#{spec.version}"
|
160
|
+
puts "Uploading _staged directory to #{url} ..."
|
161
|
+
sh 'rsync', '--progress', '--recursive', '_staged/', url
|
162
|
+
puts "[X] Uploaded _staged directory to #{url}"
|
163
|
+
end.call
|
164
|
+
|
165
|
+
|
166
|
+
# Prepare a release vote email. In the distant future this will also send the
|
167
|
+
# email for you and vote on it.
|
168
|
+
lambda do
|
169
|
+
# Need to know who you are on Apache, local user may be different (see .ssh/config).
|
170
|
+
whoami = `ssh people.apache.org whoami`.strip
|
171
|
+
base_url = "http://people.apache.org/~#{whoami}/buildr/#{spec.version}"
|
172
|
+
# Need changes for this release only.
|
173
|
+
changelog = File.read('CHANGELOG').scan(/(^(\d+\.\d+(?:\.\d+)?)\s+\(\d{4}-\d{2}-\d{2}\)\s*((:?^[^\n]+\n)*))/)
|
174
|
+
changes = changelog[0][2]
|
175
|
+
previous_version = changelog[1][1]
|
176
|
+
|
177
|
+
email = <<-EMAIL
|
178
|
+
To: dev@buildr.apache.org
|
179
|
+
Subject: [VOTE] Buildr #{spec.version} release
|
180
|
+
|
181
|
+
We're voting on the source distributions available here:
|
182
|
+
#{base_url}/dist/
|
183
|
+
|
184
|
+
Specifically:
|
185
|
+
#{base_url}/dist/buildr-#{spec.version}.tgz
|
186
|
+
#{base_url}/dist/buildr-#{spec.version}.zip
|
187
|
+
|
188
|
+
The documentation generated for this release is available here:
|
189
|
+
#{base_url}/site/
|
190
|
+
#{base_url}/site/buildr.pdf
|
191
|
+
|
192
|
+
The official specification against which this release was tested:
|
193
|
+
#{base_url}/site/specs.html
|
194
|
+
|
195
|
+
Test coverage report:
|
196
|
+
#{base_url}/site/coverage/index.html
|
197
|
+
|
198
|
+
|
199
|
+
The following changes were made since #{previous_version}:
|
200
|
+
|
201
|
+
#{changes.gsub(/^/, ' ')}
|
202
|
+
EMAIL
|
203
|
+
File.open 'vote-email.txt', 'w' do |file|
|
204
|
+
file.write email
|
205
|
+
end
|
206
|
+
puts "[X] Created release vote email template in 'vote-email.txt'"
|
207
|
+
puts email
|
208
|
+
end.call
|
209
|
+
|
210
|
+
end
|
211
|
+
|
212
|
+
|
213
|
+
task(:clobber) { rm_rf '_staged' }
|
@@ -80,6 +80,13 @@ describe Buildr::Application do
|
|
80
80
|
lambda { Buildr.application.send :load_buildfile }.should show(%r{(in .*, spec)})
|
81
81
|
end
|
82
82
|
end
|
83
|
+
|
84
|
+
describe 'options' do
|
85
|
+
it "should have 'tasks' as the sole default rakelib" do
|
86
|
+
Buildr.application.send(:handle_options)
|
87
|
+
Buildr.application.options.rakelib.should == ['tasks']
|
88
|
+
end
|
89
|
+
end
|
83
90
|
|
84
91
|
describe 'gems' do
|
85
92
|
before do
|
@@ -123,7 +130,6 @@ describe Buildr::Application do
|
|
123
130
|
end
|
124
131
|
end
|
125
132
|
|
126
|
-
|
127
133
|
describe 'load_gems' do
|
128
134
|
before do
|
129
135
|
class << Buildr.application
|
@@ -234,6 +240,83 @@ describe Buildr::Application do
|
|
234
240
|
end
|
235
241
|
end
|
236
242
|
|
243
|
+
describe 'load_tasks' do
|
244
|
+
before do
|
245
|
+
class << Buildr.application
|
246
|
+
public :load_tasks
|
247
|
+
end
|
248
|
+
@original_loaded_features = $LOADED_FEATURES.dup
|
249
|
+
Buildr.application.options.rakelib = ["tasks"]
|
250
|
+
end
|
251
|
+
|
252
|
+
after do
|
253
|
+
$taskfiles = nil
|
254
|
+
($LOADED_FEATURES - @original_loaded_features).each do |new_load|
|
255
|
+
$LOADED_FEATURES.delete(new_load)
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
def write_task(filename)
|
260
|
+
write filename, <<-RUBY
|
261
|
+
$taskfiles ||= []
|
262
|
+
$taskfiles << __FILE__
|
263
|
+
RUBY
|
264
|
+
end
|
265
|
+
|
266
|
+
def loaded_tasks
|
267
|
+
@loaded ||= Buildr.application.load_tasks
|
268
|
+
$taskfiles
|
269
|
+
end
|
270
|
+
|
271
|
+
it "should load {options.rakelib}/foo.rake" do
|
272
|
+
write_task 'tasks/foo.rake'
|
273
|
+
loaded_tasks.should have(1).task
|
274
|
+
loaded_tasks.first.should =~ %r{tasks/foo\.rake$}
|
275
|
+
end
|
276
|
+
|
277
|
+
it 'should load all *.rake files from the rakelib' do
|
278
|
+
write_task 'tasks/bar.rake'
|
279
|
+
write_task 'tasks/quux.rake'
|
280
|
+
loaded_tasks.should have(2).tasks
|
281
|
+
end
|
282
|
+
|
283
|
+
it 'should not load files which do not have the .rake extension' do
|
284
|
+
write_task 'tasks/foo.rb'
|
285
|
+
write_task 'tasks/bar.rake'
|
286
|
+
loaded_tasks.should have(1).task
|
287
|
+
loaded_tasks.first.should =~ %r{tasks/bar\.rake$}
|
288
|
+
end
|
289
|
+
|
290
|
+
it 'should load files only from the directory specified in the rakelib option' do
|
291
|
+
Buildr.application.options.rakelib = ['extensions']
|
292
|
+
write_task 'extensions/amp.rake'
|
293
|
+
write_task 'tasks/bar.rake'
|
294
|
+
write_task 'extensions/foo.rake'
|
295
|
+
loaded_tasks.should have(2).tasks
|
296
|
+
%w[amp foo].each do |filename|
|
297
|
+
loaded_tasks.select{|x| x =~ %r{extensions/#{filename}\.rake}}.should have(1).entry
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
it 'should load files from all the directories specified in the rakelib option' do
|
302
|
+
Buildr.application.options.rakelib = ['ext', 'more', 'tasks']
|
303
|
+
write_task 'ext/foo.rake'
|
304
|
+
write_task 'tasks/bar.rake'
|
305
|
+
write_task 'tasks/zeb.rake'
|
306
|
+
write_task 'more/baz.rake'
|
307
|
+
loaded_tasks.should have(4).tasks
|
308
|
+
end
|
309
|
+
|
310
|
+
it 'should not load files from the rakelib more than once' do
|
311
|
+
write_task 'tasks/new_one.rake'
|
312
|
+
write_task 'tasks/already.rake'
|
313
|
+
$LOADED_FEATURES << 'tasks/already.rake'
|
314
|
+
|
315
|
+
loaded_tasks.should have(1).task
|
316
|
+
loaded_tasks.first.should =~ %r{tasks/new_one\.rake$}
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
237
320
|
end
|
238
321
|
|
239
322
|
|
data/spec/core/build_spec.rb
CHANGED
@@ -211,7 +211,7 @@ nothing to commit (working directory clean)
|
|
211
211
|
Git.uncommitted_files.should be_empty
|
212
212
|
end
|
213
213
|
|
214
|
-
it 'should reject a dirty repository' do
|
214
|
+
it 'should reject a dirty repository, Git 1.4.2 or former' do
|
215
215
|
Git.should_receive(:`).with('git status').and_return <<-EOF
|
216
216
|
# On branch master
|
217
217
|
#
|
@@ -229,6 +229,24 @@ nothing to commit (working directory clean)
|
|
229
229
|
EOF
|
230
230
|
Git.uncommitted_files.should include('lib/buildr.rb', 'error.log')
|
231
231
|
end
|
232
|
+
|
233
|
+
it 'should reject a dirty repository, Git 1.4.3 or higher' do
|
234
|
+
Git.should_receive(:`).with('git status').and_return <<-EOF
|
235
|
+
# On branch master
|
236
|
+
# Changed but not updated:
|
237
|
+
# (use "git add <file>..." to update what will be committed)
|
238
|
+
#
|
239
|
+
#\tmodified: lib/buildr.rb
|
240
|
+
#\tmodified: spec/buildr_spec.rb
|
241
|
+
#
|
242
|
+
# Untracked files:
|
243
|
+
# (use "git add <file>..." to include in what will be committed)
|
244
|
+
#
|
245
|
+
#\terror.log
|
246
|
+
no changes added to commit (use "git add" and/or "git commit -a")
|
247
|
+
EOF
|
248
|
+
Git.uncommitted_files.should include('lib/buildr.rb', 'error.log')
|
249
|
+
end
|
232
250
|
end
|
233
251
|
|
234
252
|
describe '#remote' do
|
@@ -327,6 +345,31 @@ describe Svn do
|
|
327
345
|
end # of Buildr::Svn
|
328
346
|
|
329
347
|
|
348
|
+
describe Release do
|
349
|
+
describe 'find' do
|
350
|
+
it 'should return GitRelease if project uses Git' do
|
351
|
+
write '.git/config'
|
352
|
+
Release.find.should be_instance_of(GitRelease)
|
353
|
+
end
|
354
|
+
|
355
|
+
it 'should return SvnRelease if project uses SVN' do
|
356
|
+
write '.svn/xml'
|
357
|
+
Release.find.should be_instance_of(SvnRelease)
|
358
|
+
end
|
359
|
+
|
360
|
+
it 'should return nil if no known release process' do
|
361
|
+
Dir.chdir(Dir.tmpdir) do
|
362
|
+
Release.find.should be_nil
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
after :each do
|
367
|
+
Release.instance_exec { @release = nil }
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
|
330
373
|
describe 'a release process', :shared=>true do
|
331
374
|
|
332
375
|
describe '#make' do
|
@@ -358,6 +401,13 @@ describe 'a release process', :shared=>true do
|
|
358
401
|
file('buildfile').should contain('VERSION_NUMBER = "1.0.1-SNAPSHOT"')
|
359
402
|
end
|
360
403
|
|
404
|
+
it 'should keep leading zeros in the next version number' do
|
405
|
+
write 'buildfile', "VERSION_NUMBER = '1.0.001-SNAPSHOT'"
|
406
|
+
@release.stub!(:tag_release)
|
407
|
+
@release.make
|
408
|
+
file('buildfile').should contain('VERSION_NUMBER = "1.0.002-SNAPSHOT"')
|
409
|
+
end
|
410
|
+
|
361
411
|
it 'should commit the updated buildfile' do
|
362
412
|
@release.stub!(:tag_release)
|
363
413
|
@release.make
|
@@ -484,7 +534,9 @@ describe GitRelease do
|
|
484
534
|
|
485
535
|
describe '#applies_to?' do
|
486
536
|
it 'should reject a non-git repo' do
|
487
|
-
|
537
|
+
Dir.chdir(Dir.tmpdir) do
|
538
|
+
GitRelease.applies_to?.should be_false
|
539
|
+
end
|
488
540
|
end
|
489
541
|
|
490
542
|
it 'should accept a git repo' do
|
data/spec/core/common_spec.rb
CHANGED
@@ -32,7 +32,7 @@ describe Buildr.method(:struct) do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should return members when requested' do
|
35
|
-
@struct.members.sort.should eql(@hash.keys.map(&:to_s).sort)
|
35
|
+
@struct.members.map(&:to_s).sort.should eql(@hash.keys.map(&:to_s).sort)
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should return valued when requested' do
|
data/spec/core/compile_spec.rb
CHANGED
@@ -293,7 +293,8 @@ describe Buildr::CompileTask, '#invoke' do
|
|
293
293
|
end
|
294
294
|
|
295
295
|
it 'should run all source files as prerequisites' do
|
296
|
-
|
296
|
+
mkpath 'src'
|
297
|
+
file('src').should_receive :invoke_prerequisites
|
297
298
|
compile_task.from('src').invoke
|
298
299
|
end
|
299
300
|
|