ivy4r 0.7.2 → 0.7.3
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/History.txt +10 -0
- data/lib/buildr/ivy_extension.rb +33 -29
- data/lib/ivy4r.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
=== 0.7.3 / 2009-09-15
|
|
2
|
+
|
|
3
|
+
* Renamed +ant+ to +ivy4r+ in buildr extension to make more clear what this object does. It is accesible
|
|
4
|
+
via call to +project.ivy.ivy4r+, use it in post_resolve or other places where the low level
|
|
5
|
+
ivy functions are needed in any way.
|
|
6
|
+
* Added access to buildr_extension to get the configured mappings for artifacts to ivy publish names.
|
|
7
|
+
I.e. configured +ivy.publish package(:jar) => 'name.jar'
|
|
8
|
+
access this hash via +ivy.publish_mappings+
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
=== 0.7.2 / 2009-09-08
|
|
2
12
|
|
|
3
13
|
* Fix bug for creating EARs. The package dependencies are added into the root directory
|
data/lib/buildr/ivy_extension.rb
CHANGED
|
@@ -33,6 +33,9 @@ module Buildr
|
|
|
33
33
|
attr_accessor :extension_dir, :resolved
|
|
34
34
|
|
|
35
35
|
attr_reader :post_resolve_task_list
|
|
36
|
+
|
|
37
|
+
# Hash of all artifacts to publish with mapping from artifact name to ivy publish name
|
|
38
|
+
attr_reader :publish_mappings
|
|
36
39
|
|
|
37
40
|
# Store the current project and initialize ivy ant wrapper
|
|
38
41
|
def initialize(project)
|
|
@@ -57,19 +60,20 @@ module Buildr
|
|
|
57
60
|
@own_file ||= File.exists?(@project.path_to(file))
|
|
58
61
|
end
|
|
59
62
|
|
|
60
|
-
# Returns the correct
|
|
63
|
+
# Returns the correct ivy4r instance to use, if project has its own ivy file uses the ivy file
|
|
61
64
|
# of project, if not uses the ivy file of parent project.
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
# Use this for low-level access to ivy functions as needed, i.e. in +post_resolve+
|
|
66
|
+
def ivy4r
|
|
67
|
+
unless @ivy4r
|
|
64
68
|
if own_file?
|
|
65
|
-
@
|
|
66
|
-
@
|
|
67
|
-
@
|
|
69
|
+
@ivy4r = ::Ivy4r.new(@project.ant('ivy'))
|
|
70
|
+
@ivy4r.lib_dir = lib_dir if lib_dir
|
|
71
|
+
@ivy4r.project_dir = @extension_dir
|
|
68
72
|
else
|
|
69
|
-
@
|
|
73
|
+
@ivy4r = @project.parent.ivy.ivy4r
|
|
70
74
|
end
|
|
71
75
|
end
|
|
72
|
-
@
|
|
76
|
+
@ivy4r
|
|
73
77
|
end
|
|
74
78
|
|
|
75
79
|
# Returns name of the project the ivy file belongs to.
|
|
@@ -84,18 +88,18 @@ module Buildr
|
|
|
84
88
|
confs = confs.reject {|c| c.nil? || c.blank? }
|
|
85
89
|
unless confs.empty?
|
|
86
90
|
pathid = "ivy.deps." + confs.join('.')
|
|
87
|
-
|
|
91
|
+
ivy4r.cachepath :conf => confs.join(','), :pathid => pathid
|
|
88
92
|
end
|
|
89
93
|
end
|
|
90
94
|
|
|
91
|
-
# Returns ivy info for configured ivy file using a new
|
|
95
|
+
# Returns ivy info for configured ivy file using a new ivy4r instance.
|
|
92
96
|
def info
|
|
93
97
|
if @base_ivy
|
|
94
98
|
@base_ivy.info
|
|
95
99
|
else
|
|
96
|
-
|
|
97
|
-
result =
|
|
98
|
-
@
|
|
100
|
+
ivy4r.settings :id => 'ivy.info.settingsref'
|
|
101
|
+
result = ivy4r.info :file => file, :settingsRef => 'ivy.info.settingsref'
|
|
102
|
+
@ivy4r = nil
|
|
99
103
|
result
|
|
100
104
|
end
|
|
101
105
|
end
|
|
@@ -106,10 +110,10 @@ module Buildr
|
|
|
106
110
|
@base_ivy.configure
|
|
107
111
|
else
|
|
108
112
|
unless @configured
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
properties.each {|key, value|
|
|
112
|
-
@configured =
|
|
113
|
+
ivy4r.property['ivy.status'] = status
|
|
114
|
+
ivy4r.property['ivy.home'] = home
|
|
115
|
+
properties.each {|key, value| ivy4r.property[key.to_s] = value }
|
|
116
|
+
@configured = ivy4r.settings :file => settings if settings
|
|
113
117
|
end
|
|
114
118
|
end
|
|
115
119
|
end
|
|
@@ -120,7 +124,7 @@ module Buildr
|
|
|
120
124
|
@base_ivy.__resolve__
|
|
121
125
|
else
|
|
122
126
|
unless @resolved
|
|
123
|
-
@resolved =
|
|
127
|
+
@resolved = ivy4r.resolve :file => file
|
|
124
128
|
@project.send(:info, "Calling '#{post_resolve_tasks.size}' post_resolve tasks for '#{@project.name}'")
|
|
125
129
|
post_resolve_tasks.each { |p| p.call(self) }
|
|
126
130
|
end
|
|
@@ -142,7 +146,7 @@ module Buildr
|
|
|
142
146
|
|
|
143
147
|
# Creates the standard ivy dependency report
|
|
144
148
|
def report
|
|
145
|
-
|
|
149
|
+
ivy4r.report :todir => report_dir
|
|
146
150
|
end
|
|
147
151
|
|
|
148
152
|
# Publishs the project as defined in ivy file if it has not been published already
|
|
@@ -153,7 +157,7 @@ module Buildr
|
|
|
153
157
|
unless @published
|
|
154
158
|
options = {:status => status, :pubrevision => revision, :artifactspattern => "#{publish_from}/[artifact].[ext]"}
|
|
155
159
|
options = publish_options * options
|
|
156
|
-
|
|
160
|
+
ivy4r.publish options
|
|
157
161
|
@published = true
|
|
158
162
|
end
|
|
159
163
|
end
|
|
@@ -181,7 +185,7 @@ module Buildr
|
|
|
181
185
|
# To set a different revision this method can be used in different ways.
|
|
182
186
|
# 1. project.ivy.revision(revision) to set the revision directly
|
|
183
187
|
# 2. project.ivy.revision { |ivy| [calculate revision] } use the block for dynamic
|
|
184
|
-
# calculation of the revision. You can access ivy4r via <tt>ivy.
|
|
188
|
+
# calculation of the revision. You can access ivy4r via <tt>ivy.ivy4r.[method]</tt>
|
|
185
189
|
def revision(*revision, &block)
|
|
186
190
|
raise "Invalid call with parameters and block!" if revision.size > 0 && block
|
|
187
191
|
if revision.empty? && block.nil?
|
|
@@ -206,7 +210,7 @@ module Buildr
|
|
|
206
210
|
# To set a different status this method can be used in different ways.
|
|
207
211
|
# 1. project.ivy.status(status) to set the status directly
|
|
208
212
|
# 2. project.ivy.status { |ivy| [calculate status] } use the block for dynamic
|
|
209
|
-
# calculation of the status. You can access ivy4r via <tt>ivy.
|
|
213
|
+
# calculation of the status. You can access ivy4r via <tt>ivy.ivy4r.[method]</tt>
|
|
210
214
|
def status(*status, &block)
|
|
211
215
|
raise "Invalid call with parameters and block!" if status.size > 0 && block
|
|
212
216
|
if status.empty? && block.nil?
|
|
@@ -231,7 +235,7 @@ module Buildr
|
|
|
231
235
|
# To set the options this method can be used in different ways.
|
|
232
236
|
# 1. project.ivy.publish_options(options) to set the options directly
|
|
233
237
|
# 2. project.ivy.publish_options { |ivy| [calculate options] } use the block for dynamic
|
|
234
|
-
# calculation of options. You can access ivy4r via <tt>ivy.
|
|
238
|
+
# calculation of options. You can access ivy4r via <tt>ivy.ivy4r.[method]</tt>
|
|
235
239
|
def publish_options(*options, &block)
|
|
236
240
|
raise "Invalid call with parameters and block!" if options.size > 0 && block
|
|
237
241
|
if options.empty? && block.nil?
|
|
@@ -288,12 +292,12 @@ module Buildr
|
|
|
288
292
|
# for publishing use a hash with the +package+ as key and the newly mapped name as value. I.e.
|
|
289
293
|
# <tt>ivy.name(package(:jar) => 'new_name_without_version_number.jar')</tt>
|
|
290
294
|
# Note that this method is additive, a second call adds the names to the first.
|
|
291
|
-
def name(*
|
|
292
|
-
if
|
|
293
|
-
@
|
|
295
|
+
def name(*publish_mappings)
|
|
296
|
+
if publish_mappings.empty?
|
|
297
|
+
@publish_mappings ||= {}
|
|
294
298
|
else
|
|
295
|
-
raise "
|
|
296
|
-
@
|
|
299
|
+
raise "publish_mappings value invalid #{publish_mappings.join(', ')}" unless publish_mappings.size == 1
|
|
300
|
+
@publish_mappings = @publish_mappings ? @publish_mappings + publish_mappings[0] : publish_mappings[0].dup
|
|
297
301
|
self
|
|
298
302
|
end
|
|
299
303
|
end
|
|
@@ -633,7 +637,7 @@ For more configuration options see IvyConfig.
|
|
|
633
637
|
task :clean do
|
|
634
638
|
info "Cleaning local ivy cache"
|
|
635
639
|
Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
|
|
636
|
-
project.ivy.
|
|
640
|
+
project.ivy.ivy4r.clean
|
|
637
641
|
end
|
|
638
642
|
end
|
|
639
643
|
|
data/lib/ivy4r.rb
CHANGED
metadata
CHANGED
|
@@ -89,14 +89,14 @@ requirements: []
|
|
|
89
89
|
|
|
90
90
|
authors:
|
|
91
91
|
- Klaas Prause
|
|
92
|
-
date: 2009-09-
|
|
92
|
+
date: 2009-09-14 22:00:00 +00:00
|
|
93
93
|
platform: ruby
|
|
94
94
|
test_files:
|
|
95
95
|
- test/test_ivy4r.rb
|
|
96
96
|
- test/ivy/test_target.rb
|
|
97
97
|
- test/ivy/test_targets.rb
|
|
98
98
|
version: !ruby/object:Gem::Version
|
|
99
|
-
version: 0.7.
|
|
99
|
+
version: 0.7.3
|
|
100
100
|
require_paths:
|
|
101
101
|
- lib
|
|
102
102
|
dependencies:
|