You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/08/07 03:48:46 UTC
svn commit: r683468 - in /incubator/buildr/trunk: bin/buildr
lib/buildr/core/application.rb
Author: assaf
Date: Wed Aug 6 18:48:46 2008
New Revision: 683468
URL: http://svn.apache.org/viewvc?rev=683468&view=rev
Log:
Changed the way we time the build to include the lengthy startup time.
Modified:
incubator/buildr/trunk/bin/buildr
incubator/buildr/trunk/lib/buildr/core/application.rb
Modified: incubator/buildr/trunk/bin/buildr
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/bin/buildr?rev=683468&r1=683467&r2=683468&view=diff
==============================================================================
--- incubator/buildr/trunk/bin/buildr (original)
+++ incubator/buildr/trunk/bin/buildr Wed Aug 6 18:48:46 2008
@@ -15,7 +15,16 @@
# the License.
-require 'rubygems'
-require 'buildr'
-
-Buildr.application.run
+require 'benchmark'
+times = Benchmark.measure do
+ require 'rubygems'
+ require 'buildr'
+ Buildr.application.run
+end
+if verbose
+ real = []
+ real << ("%ih" % (times.real / 3600)) if times.real >= 3600
+ real << ("%im" % ((times.real / 60) % 60)) if times.real >= 60
+ real << ("%.3fs" % (times.real % 60))
+ puts $terminal.color("Completed in #{real.join}", :green)
+end
Modified: incubator/buildr/trunk/lib/buildr/core/application.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/core/application.rb?rev=683468&r1=683467&r2=683468&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/core/application.rb (original)
+++ incubator/buildr/trunk/lib/buildr/core/application.rb Wed Aug 6 18:48:46 2008
@@ -171,23 +171,14 @@
private :listed_gems
def run
- @times = Benchmark.measure do
- standard_exception_handling do
- find_buildfile
- load_gems
- load_artifacts
- load_tasks
- load_buildfile
- task('buildr:initialize').invoke
- top_level
- end
- end
- if verbose
- real = []
- real << ("%ih" % (@times.real / 3600)) if @times.real >= 3600
- real << ("%im" % ((@times.real / 60) % 60)) if @times.real >= 60
- real << ("%.3fs" % (@times.real % 60))
- puts $terminal.color("Completed in #{real.join}", :green)
+ standard_exception_handling do
+ find_buildfile
+ load_gems
+ load_artifacts
+ load_tasks
+ load_buildfile
+ task('buildr:initialize').invoke
+ top_level
end
@on_completion.each { |block| block.call }
end