ivy4r 0.10.5 → 0.11.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.
@@ -1,3 +1,8 @@
1
+ === 0.11.0 / 2010-05-31
2
+ * Fixed a few bugs and issues reported by Rhett Sutphin. See issues on github 3-6.
3
+ * Ivy4r should work with MRI and JRuby, previously only JRuby was supported.
4
+ * The multi ivy.xml file support should work now.
5
+
1
6
  === 0.10.5 / 2010-04-26
2
7
  * Fix a bug where artifacts for sub-projects have not been copied correctly to the publish directory
3
8
  defined for ivy.
data/README.txt CHANGED
@@ -57,19 +57,41 @@ the variable "ivy: caching.enabled: true".
57
57
  For Rake the targets ivy:enable_result_cache, ivy:disable_result_cache and ivy:clean_result_cache have been added as
58
58
  well. For Rake there is no other way to enable the caching beside this targets.
59
59
 
60
+ == Notes about usage and testing:
61
+ A few information how this project is used and what parts are well tested and what parts are nearly never used.
62
+
63
+ === Buildr extension:
64
+ The buildr extension is tested only on projects with a single ivy.xml, the multi ivy.xml file support was added
65
+ but was never tested extensively!
66
+
67
+ === Rake extension:
68
+ Note that the rake extension is only test in JRuby Rails projects to publish a java WAR file into the repository.
69
+ It does not offer as many features as the buildr extension.
70
+
60
71
  == SYNOPSIS:
61
72
 
73
+ ivy4r plain:
62
74
  To init a new Ivy4r instance set the ANT_HOME and the Ivy lib dir
63
75
  ivy4r = Ivy4r.new
64
76
  ivy4r.ant_home = 'PATH TO YOUR ANTHOME'
65
77
  ivy4r.lib_dir = 'PATH TO IVY LIB DIR'
66
78
  as an alternative to setting the ANT_HOME you can set an +Antwrap+ instance directly:
67
79
  ivy4r.ant = Buildr.ant('ivy')
80
+
81
+ buildr:
82
+ TODO add buildr example
83
+
84
+ rake:
85
+ TODO add rake example
68
86
 
69
87
  == REQUIREMENTS:
70
88
 
89
+ Plain ivy4r:
71
90
  * Installed Apache Ant, to call Ivy via Antwrap
72
91
  * Ivy and dependencies in a single directory. Dependencies depends on used features, see the ivy homepage for more information.
92
+ * JRuby is well tested, MRI support has been added with version 0.11.0 so use it at your own risk.
93
+ * Rake to use the rake extension
94
+ * Buildr to use the buildr extension
73
95
 
74
96
  == INSTALL:
75
97
 
@@ -35,24 +35,22 @@ module Buildr
35
35
  # Store the current project and initialize ivy ant wrapper
36
36
  def initialize(project)
37
37
  @project = project
38
- if project.parent.nil?
39
- @extension_dir = @project.base_dir
40
- @post_resolve_task_list = []
41
- else
42
- @extension_dir = @project.parent.ivy.extension_dir
43
- @base_ivy = @project.parent.ivy unless own_file?
44
- end
38
+ @post_resolve_task_list = []
39
+ @extension_dir = project.parent.nil? ? @project.base_dir : @project.parent.ivy.extension_dir
40
+ @base_ivy = @project.parent.ivy unless own_file?
45
41
  @target_config = Hash.new do
46
42
  |hash, key| hash[key] = {}
47
43
  end
44
+
48
45
  end
49
46
 
50
47
  def enabled?
51
- @enabled ||= Ivy.setting('enabled') || true
48
+ setting = Ivy.setting('enabled')
49
+ @enabled ||= setting.nil? ? true : setting
52
50
  end
53
51
 
54
52
  def own_file?
55
- @own_file ||= File.exists?(@project.path_to(file))
53
+ @own_file ||= File.exists?(file)
56
54
  end
57
55
 
58
56
  # Returns the correct ivy4r instance to use, if project has its own ivy file uses the ivy file
