You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2009/11/17 17:46:46 UTC

svn commit: r881367 - in /buildr/trunk: CHANGELOG doc/settings_profiles.textile lib/buildr/core/test.rb

Author: boisvert
Date: Tue Nov 17 16:46:46 2009
New Revision: 881367

URL: http://svn.apache.org/viewvc?rev=881367&view=rev
Log:
Environment variable IGNORE_BUILDFILE can be set to "yes" or "true" to ignore 
changes in Buildfile when running tests.

A real timesaver when you're tweaking the Buildfile to get specific tests working.

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/doc/settings_profiles.textile
    buildr/trunk/lib/buildr/core/test.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=881367&r1=881366&r2=881367&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Tue Nov 17 16:46:46 2009
@@ -8,6 +8,8 @@
             eclipse.classpath_variables { :VAR => '/path/to/libraries' }
 * Added:  Support for excluding libraries from Eclipse classpath using:
             eclipse.exclude_libs += ['/path/to/some/library.jar']
+* Added:  Environment variable IGNORE_BUILDFILE can be set to "yes" or
+          "true" to ignore changes in Buildfile when running tests.
 * Change: Updated to JRuby 1.4.0
 * Fixed:  BUILDR-223 Release Task: customizable commit message (Alexis Midon)
 * Fixed:  BUILDR-330  Install task should re-install artifact even if they 

Modified: buildr/trunk/doc/settings_profiles.textile
URL: http://svn.apache.org/viewvc/buildr/trunk/doc/settings_profiles.textile?rev=881367&r1=881366&r2=881367&view=diff
==============================================================================
--- buildr/trunk/doc/settings_profiles.textile (original)
+++ buildr/trunk/doc/settings_profiles.textile Tue Nov 17 16:46:46 2009
@@ -41,6 +41,7 @@
 | @HOME@        | Your home directory. |
 | @HTTP_PROXY@  | URL for HTTP proxy server (see "Specifying Repositories":artifacts.html#repositories). |
 | @HTTPS_PROXY@ | URL for HTTPS proxy server (see "Specifying Repositories":artifacts.html#repositories). |
+| @IGNORE_BUILDFILE@ | Set to "true" or "yes" to ignore changes in Buildfile or its dependencies when running tests. |
 | @JAVA_HOME@   | Points to your JDK, required when using Java and Ant. |
 | @JAVA_OPTS@   | Command line options to pass to the JDK (e.g. @'-Xms1g'@). |
 | @M2_REPO@     | Location of the Maven2 local repository.  Defaults to the @.m2@ directory in your home directory (@ENV['HOME']@). |

Modified: buildr/trunk/lib/buildr/core/test.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/test.rb?rev=881367&r1=881366&r2=881367&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/test.rb (original)
+++ buildr/trunk/lib/buildr/core/test.rb Tue Nov 17 16:46:46 2009
@@ -49,7 +49,7 @@
       end
 
       # Adds a test framework to the list of supported frameworks.
-      #   
+      #
       # For example:
       #   Buildr::TestFramework << Buildr::JUnit
       def add(framework)
@@ -126,7 +126,7 @@
       end
 
     end
-  
+
   end
 
 
@@ -195,7 +195,9 @@
       else
         @options = OpenObject.new(default_options)
       end
-      enhance [application.buildfile.name] do
+
+      enhance application.buildfile.prerequisites unless ENV["IGNORE_BUILDFILE"] =~ /(true)|(yes)/i
+      enhance do
         run_tests if framework
       end
     end
@@ -247,7 +249,7 @@
     def compile(*sources, &block)
       @project.task('test:compile').from(sources).enhance &block
     end
- 
+
     # :call-seq:
     #   resources(*prereqs) => ResourcesTask
     #   resources(*prereqs) { |task| .. } => ResourcesTask
@@ -323,7 +325,7 @@
           Buildr.application.deprecated "Please replace with using(:#{name}=>true)"
           options[name.to_sym] = true
         end
-      end 
+      end
       self
     end
 
@@ -399,12 +401,12 @@
     def last_successful_run_file #:nodoc:
       File.join(report_to.to_s, 'last_successful_run')
     end
-    
+
     # The time stamp of the last successful test run.  Or Rake::EARLY if no successful test run recorded.
     def timestamp #:nodoc:
       File.exist?(last_successful_run_file) ? File.mtime(last_successful_run_file) : Rake::EARLY
     end
-    
+
     # The project this task belongs to.
     attr_reader :project
 
@@ -465,7 +467,7 @@
       mkdir_p report_to.to_s
       touch last_successful_run_file
     end
-    
+
     # Limit running tests to specific list.
     def only_run(tests)
       @include = Array(tests)
@@ -567,7 +569,7 @@
       end
 
     end
-    
+
     before_define(:test) do |project|
       # Define a recursive test task, and pass it a reference to the project so it can discover all other tasks.
       test = TestTask.define_task('test')
@@ -596,7 +598,7 @@
       test.with project.compile.dependencies
       # Picking up the test frameworks adds further dependencies.
       test.framework
-      
+
       project.build test unless test.options[:integration]
 
       project.clean do
@@ -629,7 +631,7 @@
     def test(*prereqs, &block)
       task('test').enhance prereqs, &block
     end
-  
+
     # :call-seq:
     #   integration { |task| .... }
     #   integration => IntegrationTestTask