klaas1979-ivy4r 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Manifest.txt CHANGED
@@ -3,9 +3,6 @@ Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
5
  bin/ivy4r
6
- jars/lib/ant-1.7.1.jar
7
- jars/lib/ant-launcher-1.7.1.jar
8
- jars/lib/ant-trax-1.7.1.jar
9
6
  lib/buildr/ivy_extension.rb
10
7
  lib/ivy/artifactproperty.rb
11
8
  lib/ivy/artifactreport.rb
data/Rakefile CHANGED
@@ -4,12 +4,13 @@ $:.unshift File.join(File.dirname(__FILE__), 'lib')
4
4
  require 'rubygems'
5
5
  require 'hoe'
6
6
  require 'ivy4r'
7
-
7
+
8
8
  hoe = Hoe.spec 'ivy4r' do |p|
9
9
  # self.rubyforge_name = 'ivy4rx' # if different than 'ivy4r'
10
10
  p.developer('Klaas Prause', 'klaas.prause@googlemail.com')
11
11
  p.remote_rdoc_dir = '' # Release to root only one project
12
- p.extra_deps = [['Antwrap', '>=0.7.0']]
12
+ p.extra_deps << ['Antwrap', '>=0.7.0']
13
+ p.extra_deps << ['ivy4r-jars', '>=1.0.0']
13
14
  File.open(File.join(File.dirname(__FILE__), 'VERSION'), 'w') do |file|
14
15
  file.puts Ivy4r::VERSION
15
16
  end
@@ -55,7 +55,7 @@ module Buildr
55
55
  unless @ant
56
56
  if own_file?
57
57
  @ant = ::Ivy4r.new(@project.ant('ivy'))
58
- @ant.lib_dir = lib_dir
58
+ @ant.lib_dir = lib_dir if lib_dir
59
59
  @ant.project_dir = @extension_dir
60
60
  else
61
61
  @ant = @project.parent.ivy.ant
@@ -148,7 +148,7 @@ module Buildr
148
148
  end
149
149
 
150
150
  def lib_dir
151
- @lib_dir ||= Ivy.setting('lib.dir') || "#{home}/jars"
151
+ @lib_dir ||= Ivy.setting('lib.dir')
152
152
  end
153
153
 
154
154
  def settings
data/lib/ivy4r.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'ivy4r_jars'
1
2
  require 'antwrap'
2
3
  require 'ivy/targets'
3
4
 
@@ -34,7 +35,7 @@ is
34
35
  }
35
36
  =end
36
37
  class Ivy4r
37
- VERSION = '0.4.0'
38
+ VERSION = '0.5.0'
38
39
 
39
40
  # Set the ant home directory to load ant classes from if no custom __antwrap__ is provided
40
41
  # and the default provided ant version 1.7.1 should not be used.
@@ -44,14 +45,20 @@ class Ivy4r
44
45
  # Defines the directory to load ivy libs and its dependencies from
45
46
  attr_accessor :lib_dir
46
47
 
48
+ # Optional ant variable <tt>ivy.project.dir</tt> to add to ant environment before loading ivy
49
+ # defaults to the __lib_dir__
47
50
  attr_accessor :project_dir
48
51
 
49
52
  # To provide a custom __antwrap__ to use instead of default one
50
53
  attr_writer :ant
51
54
 
52
- def initialize(*opts)
53
- @ant = opts[0] if opts.size == 1
54
- raise "To many parameters to create Ivy4r use none, or 1 to set ANT!" if opts.size > 1
55
+ # Initalizes ivy4r with optional ant wrapper object. Sets ant home dir and ivy lib dir
56
+ # to default values from __Ivy4rJars__ gem.
57
+ def initialize(ant = nil)
58
+ @ant_home = ::Ivy4rJars.ant_home_dir
59
+ @lib_dir = ::Ivy4rJars.lib_dir
60
+ @project_dir = @lib_dir
61
+ @ant = ant
55
62
  end
56
63
 
57
64
  # Calls the __cleancache__ ivy target with given parameters.
@@ -149,7 +156,7 @@ class Ivy4r
149
156
  # Returns the __antwrap__ instance to use for all internal calls creates a default
150
157
  # instance if no instance has been set before.
151
158
  def ant
152
- @ant ||= ::Antwrap::AntProject.new(:ant_home => ant_home || File.expand_path(File.join(File.dirname(__FILE__), '..', 'jars')),
159
+ @ant ||= ::Antwrap::AntProject.new(:ant_home => ant_home,
153
160
  :name => "ivy-ant", :basedir => Dir.pwd, :declarative => true)
154
161
  init(@ant) if should_init?
155
162
  @ant
@@ -8,6 +8,9 @@ module Rake
8
8
  module Ivy
9
9
  class IvyConfig
10
10
 
11
+ # The directory to load ivy jars and its dependencies from, leave __nil__ to use default
12
+ attr_accessor :lib_dir
13
+
11
14
  # The extension directory containing ivy settings, the local repository and cache
12
15
  attr_accessor :extension_dir
13
16
 
@@ -24,7 +27,7 @@ module Rake
24
27
  def ant
25
28
  unless @ant
26
29
  @ant = ::Ivy4r.new
27
- @ant.lib_dir = lib_dir
30
+ @ant.lib_dir = lib_dir if lib_dir
28
31
  @ant.project_dir = @extension_dir
29
32
  end
30
33
  @ant
@@ -81,10 +84,6 @@ module Rake
81
84
  @ivy_home_dir ||= "#{@extension_dir}/ivy-home"
82
85
  end
83
86
 
84
- def lib_dir
85
- @lib_dir ||= "#{home}/jars"
86
- end
87
-
88
87
  def settings
89
88
  @settings ||= "#{@extension_dir}/ant-scripts/ivysettings.xml"
90
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaas1979-ivy4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaas Prause
@@ -22,6 +22,16 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.7.0
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: ivy4r-jars
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ version:
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: hoe
27
37
  type: :development
@@ -49,9 +59,6 @@ files:
49
59
  - README.txt
50
60
  - Rakefile
51
61
  - bin/ivy4r
52
- - jars/lib/ant-1.7.1.jar
53
- - jars/lib/ant-launcher-1.7.1.jar
54
- - jars/lib/ant-trax-1.7.1.jar
55
62
  - lib/buildr/ivy_extension.rb
56
63
  - lib/ivy/artifactproperty.rb
57
64
  - lib/ivy/artifactreport.rb
Binary file
Binary file
Binary file