@@ -160,7 +158,7 @@ module Buildr
160
158
  @base_ivy.__resolve__
161
159
  else
162
160
  unless @resolved
163
- @resolved = ivy4r.resolve :file => file
161
+ @resolved = ivy4r.resolve :file => file
164
162
  @project.send(:info, "Calling '#{post_resolve_tasks.size}' post_resolve tasks for '#{@project.name}'")
165
163
  post_resolve_tasks.each { |p| p.call(self) }
166
164
  end
@@ -197,8 +195,8 @@ module Buildr
197
195
  @base_ivy.__publish__
198
196
  else
199
197
  unless @published
200
- options = {:status => status, :pubrevision => revision, :artifactspattern => "#{publish_from}/[artifact].[ext]"}
201
- options = publish_options * options
198
+ base_options = {:status => status, :pubrevision => revision, :artifactspattern => "#{publish_from}/[artifact].[ext]"}
199
+ options = publish_options * base_options
202
200
  ivy4r.publish options
203
201
  @published = true
204
202
  end
@@ -217,10 +215,17 @@ module Buildr
217
215
  @settings ||= Ivy.setting('settings.file') || "#{@extension_dir}/ant-scripts/ivysettings.xml"
218
216
  end
219
217
 
220
- def file
218
+ # The basic file name to use in project dir as ivy.xml file. Normally this should be __ivy.xml__
219
+ # If the file resides in a sub directory the relative path from project can be set with this method
220
+ def ivy_xml_filename
221
221
  @ivy_file ||= Ivy.setting('ivy.file') || 'ivy.xml'
222
222
  end
223
223
 
224
+ # Returns the absolute ivy file path to use
225
+ def file
226
+ @project.path_to(ivy_xml_filename)
227
+ end
228
+
224
229
  # Sets the revision to use for the project, this is useful for development revisions that
225
230
  # have an appended timestamp or any other dynamic revisioning.
226
231
  #
@@ -284,7 +289,7 @@ module Buildr
284
289
  if @publish_options_calc
285
290
  @publish_options ||= @publish_options_calc.call(self)
286
291
  else
287
- @publish_options ||= Ivy.setting('publish.options')
292
+ @publish_options ||= Ivy.setting('publish.options') || {}
288
293
  end
289
294
  else
290
295
  raise "Could not set 'publish_options' for '#{@project.name}' without own ivy file!" unless own_file?
@@ -137,14 +137,29 @@ module Ivy
137
137
  end
138
138
 
139
139
  def ant_properties
140
- @ant.project.properties
140
+ p = @ant.project.properties
141
+ p.respond_to?(:map) ? p : java_map_to_ruby_hash(p)
141
142
  end
142
143
 
143
144
  def ant_references
144
- @ant.project.references
145
+ r = @ant.project.references
146
+ r.respond_to?(:map) ? r : java_map_to_ruby_hash(r)
147
+ end
148
+
149
+ private
150
+ def java_map_to_ruby_hash(java_map)
151
+ iterator = java_map.entry_set.iterator
152
+ result = {}
153
+ while iterator.has_next
154
+ entry = iterator.next
155
+ result[entry.key.to_string] = entry.value.to_string
156
+ end
157
+ result
145
158
  end
146
159
  end
147
160
 
161
+
162
+
148
163
  COMMA_SPLITTER = Proc.new {|value| value.to_s.split(',').map(&:strip)}
149
164
 
150
165
  Parameter = Struct.new(:symbol, :mandatory) do
@@ -36,7 +36,7 @@ is
36
36
  =end
37
37
  class Ivy4r
38
38
 
39
- VERSION = '0.10.5'
39
+ VERSION = '0.11.0'
40
40
 
41
41
  # Set the ant home directory to load ant classes from if no custom __antwrap__ is provided
42
42
  # and the default provided ant version 1.7.1 should not be used.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ivy4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaas Prause
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-26 00:00:00 +02:00
12
+ date: 2010-05-31 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency