buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Toulme <anto...@lunar-ocean.com>
Subject Re: External extensions use of buildr test infrastructure
Date Sun, 28 Mar 2010 22:16:15 GMT
Look at Buildr4OSGi and the SandBoxHook module to see how I do it. I use
braid to have something that looks like a svn:externals checkout of the
Buildr code.

On my blog, back in September, I gave steps on how to do this:
http://www.lunar-ocean.com/how-to-create-a-plugin-for-buildr/

On Sun, Mar 28, 2010 at 14:52, Peter Donald <peter@realityforge.org> wrote:

> Hi,
>
> I am currently playing with a few different buildr extensions and I
> desire to make use of the test infrastructure part of buildr proper.
> What is the typical approach to doing this sort of thing? Currently I
> have gone with adding something like the following into my spec_helper
> / test_helper
>
>
> ------------------------------------------------------------------------------------------------
> # TODO: If we are installed as a gem we should just add dependency on
> buildr gem and find dir based on that
> DEFAULT_BUILDR_DIR=File.expand_path(File.dirname(__FILE__) +
> '/../../buildr')
> BUILDR_DIR=ENV['BUILDR_DIR'] || DEFAULT_BUILDR_DIR
>
> unless File.exist?("#{BUILDR_DIR}/buildr.gemspec")
>  raise "Unable to find buildr.gemspec in #{BUILDR_DIR ==
> DEFAULT_BUILDR_DIR ? 'guessed' : 'specified'} $BUILD_DIR
> (#{BUILDR_DIR})"
> end
>
> require 'rubygems'
>
> # For testing we use the gem requirements specified on the buildr.gemspec
> Gem::Specification.load(File.expand_path("#{BUILDR_DIR}/buildr.gemspec",
> File.dirname(__FILE__))).
>    dependencies.each { |dep| gem dep.name, dep.requirement.to_s }
>
> ------------------------------------------------------------------------------------------------
>
> Then depending on what types of tests I am running adding something
> like the following a bit later.
>
> require "#{BUILDR_DIR}/spec/spec_helpers.rb"
>
> You can see an example in
> http://github.com/rockninja/buildr-iidea/blob/master/spec/spec_helper.rb
>
> My main goal is to be able to test the plugin against trunk buildr and
> against the last release. Down the track I will also want it to work
> if/when the extension is released as a gem.
>
> So has anyone got a recommend approach to do this sort of thing? Is
> what I am doing the right way of doing things or am I going to run
> into issues?
>
> --
> Cheers,
>
> Peter Donald
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message