buildr 1.4.1-x86-mswin32 → 1.4.2-x86-mswin32
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.
- data/CHANGELOG +68 -11
- data/_buildr +2 -0
- data/addon/buildr/hibernate.rb +8 -5
- data/addon/buildr/jetty.rb +1 -1
- data/addon/buildr/openjpa.rb +0 -2
- data/addon/buildr/xmlbeans.rb +1 -1
- data/buildr.gemspec +13 -9
- data/doc/_layouts/default.html +3 -1
- data/doc/contributing.textile +10 -2
- data/doc/css/default.css +6 -6
- data/doc/download.textile +7 -7
- data/doc/languages.textile +2 -2
- data/doc/more_stuff.textile +41 -33
- data/doc/packaging.textile +6 -3
- data/doc/releasing.textile +116 -0
- data/doc/scripts/install-linux.sh +7 -6
- data/doc/testing.textile +14 -0
- data/lib/buildr.rb +2 -2
- data/lib/buildr/core.rb +0 -6
- data/lib/buildr/core/application.rb +25 -2
- data/lib/buildr/core/build.rb +66 -15
- data/lib/buildr/core/compile.rb +10 -1
- data/lib/buildr/core/filter.rb +1 -1
- data/lib/buildr/core/progressbar.rb +8 -3
- data/lib/buildr/core/test.rb +57 -6
- data/lib/buildr/core/transports.rb +18 -13
- data/lib/buildr/core/util.rb +19 -3
- data/lib/buildr/groovy/compiler.rb +2 -2
- data/lib/buildr/ide/eclipse.rb +32 -12
- data/lib/buildr/java/ant.rb +3 -3
- data/lib/buildr/java/bdd.rb +1 -2
- data/lib/buildr/java/cobertura.rb +10 -9
- data/lib/buildr/java/commands.rb +22 -21
- data/lib/buildr/java/compiler.rb +2 -2
- data/lib/buildr/java/doc.rb +1 -1
- data/lib/buildr/java/ecj.rb +71 -0
- data/lib/buildr/java/emma.rb +1 -1
- data/lib/buildr/java/external.rb +9 -9
- data/lib/buildr/java/jruby.rb +5 -0
- data/lib/buildr/java/packaging.rb +4 -3
- data/lib/buildr/java/rjb.rb +4 -6
- data/lib/buildr/java/tests.rb +9 -4
- data/lib/buildr/packaging/archive.rb +7 -3
- data/lib/buildr/packaging/artifact.rb +153 -38
- data/lib/buildr/packaging/gems.rb +2 -3
- data/lib/buildr/packaging/package.rb +19 -12
- data/lib/buildr/packaging/tar.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +1 -1
- data/lib/buildr/scala/bdd.rb +7 -3
- data/lib/buildr/scala/compiler.rb +2 -2
- data/lib/buildr/scala/doc.rb +3 -3
- data/lib/buildr/scala/tests.rb +7 -3
- data/lib/buildr/version.rb +18 -0
- data/rakelib/all-in-one.rake +1 -1
- data/rakelib/doc.rake +13 -3
- data/rakelib/metrics.rake +39 -0
- data/spec/core/application_spec.rb +13 -12
- data/spec/core/build_spec.rb +166 -7
- data/spec/core/cc_spec.rb +1 -1
- data/spec/core/checks_spec.rb +1 -1
- data/spec/core/common_spec.rb +10 -1
- data/spec/core/compile_spec.rb +1 -1
- data/spec/core/extension_spec.rb +1 -1
- data/spec/core/generate_spec.rb +1 -1
- data/spec/core/project_spec.rb +1 -1
- data/spec/core/test_spec.rb +124 -11
- data/spec/core/transport_spec.rb +10 -3
- data/spec/core/util_spec.rb +18 -2
- data/spec/groovy/bdd_spec.rb +1 -1
- data/spec/groovy/compiler_spec.rb +3 -3
- data/spec/ide/eclipse_spec.rb +63 -1
- data/spec/ide/idea7x_spec.rb +1 -1
- data/spec/java/ant_spec.rb +1 -1
- data/spec/java/bdd_spec.rb +1 -1
- data/spec/java/cobertura_spec.rb +29 -2
- data/spec/java/commands_spec.rb +61 -2
- data/spec/java/compiler_spec.rb +3 -3
- data/spec/java/ecj_spec.rb +115 -0
- data/spec/java/emma_spec.rb +1 -1
- data/spec/java/external_spec.rb +10 -8
- data/spec/java/java_spec.rb +14 -6
- data/spec/java/packaging_spec.rb +41 -15
- data/spec/java/test_coverage_helper.rb +1 -1
- data/spec/java/tests_spec.rb +1 -1
- data/spec/packaging/archive_spec.rb +12 -1
- data/spec/packaging/artifact_namespace_spec.rb +1 -1
- data/spec/packaging/artifact_spec.rb +197 -7
- data/spec/packaging/packaging_spec.rb +12 -12
- data/spec/sandbox.rb +8 -3
- data/spec/scala/bdd_spec.rb +3 -3
- data/spec/scala/compiler_spec.rb +7 -7
- data/spec/scala/scala.rb +3 -3
- data/spec/scala/tests_spec.rb +3 -3
- data/spec/spec_helpers.rb +11 -1
- data/spec/version_requirement_spec.rb +1 -1
- metadata +220 -85
- data/rakelib/jekylltask.rb +0 -120
data/doc/packaging.textile
CHANGED
@@ -242,7 +242,8 @@ Axis2 service archives are similar to JAR's (compiled classes go into the root o
|
|
242
242
|
|
243
243
|
{% highlight ruby %}
|
244
244
|
package(:aar).with(:libs=>'log4j:log4j:jar:1.1')
|
245
|
-
package(:aar).with(:services_xml=>_('target/services.xml'),
|
245
|
+
package(:aar).with(:services_xml=>_('target/services.xml'),
|
246
|
+
:wsdls=>_('target/*.wsdl'))
|
246
247
|
{% endhighlight %}
|
247
248
|
|
248
249
|
The @libs@ attribute is a list of .jar artifacts to be included in the archive under /lib. The default is no artifacts; compile dependencies are not included by default.
|
@@ -257,9 +258,11 @@ If you already have WSDL files in the @src/main/axis2@ directory but would like
|
|
257
258
|
# Host name depends on environment.
|
258
259
|
host = ENV['ENV'] == 'test' ? 'test.host' : 'ws.example.com'
|
259
260
|
filter.from(_('src/main/axis2')).into(_(:target)).
|
260
|
-
include('services.xml', '==*==.wsdl').using('http_port'=>'8080',
|
261
|
+
include('services.xml', '==*==.wsdl').using('http_port'=>'8080',
|
262
|
+
'http_host'=>host)
|
261
263
|
package(:aar).wsdls.clear
|
262
|
-
package(:aar).with(:services_xml=>_('target/services.xml'),
|
264
|
+
package(:aar).with(:services_xml=>_('target/services.xml'),
|
265
|
+
:wsdls=>_('target/==*==.wsdl'))
|
263
266
|
{% endhighlight %}
|
264
267
|
|
265
268
|
|
@@ -0,0 +1,116 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Releasing
|
4
|
+
---
|
5
|
+
|
6
|
+
Now that we built and test awesome software, let's the world know and release it.
|
7
|
+
|
8
|
+
|
9
|
+
Each buildile can specify the current version with a constant named VERSION_NUMBER or THIS_VERSION.
|
10
|
+
|
11
|
+
{% highlight ruby %}
|
12
|
+
THIS_VERSION = "1.0.0-SNAPSHOT"
|
13
|
+
|
14
|
+
define 'killer-app' do
|
15
|
+
|
16
|
+
project.version = THIS_VERSION
|
17
|
+
|
18
|
+
# ...
|
19
|
+
end
|
20
|
+
{% endhighlight %}
|
21
|
+
|
22
|
+
|
23
|
+
h2(#default). What does a release do?
|
24
|
+
|
25
|
+
The default behavior of the Release task is the following:
|
26
|
+
# Check that the version to be released and the next version are different
|
27
|
+
# Check that the project is being tracked by Git or Subversion
|
28
|
+
# Package, test and deploy the artifacts using THIS_VERSION value minus the '-SNAPSHOT' suffix (if any)
|
29
|
+
# Tag the repository with the released version number
|
30
|
+
# Update the value of THIS_VERSION in the buildfile with the next version number
|
31
|
+
|
32
|
+
Buildr will increment the last digit of the 3-digit versioni number if THIS_VERSION contains '-SNAPSHOT'.
|
33
|
+
So, at the end of a release, the buildfile now looks like this:
|
34
|
+
|
35
|
+
{% highlight ruby %}
|
36
|
+
THIS_VERSION = "1.0.1-SNAPSHOT"
|
37
|
+
|
38
|
+
define 'killer-app' do
|
39
|
+
|
40
|
+
project.version = THIS_VERSION
|
41
|
+
|
42
|
+
# ...
|
43
|
+
end
|
44
|
+
{% endhighlight %}
|
45
|
+
|
46
|
+
And the Git repository now contains two new commits and a new tag.
|
47
|
+
|
48
|
+
{% highlight sh %}
|
49
|
+
~/w/killer-app[master]$git ol -4
|
50
|
+
c1af3d5 (HEAD, origin/master, master) Changed version number to 1.0.1-SNAPSHOT
|
51
|
+
dd35015 (tag: 1.0.0) Changed version number to 1.0.0
|
52
|
+
76c96e7 Last fix before the release
|
53
|
+
{% endhighlight %}
|
54
|
+
|
55
|
+
|
56
|
+
h2(#custom_version). How to specify my own version number scheme?
|
57
|
+
|
58
|
+
If THIS_VERSION does not contain '-SNAPSHOT', Buildr delegates the resolution of the next version number to the user which has 2 differents ways to express her wishes: Release.next_version or the environment variable NEXT_VERSION.
|
59
|
+
|
60
|
+
h3(#next_version_proc). Using Release.next_version
|
61
|
+
|
62
|
+
The Release class can receive the next version of the buildfile. This could be a string or a proc that would receive the current version and return the next version.
|
63
|
+
|
64
|
+
{% highlight ruby %}
|
65
|
+
THIS_VERSION = "1.0.0-SNAPSHOT"
|
66
|
+
|
67
|
+
# a string
|
68
|
+
Release.next_version = "2.0.0-SNAPSHOT"
|
69
|
+
|
70
|
+
# or a proc
|
71
|
+
Release.next_version = lambda do |this_version| # 1.0.0-SNAPSHOT
|
72
|
+
new_version = this_version.split(/\./)
|
73
|
+
new_version[0] = new_version[0] + 1
|
74
|
+
new_version
|
75
|
+
end
|
76
|
+
|
77
|
+
define 'killer-app' do
|
78
|
+
|
79
|
+
project.version = THIS_VERSION
|
80
|
+
|
81
|
+
# ...
|
82
|
+
end
|
83
|
+
{% endhighlight %}
|
84
|
+
|
85
|
+
|
86
|
+
h3(#next_version_envvar). Using the environment variable NEXT_VERSION
|
87
|
+
|
88
|
+
If the environment variable NEXT_VERSION is set, Buildr will use this value to update THIS_VERSION at the end of the release.
|
89
|
+
|
90
|
+
For conveniency, this variable is case insensitive.
|
91
|
+
|
92
|
+
So, all 3 following commands would generate the buildfile below:
|
93
|
+
{% highlight sh %}
|
94
|
+
$ buildr release next_version="1.0.0-rc1"
|
95
|
+
$ env next_version="1.0.0-rc1" buildr release
|
96
|
+
$ env NEXT_VERSION="1.0.0-rc1" buildr release
|
97
|
+
{% endhighlight %}
|
98
|
+
|
99
|
+
{% highlight ruby %}
|
100
|
+
THIS_VERSION = "1.0.0-rc1"
|
101
|
+
|
102
|
+
define 'killer-app' do
|
103
|
+
|
104
|
+
project.version = THIS_VERSION
|
105
|
+
|
106
|
+
# ...
|
107
|
+
end
|
108
|
+
{% endhighlight %}
|
109
|
+
|
110
|
+
The environment variable NEXT_VERSION has precedence over Release.next_version.
|
111
|
+
|
112
|
+
|
113
|
+
h2(#custom_tag_and_msg). How to specify my own tag name and commit message?
|
114
|
+
|
115
|
+
As explained earlier, Buildr will create two new commits and a new tag in the version control system. Similarly to Release.next_version, the commit message and the tag name can be customized with Release.message and Release.tag_name. Both could be strings or procs that would receive the released version i.i THIS_VERSION without '-SNAPSHOT'.
|
116
|
+
|
@@ -24,15 +24,15 @@ if [ -z `which ruby` ] ; then
|
|
24
24
|
echo "Installing Ruby using apt-get"
|
25
25
|
# ruby package does not contain RDoc, IRB, etc; ruby-full is a meta-package.
|
26
26
|
# build-essentials not installed by default in Ubuntu, required for C extensions.
|
27
|
-
sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential
|
27
|
+
sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential
|
28
28
|
# RubyGems broken on Ubuntu, installing directly from source.
|
29
29
|
echo "Installing RubyGems from RubyForge"
|
30
|
-
wget http://
|
31
|
-
tar xzf rubygems-1.3.
|
32
|
-
cd rubygems-1.3.
|
30
|
+
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
|
31
|
+
tar xzf rubygems-1.3.7.tgz
|
32
|
+
cd rubygems-1.3.7
|
33
33
|
sudo ruby setup.rb
|
34
34
|
cd ..
|
35
|
-
rm -rf rubygems-1.3.
|
35
|
+
rm -rf rubygems-1.3.7
|
36
36
|
# ruby is same as ruby1.8, we need gem that is same as gem1.8
|
37
37
|
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
|
38
38
|
elif [ `which urpmi` ] ; then
|
@@ -54,9 +54,10 @@ if [ -z $JAVA_HOME ] ; then
|
|
54
54
|
exit 1
|
55
55
|
fi
|
56
56
|
|
57
|
-
if [ $(gem --version) \< '1.3.
|
57
|
+
if [ $(gem --version) \< '1.3.7' ] ; then
|
58
58
|
echo "Upgrading to latest version of RubyGems"
|
59
59
|
sudo gem update --system
|
60
|
+
sudo update_rubygems
|
60
61
|
echo
|
61
62
|
fi
|
62
63
|
|
data/doc/testing.textile
CHANGED
@@ -98,6 +98,20 @@ Buildr forcefully runs all tests that match the pattern. If you want to re-run
|
|
98
98
|
$ buildr test:*
|
99
99
|
{% endhighlight %}
|
100
100
|
|
101
|
+
You can exclude tests by preceeding them with a minus sign ('-'):
|
102
|
+
|
103
|
+
{% highlight sh %}
|
104
|
+
$ buildr test:-Bar
|
105
|
+
{% endhighlight %}
|
106
|
+
|
107
|
+
The above would run all tests except those with a name containing @Bar@. Exclusions can be combined with inclusions:
|
108
|
+
|
109
|
+
{% highlight sh %}
|
110
|
+
$ buildr test:Foo,-Bar
|
111
|
+
{% endhighlight %}
|
112
|
+
|
113
|
+
Buildr would then run tests with names containing @Foo@ but not @Bar@.
|
114
|
+
|
101
115
|
As you probably noticed, Buildr will stop your build at the first test that fails. We think it's a good idea, except when it's not. If you're using a continuous build system, you'll want a report of all the failed tests without stopping at the first failure. To make that happen, set the environment variable @test@ to "all", or the Buildr @options.test@ option to @:all@. For example:
|
102
116
|
|
103
117
|
{% highlight sh %}
|
data/lib/buildr.rb
CHANGED
data/lib/buildr/core.rb
CHANGED
@@ -13,12 +13,6 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
|
-
# TODO: Antwrap 0.7 requires this monkeypatch, have it fixed.
|
18
|
-
class Array #:nodoc:
|
19
|
-
alias :nitems :size
|
20
|
-
end
|
21
|
-
|
22
16
|
require 'buildr/core/common'
|
23
17
|
require 'buildr/core/application'
|
24
18
|
require 'buildr/core/project'
|
@@ -343,9 +343,13 @@ module Buildr
|
|
343
343
|
options.full_description = false
|
344
344
|
}
|
345
345
|
],
|
346
|
-
['--trace', '-t', "Turn on invoke/execute tracing, enable full backtrace.",
|
346
|
+
['--trace', '-t [CATEGORIES]', "Turn on invoke/execute tracing, enable full backtrace.",
|
347
347
|
lambda { |value|
|
348
348
|
options.trace = true
|
349
|
+
if value
|
350
|
+
options.trace_categories = value.split(',').map { |v| v.downcase.to_sym }
|
351
|
+
end
|
352
|
+
options.trace_all = options.trace_categories.include? :all
|
349
353
|
verbose(true)
|
350
354
|
}
|
351
355
|
],
|
@@ -357,6 +361,18 @@ module Buildr
|
|
357
361
|
puts "Buildr #{Buildr::VERSION}#{RUBY_PLATFORM[/java/] ? " (JRuby #{JRUBY_VERSION})" : ""}"
|
358
362
|
exit 0
|
359
363
|
}
|
364
|
+
],
|
365
|
+
['--offline', '-o', "Do not try to download anything",
|
366
|
+
lambda { |value|
|
367
|
+
trace 'Working in offline mode; snapshot will not be updated.'
|
368
|
+
options.work_offline = true
|
369
|
+
}
|
370
|
+
],
|
371
|
+
['--update-snapshots', '-u', "Force updating all dependencies whose version contains SNAPSHOT",
|
372
|
+
lambda { |value|
|
373
|
+
trace 'Force update of SNAPSHOT artifacts.'
|
374
|
+
options.update_snapshots = true
|
375
|
+
}
|
360
376
|
]
|
361
377
|
]
|
362
378
|
end
|
@@ -483,7 +499,7 @@ module Buildr
|
|
483
499
|
width = displayable_tasks.collect { |t| t.name_with_args.length }.max || 10
|
484
500
|
max_column = truncate_output? ? terminal_width - name.size - width - 7 : nil
|
485
501
|
displayable_tasks.each do |t|
|
486
|
-
printf "
|
502
|
+
printf "buildr %-#{width}s # %s\n",
|
487
503
|
t.name_with_args, max_column ? truncate(t.comment, max_column) : t.comment
|
488
504
|
end
|
489
505
|
end
|
@@ -602,6 +618,13 @@ def trace(message)
|
|
602
618
|
puts message if Buildr.application.options.trace
|
603
619
|
end
|
604
620
|
|
621
|
+
def trace?(*category)
|
622
|
+
options = Buildr.application.options
|
623
|
+
return options.trace if category.empty?
|
624
|
+
return true if options.trace_all
|
625
|
+
return false unless Buildr.application.options.trace_categories
|
626
|
+
options.trace_categories.include?(category.first)
|
627
|
+
end
|
605
628
|
|
606
629
|
module Rake #:nodoc
|
607
630
|
# Rake's circular dependency checks (InvocationChain) only applies to task prerequisites,
|
data/lib/buildr/core/build.rb
CHANGED
@@ -239,6 +239,19 @@ module Buildr
|
|
239
239
|
# Release.commit_message = lambda { |ver| "Changed version number to #{ver}" }
|
240
240
|
attr_accessor :commit_message
|
241
241
|
|
242
|
+
# Use this to specify the next version number to replace VERSION_NUMBER with in the buildfile.
|
243
|
+
# You can set the next version or a proc that will be called with the current version number.
|
244
|
+
# For example, with the following buildfile:
|
245
|
+
# THIS_VERSION = "1.0.0-rc1"
|
246
|
+
# Release.next_version = lambda { |version|
|
247
|
+
# version[-1] = version[-1].to_i + 1
|
248
|
+
# version
|
249
|
+
# }
|
250
|
+
#
|
251
|
+
# Release.next_version will return "1.0.0-rc2", so at the end of the release, the buildfile will contain VERSION_NUMBER = "1.0.0-rc2"
|
252
|
+
#
|
253
|
+
attr_accessor :next_version
|
254
|
+
|
242
255
|
# :call-seq:
|
243
256
|
# add(MyReleaseClass)
|
244
257
|
#
|
@@ -270,6 +283,7 @@ module Buildr
|
|
270
283
|
#
|
271
284
|
# Make a release.
|
272
285
|
def make
|
286
|
+
@this_version = extract_version
|
273
287
|
check
|
274
288
|
with_release_candidate_version do |release_candidate_buildfile|
|
275
289
|
args = '-S', 'buildr', "_#{Buildr::VERSION}_", '--buildfile', release_candidate_buildfile
|
@@ -278,11 +292,17 @@ module Buildr
|
|
278
292
|
ruby *args
|
279
293
|
end
|
280
294
|
tag_release resolve_tag
|
281
|
-
update_version_to_next
|
295
|
+
update_version_to_next if this_version != resolve_next_version(this_version)
|
296
|
+
end
|
297
|
+
|
298
|
+
def check
|
299
|
+
if this_version == resolve_next_version(this_version) && this_version.match(/-SNAPSHOT$/)
|
300
|
+
fail "The next version can't be equal to the current version #{this_version}.\nUpdate THIS_VERSION/VERSION_NUMBER, specify Release.next_version or use NEXT_VERSION env var"
|
301
|
+
end
|
282
302
|
end
|
283
303
|
|
284
304
|
# :call-seq:
|
285
|
-
# extract_version() =>
|
305
|
+
# extract_version() => this_version
|
286
306
|
#
|
287
307
|
# Extract the current version number from the buildfile.
|
288
308
|
# Raise an error if not found.
|
@@ -304,6 +324,9 @@ module Buildr
|
|
304
324
|
end
|
305
325
|
|
306
326
|
protected
|
327
|
+
|
328
|
+
# the initial value of THIS_VERSION
|
329
|
+
attr_accessor :this_version
|
307
330
|
|
308
331
|
# :call-seq:
|
309
332
|
# with_release_candidate_version() { |filename| ... }
|
@@ -322,7 +345,10 @@ module Buildr
|
|
322
345
|
# for the release buildfile.
|
323
346
|
def with_release_candidate_version
|
324
347
|
release_candidate_buildfile = Buildr.application.buildfile.to_s + '.next'
|
325
|
-
|
348
|
+
|
349
|
+
release_candidate_buildfile_contents = change_version { |version|
|
350
|
+
version.gsub(/-SNAPSHOT$/, "")
|
351
|
+
}
|
326
352
|
File.open(release_candidate_buildfile, 'w') { |file| file.write release_candidate_buildfile_contents }
|
327
353
|
begin
|
328
354
|
yield release_candidate_buildfile
|
@@ -338,13 +364,11 @@ module Buildr
|
|
338
364
|
# Change version number in the current Buildfile, but without writing a new file (yet).
|
339
365
|
# Returns the contents of the Buildfile with the modified version number.
|
340
366
|
#
|
341
|
-
# This method yields to the block with the current (this) version number
|
342
|
-
# the block to
|
367
|
+
# This method yields to the block with the current (this) version number and expects
|
368
|
+
# the block to return the updated version.
|
343
369
|
def change_version
|
344
|
-
|
345
|
-
new_version =
|
346
|
-
yield(new_version)
|
347
|
-
new_version = new_version.join('.')
|
370
|
+
current_version = extract_version
|
371
|
+
new_version = yield(current_version)
|
348
372
|
buildfile = File.read(Buildr.application.buildfile.to_s)
|
349
373
|
buildfile.gsub(THIS_VERSION_PATTERN) { |ver| ver.sub(/(["']).*\1/, %Q{"#{new_version}"}) }
|
350
374
|
end
|
@@ -357,13 +381,34 @@ module Buildr
|
|
357
381
|
tag
|
358
382
|
end
|
359
383
|
|
384
|
+
# Return the new value of THIS_VERSION based on the version passed.
|
385
|
+
#
|
386
|
+
# This method receives the existing value of THIS_VERSION
|
387
|
+
def resolve_next_version(current_version)
|
388
|
+
next_version = Release.next_version
|
389
|
+
next_version ||= lambda { |v|
|
390
|
+
snapshot = v.match(/-SNAPSHOT$/)
|
391
|
+
version = v.gsub(/-SNAPSHOT$/, "").split(/\./)
|
392
|
+
if snapshot
|
393
|
+
version[-1] = sprintf("%0#{version[-1].size}d", version[-1].to_i + 1) + '-SNAPSHOT'
|
394
|
+
end
|
395
|
+
version.join('.')
|
396
|
+
}
|
397
|
+
next_version = ENV['NEXT_VERSION'] if ENV['NEXT_VERSION']
|
398
|
+
next_version = ENV['next_version'] if ENV['next_version']
|
399
|
+
next_version = next_version.call(current_version) if Proc === next_version
|
400
|
+
next_version
|
401
|
+
end
|
402
|
+
|
360
403
|
# Move the version to next and save the updated buildfile
|
361
404
|
def update_buildfile
|
362
|
-
buildfile = change_version { |version|
|
405
|
+
buildfile = change_version { |version| # THIS_VERSION minus SNAPSHOT
|
406
|
+
resolve_next_version(this_version) # THIS_VERSION
|
407
|
+
}
|
363
408
|
File.open(Buildr.application.buildfile.to_s, 'w') { |file| file.write buildfile }
|
364
409
|
end
|
365
410
|
|
366
|
-
# Return the message to use to
|
411
|
+
# Return the message to use to commit the buildfile with the next version
|
367
412
|
def message
|
368
413
|
version = extract_version
|
369
414
|
msg = Release.commit_message || "Changed version number to #{version}"
|
@@ -396,6 +441,7 @@ module Buildr
|
|
396
441
|
# 1. the repository is clean: no content staged or unstaged
|
397
442
|
# 2. some remote repositories are defined but the current branch does not track any
|
398
443
|
def check
|
444
|
+
super
|
399
445
|
uncommitted = Git.uncommitted_files
|
400
446
|
fail "Uncommitted files violate the First Principle Of Release!\n#{uncommitted.join("\n")}" unless uncommitted.empty?
|
401
447
|
fail "You are releasing from a local branch that does not track a remote!" unless Git.remote
|
@@ -404,9 +450,11 @@ module Buildr
|
|
404
450
|
# Add a tag reference in .git/refs/tags and push it to the remote if any.
|
405
451
|
# If a tag with the same name already exists it will get deleted (in both local and remote repositories).
|
406
452
|
def tag_release(tag)
|
407
|
-
|
408
|
-
|
409
|
-
|
453
|
+
unless this_version == extract_version
|
454
|
+
info "Committing buildfile with version number #{extract_version}"
|
455
|
+
Git.commit File.basename(Buildr.application.buildfile.to_s), message
|
456
|
+
Git.push if Git.remote
|
457
|
+
end
|
410
458
|
info "Tagging release #{tag}"
|
411
459
|
Git.git 'tag', '-d', tag rescue nil
|
412
460
|
Git.git 'push', Git.remote, ":refs/tags/#{tag}" rescue nil if Git.remote
|
@@ -431,11 +479,14 @@ module Buildr
|
|
431
479
|
end
|
432
480
|
|
433
481
|
def check
|
482
|
+
super
|
434
483
|
fail "Uncommitted files violate the First Principle Of Release!\n"+Svn.uncommitted_files.join("\n") unless Svn.uncommitted_files.empty?
|
435
484
|
fail "SVN URL must contain 'trunk' or 'branches/...'" unless Svn.repo_url =~ /(trunk)|(branches.*)$/
|
436
485
|
end
|
437
486
|
|
438
487
|
def tag_release(tag)
|
488
|
+
# Unlike Git, committing the buildfile with the released version is not necessary.
|
489
|
+
# svn tag does commit & tag.
|
439
490
|
info "Tagging release #{tag}"
|
440
491
|
Svn.tag tag
|
441
492
|
end
|
@@ -462,4 +513,4 @@ end
|
|
462
513
|
|
463
514
|
class Buildr::Project
|
464
515
|
include Buildr::Build
|
465
|
-
end
|
516
|
+
end
|
data/lib/buildr/core/compile.rb
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
require 'buildr/core/common'
|
18
|
+
require 'find'
|
18
19
|
|
19
20
|
|
20
21
|
module Buildr
|
@@ -91,7 +92,15 @@ module Buildr
|
|
91
92
|
paths = task.sources + [sources].flatten.map { |src| Array(project.path_to(:source, task.usage, src.to_sym)) }
|
92
93
|
paths.flatten!
|
93
94
|
ext_glob = Array(source_ext).join(',')
|
94
|
-
|
95
|
+
|
96
|
+
paths.each { |path|
|
97
|
+
Find.find(path) {|found|
|
98
|
+
if (!File.directory?(found)) && found.match(/.*\.#{Array(source_ext).join('|')}/)
|
99
|
+
return true
|
100
|
+
end
|
101
|
+
} if File.exist? path
|
102
|
+
}
|
103
|
+
false
|
95
104
|
end
|
96
105
|
|
97
106
|
# Implementations can use this method to specify various compiler attributes.
|