lib/ivy4r.rb in ivy4r-0.8.0 vs lib/ivy4r.rb in ivy4r-0.8.1

- old
+ new

@@ -33,11 +33,11 @@ {:dir => 'target/p1', :includes => 'buildfile'} ] } =end class Ivy4r - VERSION = '0.8.0' + VERSION = '0.8.1' # Set the ant home directory to load ant classes from if no custom __antwrap__ is provided # and the default provided ant version 1.7.1 should not be used. # Must be set before any call to method that uses the ivy is made. attr_accessor :ant_home @@ -47,19 +47,24 @@ # Optional ant variable <tt>ivy.project.dir</tt> to add to ant environment before loading ivy # defaults to the __lib_dir__ attr_accessor :project_dir + # The ant property name to use for references to environment properties in ant and ivy, + # defaults to 'env' + attr_accessor :environment_property + # To provide a custom __antwrap__ to use instead of default one attr_writer :ant # Initalizes ivy4r with optional ant wrapper object. Sets ant home dir and ivy lib dir # to default values from __Ivy4rJars__ gem. def initialize(ant = nil) @ant_home = ::Ivy4rJars.ant_home_dir @lib_dir = ::Ivy4rJars.lib_dir @project_dir = @lib_dir + @environment_property = 'env' @ant = ant end # Calls the __cleancache__ ivy target with given parameters. def cleancache(*params) @@ -167,9 +172,10 @@ @init_done.nil? || @init_done == false end def init(ant) @init_done = true + ant.property :environment => environment_property ant.property :name => 'ivy.project.dir', :value => project_dir ant.path :id => 'ivy.lib.path' do ant.fileset :dir => lib_dir, :includes => '*.jar' end