lib/ivy4r.rb in ivy4r-0.9.5 vs lib/ivy4r.rb in ivy4r-0.9.6
- old
+ new
@@ -33,11 +33,11 @@
{:dir => 'target/p1', :includes => 'buildfile'}
]
}
=end
class Ivy4r
- VERSION = '0.9.5'
+ VERSION = '0.9.6'
# 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
@@ -54,10 +54,13 @@
attr_accessor :environment_property
# To provide a custom __antwrap__ to use instead of default one
attr_writer :ant
+ # Access to ivy settings set via configure or settings method.
+ attr_accessor :settings_file
+
# 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
@@ -71,16 +74,22 @@
Ivy::Cleancache.new(ant).execute(*params)
end
# Calls the __settings__ ivy target with given parameters.
def settings(*params)
- Ivy::Settings.new(ant).execute(*params)
+ settings_task = Ivy::Settings.new(ant)
+ result = settings_task.execute(*params)
+ @settings_file = settings_task.params[:file]
+ result
end
# Calls the __configure__ ivy target with given parameters.
def configure(*params)
- Ivy::Configure.new(ant).execute(*params)
+ configure_task = Ivy::Configure.new(ant)
+ result = configure_task.execute(*params)
+ @settings_file = configure_task.params[:file]
+ result
end
# Calls the __info__ ivy target with given parameters and returns info as hash.
def info(*params)
Ivy::Info.new(ant).execute(*params)
@@ -205,9 +214,10 @@
ant.taskdef :name => "ivy_findrevision", :classname => "org.apache.ivy.ant.IvyFindRevision", :classpathref => "ivy.lib.path", :loaderRef => 'ivy.lib.path.loader'
ant.taskdef :name => "ivy_buildnumber", :classname => "org.apache.ivy.ant.IvyBuildNumber", :classpathref => "ivy.lib.path", :loaderRef => 'ivy.lib.path.loader'
ant.taskdef :name => "ivy_cleancache", :classname => "org.apache.ivy.ant.IvyCleanCache", :classpathref => "ivy.lib.path", :loaderRef => 'ivy.lib.path.loader'
end
+ # Returns the ant properties, note that this are java objects.
def ant_properties
ant.project.properties
end
end