ivy4r 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/README.txt +102 -102
- data/lib/buildr/ivy_extension.rb +10 -10
- data/lib/ivy4r.rb +2 -1
- data/lib/rake/ivy_extension.rb +349 -345
- metadata +7 -7
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 0.10.1 / 2010-03-30
|
2
|
+
* Some fixes for the rake ivy result caching.
|
3
|
+
* Renamed the targets from ivy:enableresultcache, ivy:disableresultcache and ivy:cleanresultcache
|
4
|
+
into ivy:enable_result_cache, ivy:disable_result_cache and ivy:clean_result_cache for better
|
5
|
+
readability
|
6
|
+
|
1
7
|
=== 0.10.0 / 2010-03-30
|
2
8
|
|
3
9
|
* Add caching support to ivy4r. Ivy4r has now an optional parameter to a caching directory where it
|
@@ -11,7 +17,6 @@
|
|
11
17
|
* add a marker file to your project under the path project.path_to('use_ivy_caching') Note that this is
|
12
18
|
a marker file only the existence of the file is checked not the content!! If the file exists caching
|
13
19
|
will be used!
|
14
|
-
|
15
20
|
|
16
21
|
=== 0.9.15 / 2010-03-20
|
17
22
|
|
data/README.txt
CHANGED
@@ -1,102 +1,102 @@
|
|
1
|
-
= ivy4r
|
2
|
-
|
3
|
-
* http://github.com/klaas1979/ivy4r/tree/master
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
Apache Ivy dependency manager wrapper for ruby (see {Apache Ivy}[http://ant.apache.org/ivy/index.html] for more information).
|
8
|
-
Use {Apache Ivy}[http://ant.apache.org/ivy/index.html] via a ruby wrapper without the need to use Apache Ant.
|
9
|
-
The wrapper uses Antwrap[http://antwrap.rubyforge.org/] to interface with Ivy.
|
10
|
-
|
11
|
-
Includes a Extension for Buildr[http://buildr.apache.org/] and Rake[http://rake.rubyforge.org] to use
|
12
|
-
{Apache Ivy}[http://ant.apache.org/ivy/index.html] for dependency management.
|
13
|
-
|
14
|
-
== FEATURES/PROBLEMS:
|
15
|
-
|
16
|
-
Supports most standard Ivy Ant targets via Antwrap. Provides a caching feature so that long running ivy tasks
|
17
|
-
like resolve can be cached and are not rerun for local builds. For more information about caching see the History.txt
|
18
|
-
and checkout the source of buildr/ivy_extension.rb and rake/ivy_extension.rb.
|
19
|
-
|
20
|
-
=== Supported Ivy targets:
|
21
|
-
* info
|
22
|
-
* settings
|
23
|
-
* configure
|
24
|
-
* cleancache
|
25
|
-
* buildnumber
|
26
|
-
* findrevision
|
27
|
-
* cachepath
|
28
|
-
* artifactreport
|
29
|
-
* resolve
|
30
|
-
* makepom
|
31
|
-
* retrieve
|
32
|
-
* publish
|
33
|
-
* artifactproperty
|
34
|
-
* report
|
35
|
-
* buildlist
|
36
|
-
* deliver
|
37
|
-
* install
|
38
|
-
* repreport
|
39
|
-
|
40
|
-
=== Currently not working Ivy targets:
|
41
|
-
* listmodules
|
42
|
-
|
43
|
-
=== Ivy targets that need to be implemented:
|
44
|
-
* deliver
|
45
|
-
* install
|
46
|
-
* repreport
|
47
|
-
|
48
|
-
=== Unsupported Ivy Targets (they make no sense for the wrapper):
|
49
|
-
* cachefileset
|
50
|
-
* var
|
51
|
-
|
52
|
-
=== Caching of Ivy results:
|
53
|
-
For Buildr the targets ivy:
|
54
|
-
Additionally the result cache can be enabled via the build.yaml or the global buildr settings.yaml by setting
|
55
|
-
the variable "ivy: caching.enabled: true".
|
56
|
-
|
57
|
-
For Rake the targets ivy:
|
58
|
-
well. For Rake there is no other way to enable the caching beside this targets.
|
59
|
-
|
60
|
-
== SYNOPSIS:
|
61
|
-
|
62
|
-
To init a new Ivy4r instance set the ANT_HOME and the Ivy lib dir
|
63
|
-
ivy4r = Ivy4r.new
|
64
|
-
ivy4r.ant_home = 'PATH TO YOUR ANTHOME'
|
65
|
-
ivy4r.lib_dir = 'PATH TO IVY LIB DIR'
|
66
|
-
as an alternative to setting the ANT_HOME you can set an +Antwrap+ instance directly:
|
67
|
-
ivy4r.ant = Buildr.ant('ivy')
|
68
|
-
|
69
|
-
== REQUIREMENTS:
|
70
|
-
|
71
|
-
* Installed Apache Ant, to call Ivy via Antwrap
|
72
|
-
* Ivy and dependencies in a single directory. Dependencies depends on used features, see the ivy homepage for more information.
|
73
|
-
|
74
|
-
== INSTALL:
|
75
|
-
|
76
|
-
You can use gemcutter to install
|
77
|
-
sudo gem install ivy4r
|
78
|
-
|
79
|
-
== LICENSE:
|
80
|
-
|
81
|
-
(The MIT License)
|
82
|
-
|
83
|
-
Copyright (c) 2009 blau Mobilfunk GmbH
|
84
|
-
|
85
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
86
|
-
a copy of this software and associated documentation files (the
|
87
|
-
'Software'), to deal in the Software without restriction, including
|
88
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
89
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
90
|
-
permit persons to whom the Software is furnished to do so, subject to
|
91
|
-
the following conditions:
|
92
|
-
|
93
|
-
The above copyright notice and this permission notice shall be
|
94
|
-
included in all copies or substantial portions of the Software.
|
95
|
-
|
96
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
97
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
98
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
99
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
100
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
101
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
102
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
= ivy4r
|
2
|
+
|
3
|
+
* http://github.com/klaas1979/ivy4r/tree/master
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Apache Ivy dependency manager wrapper for ruby (see {Apache Ivy}[http://ant.apache.org/ivy/index.html] for more information).
|
8
|
+
Use {Apache Ivy}[http://ant.apache.org/ivy/index.html] via a ruby wrapper without the need to use Apache Ant.
|
9
|
+
The wrapper uses Antwrap[http://antwrap.rubyforge.org/] to interface with Ivy.
|
10
|
+
|
11
|
+
Includes a Extension for Buildr[http://buildr.apache.org/] and Rake[http://rake.rubyforge.org] to use
|
12
|
+
{Apache Ivy}[http://ant.apache.org/ivy/index.html] for dependency management.
|
13
|
+
|
14
|
+
== FEATURES/PROBLEMS:
|
15
|
+
|
16
|
+
Supports most standard Ivy Ant targets via Antwrap. Provides a caching feature so that long running ivy tasks
|
17
|
+
like resolve can be cached and are not rerun for local builds. For more information about caching see the History.txt
|
18
|
+
and checkout the source of buildr/ivy_extension.rb and rake/ivy_extension.rb.
|
19
|
+
|
20
|
+
=== Supported Ivy targets:
|
21
|
+
* info
|
22
|
+
* settings
|
23
|
+
* configure
|
24
|
+
* cleancache
|
25
|
+
* buildnumber
|
26
|
+
* findrevision
|
27
|
+
* cachepath
|
28
|
+
* artifactreport
|
29
|
+
* resolve
|
30
|
+
* makepom
|
31
|
+
* retrieve
|
32
|
+
* publish
|
33
|
+
* artifactproperty
|
34
|
+
* report
|
35
|
+
* buildlist
|
36
|
+
* deliver
|
37
|
+
* install
|
38
|
+
* repreport
|
39
|
+
|
40
|
+
=== Currently not working Ivy targets:
|
41
|
+
* listmodules
|
42
|
+
|
43
|
+
=== Ivy targets that need to be implemented:
|
44
|
+
* deliver
|
45
|
+
* install
|
46
|
+
* repreport
|
47
|
+
|
48
|
+
=== Unsupported Ivy Targets (they make no sense for the wrapper):
|
49
|
+
* cachefileset
|
50
|
+
* var
|
51
|
+
|
52
|
+
=== Caching of Ivy results:
|
53
|
+
For Buildr the targets ivy:enable_result_cache, ivy:disable_result_cache and ivy:clean_result_cache have been added.
|
54
|
+
Additionally the result cache can be enabled via the build.yaml or the global buildr settings.yaml by setting
|
55
|
+
the variable "ivy: caching.enabled: true".
|
56
|
+
|
57
|
+
For Rake the targets ivy:enable_result_cache, ivy:disable_result_cache and ivy:clean_result_cache have been added as
|
58
|
+
well. For Rake there is no other way to enable the caching beside this targets.
|
59
|
+
|
60
|
+
== SYNOPSIS:
|
61
|
+
|
62
|
+
To init a new Ivy4r instance set the ANT_HOME and the Ivy lib dir
|
63
|
+
ivy4r = Ivy4r.new
|
64
|
+
ivy4r.ant_home = 'PATH TO YOUR ANTHOME'
|
65
|
+
ivy4r.lib_dir = 'PATH TO IVY LIB DIR'
|
66
|
+
as an alternative to setting the ANT_HOME you can set an +Antwrap+ instance directly:
|
67
|
+
ivy4r.ant = Buildr.ant('ivy')
|
68
|
+
|
69
|
+
== REQUIREMENTS:
|
70
|
+
|
71
|
+
* Installed Apache Ant, to call Ivy via Antwrap
|
72
|
+
* Ivy and dependencies in a single directory. Dependencies depends on used features, see the ivy homepage for more information.
|
73
|
+
|
74
|
+
== INSTALL:
|
75
|
+
|
76
|
+
You can use gemcutter to install
|
77
|
+
sudo gem install ivy4r
|
78
|
+
|
79
|
+
== LICENSE:
|
80
|
+
|
81
|
+
(The MIT License)
|
82
|
+
|
83
|
+
Copyright (c) 2009 blau Mobilfunk GmbH
|
84
|
+
|
85
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
86
|
+
a copy of this software and associated documentation files (the
|
87
|
+
'Software'), to deal in the Software without restriction, including
|
88
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
89
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
90
|
+
permit persons to whom the Software is furnished to do so, subject to
|
91
|
+
the following conditions:
|
92
|
+
|
93
|
+
The above copyright notice and this permission notice shall be
|
94
|
+
included in all copies or substantial portions of the Software.
|
95
|
+
|
96
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
97
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
98
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
99
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
100
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
101
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
102
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/buildr/ivy_extension.rb
CHANGED
@@ -690,18 +690,18 @@ module IvyExtension
|
|
690
690
|
project.ivy.cleancache
|
691
691
|
end
|
692
692
|
|
693
|
-
task :
|
693
|
+
task :clean_result_cache do
|
694
694
|
project.send(:info, "Deleting IVY result cache dir '#{project.ivy.result_cache_dir}'")
|
695
695
|
rm_rf project.ivy.result_cache_dir
|
696
696
|
end
|
697
697
|
|
698
|
-
task :
|
698
|
+
task :enable_result_cache do
|
699
699
|
project.send(:info, "Creating IVY caching marker file '#{project.ivy.caching_marker}'")
|
700
700
|
touch project.ivy.caching_marker
|
701
701
|
end
|
702
702
|
|
703
|
-
task :
|
704
|
-
project.send(:info, "Deleting IVY
|
703
|
+
task :disable_result_cache do
|
704
|
+
project.send(:info, "Deleting IVY caching marker file '#{project.ivy.caching_marker}'")
|
705
705
|
rm_f project.ivy.caching_marker
|
706
706
|
end
|
707
707
|
|
@@ -729,21 +729,21 @@ namespace 'ivy' do
|
|
729
729
|
end
|
730
730
|
end
|
731
731
|
|
732
|
-
task :
|
732
|
+
task :clean_result_cache do
|
733
733
|
Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
|
734
|
-
project.task('ivy:
|
734
|
+
project.task('ivy:clean_result_cache').invoke
|
735
735
|
end
|
736
736
|
end
|
737
737
|
|
738
|
-
task :
|
738
|
+
task :enable_result_cache do
|
739
739
|
Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
|
740
|
-
project.task('ivy:
|
740
|
+
project.task('ivy:enable_result_cache').invoke
|
741
741
|
end
|
742
742
|
end
|
743
743
|
|
744
|
-
task :
|
744
|
+
task :disable_result_cache do
|
745
745
|
Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
|
746
|
-
project.task('ivy:
|
746
|
+
project.task('ivy:disable_result_cache').invoke
|
747
747
|
end
|
748
748
|
end
|
749
749
|
|
data/lib/ivy4r.rb
CHANGED
data/lib/rake/ivy_extension.rb
CHANGED
@@ -1,345 +1,349 @@
|
|
1
|
-
require 'ivy4r'
|
2
|
-
|
3
|
-
class Rake::Application
|
4
|
-
attr_accessor :ivy
|
5
|
-
end
|
6
|
-
|
7
|
-
module Rake
|
8
|
-
module Ivy
|
9
|
-
class IvyConfig
|
10
|
-
|
11
|
-
# The directory to load ivy jars and its dependencies from, leave __nil__ to use default
|
12
|
-
attr_accessor :lib_dir
|
13
|
-
|
14
|
-
# The extension directory containing ivy settings, the local repository and cache
|
15
|
-
attr_accessor :extension_dir
|
16
|
-
|
17
|
-
# Returns the resolve result
|
18
|
-
attr_reader :resolved
|
19
|
-
|
20
|
-
attr_reader :post_resolve_tasks
|
21
|
-
|
22
|
-
# Store the current rake application and initialize ivy ant wrapper
|
23
|
-
def initialize(application)
|
24
|
-
@application = application
|
25
|
-
@extension_dir = File.join("#{@application.original_dir}", "#{ENV['IVY_EXT_DIR']}")
|
26
|
-
@post_resolve_tasks = []
|
27
|
-
end
|
28
|
-
|
29
|
-
# Returns the correct ant instance to use.
|
30
|
-
def ivy4r
|
31
|
-
unless @ivy4r
|
32
|
-
@ivy4r = ::Ivy4r.new do |i|
|
33
|
-
if caching_enabled?
|
34
|
-
|
35
|
-
|
36
|
-
@ivy4r.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
#
|
59
|
-
#
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
confs, types = args.flatten, []
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
@resolved
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
end
|
127
|
-
|
128
|
-
def
|
129
|
-
@
|
130
|
-
end
|
131
|
-
|
132
|
-
def
|
133
|
-
@
|
134
|
-
end
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
end
|
1
|
+
require 'ivy4r'
|
2
|
+
|
3
|
+
class Rake::Application
|
4
|
+
attr_accessor :ivy
|
5
|
+
end
|
6
|
+
|
7
|
+
module Rake
|
8
|
+
module Ivy
|
9
|
+
class IvyConfig
|
10
|
+
|
11
|
+
# The directory to load ivy jars and its dependencies from, leave __nil__ to use default
|
12
|
+
attr_accessor :lib_dir
|
13
|
+
|
14
|
+
# The extension directory containing ivy settings, the local repository and cache
|
15
|
+
attr_accessor :extension_dir
|
16
|
+
|
17
|
+
# Returns the resolve result
|
18
|
+
attr_reader :resolved
|
19
|
+
|
20
|
+
attr_reader :post_resolve_tasks
|
21
|
+
|
22
|
+
# Store the current rake application and initialize ivy ant wrapper
|
23
|
+
def initialize(application)
|
24
|
+
@application = application
|
25
|
+
@extension_dir = File.join("#{@application.original_dir}", "#{ENV['IVY_EXT_DIR']}")
|
26
|
+
@post_resolve_tasks = []
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns the correct ant instance to use.
|
30
|
+
def ivy4r
|
31
|
+
unless @ivy4r
|
32
|
+
@ivy4r = ::Ivy4r.new do |i|
|
33
|
+
i.cache_dir = result_cache_dir if caching_enabled?
|
34
|
+
end
|
35
|
+
@ivy4r.lib_dir = lib_dir if lib_dir
|
36
|
+
@ivy4r.project_dir = @extension_dir
|
37
|
+
end
|
38
|
+
@ivy4r
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns if ivy result caching is enabled by existence of the marker file.
|
42
|
+
def caching_enabled?
|
43
|
+
File.exists? caching_marker
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns the use ivy result caching marker file
|
47
|
+
def caching_marker
|
48
|
+
File.expand_path 'use_ivy_caching'
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns the dir to store ivy caching results in.
|
52
|
+
def result_cache_dir
|
53
|
+
dir = File.expand_path('ivycaching')
|
54
|
+
FileUtils.mkdir_p dir
|
55
|
+
dir
|
56
|
+
end
|
57
|
+
|
58
|
+
# Returns the artifacts for given configurations as array
|
59
|
+
# this is a post resolve task.
|
60
|
+
# the arguments are checked for the following:
|
61
|
+
# 1. if an Hash is given :conf is used for confs and :type is used for types
|
62
|
+
# 2. if exactly two arrays are given args[0] is used for confs and args[1] is used for types
|
63
|
+
# 3. if not exactly two arrays all args are used as confs
|
64
|
+
def deps(*args)
|
65
|
+
if args.size == 1 && args[0].kind_of?(Hash)
|
66
|
+
confs, types = [args[0][:conf]].flatten, [args[0][:type]].flatten
|
67
|
+
elsif args.size == 2 && args[0].kind_of?(Array) && args[1].kind_of?(Array)
|
68
|
+
confs, types = args[0], args[1]
|
69
|
+
else
|
70
|
+
confs, types = args.flatten, []
|
71
|
+
end
|
72
|
+
|
73
|
+
[confs, types].each do |t|
|
74
|
+
t.reject! {|c| c.nil? || c.blank? }
|
75
|
+
end
|
76
|
+
|
77
|
+
unless confs.empty?
|
78
|
+
pathid = "ivy.deps." + confs.join('.') + '.' + types.join('.')
|
79
|
+
params = {:conf => confs.join(','), :pathid => pathid}
|
80
|
+
params[:type] = types.join(',') unless types.nil? || types.size == 0
|
81
|
+
|
82
|
+
ivy4r.cachepath params
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Returns ivy info for configured ivy file.
|
87
|
+
def info
|
88
|
+
ivy4r.settings :id => 'ivy.info.settingsref'
|
89
|
+
ivy4r.info :file => file, :settingsRef => 'ivy.info.settingsref'
|
90
|
+
end
|
91
|
+
|
92
|
+
# Configures the ivy instance with additional properties and loading the settings file if it was provided
|
93
|
+
def configure
|
94
|
+
unless @configured
|
95
|
+
ivy4r.property['ivy.status'] = status
|
96
|
+
ivy4r.property['ivy.home'] = home
|
97
|
+
properties.each {|key, value| ivy4r.property[key.to_s] = value }
|
98
|
+
@configured = ivy4r.settings :file => settings if settings
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Resolves the configured file once.
|
103
|
+
def __resolve__
|
104
|
+
unless @resolved
|
105
|
+
@resolved = ivy4r.resolve :file => file
|
106
|
+
post_resolve_tasks.each { |p| p.call(self) }
|
107
|
+
end
|
108
|
+
@resolved
|
109
|
+
end
|
110
|
+
|
111
|
+
# Creates the standard ivy dependency report
|
112
|
+
def report
|
113
|
+
ivy4r.report :todir => report_dir
|
114
|
+
end
|
115
|
+
|
116
|
+
# Publishs the project as defined in ivy file if it has not been published already
|
117
|
+
def __publish__
|
118
|
+
unless @published
|
119
|
+
options = {:artifactspattern => "#{publish_from}/[artifact].[ext]"}
|
120
|
+
options[:pubrevision] = revision if revision
|
121
|
+
options[:status] = status if status
|
122
|
+
options = publish_options * options
|
123
|
+
ivy4r.publish options
|
124
|
+
@published = true
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def home
|
129
|
+
@ivy_home_dir ||= "#{@extension_dir}/ivy-home"
|
130
|
+
end
|
131
|
+
|
132
|
+
def settings
|
133
|
+
@settings ||= "#{@extension_dir}/ant-scripts/ivysettings.xml"
|
134
|
+
end
|
135
|
+
|
136
|
+
def file
|
137
|
+
@ivy_file ||= 'ivy.xml'
|
138
|
+
end
|
139
|
+
|
140
|
+
# Sets the revision to use for the project, this is useful for development revisions that
|
141
|
+
# have an appended timestamp or any other dynamic revisioning.
|
142
|
+
#
|
143
|
+
# To set a different revision this method can be used in different ways.
|
144
|
+
# 1. project.ivy.revision(revision) to set the revision directly
|
145
|
+
# 2. project.ivy.revision { |ivy| [calculate revision] } use the block for dynamic
|
146
|
+
# calculation of the revision. You can access ivy4r via <tt>ivy.ivy4r.[method]</tt>
|
147
|
+
def revision(*revision, &block)
|
148
|
+
raise "Invalid call with parameters and block!" if revision.size > 0 && block
|
149
|
+
if revision.empty? && block.nil?
|
150
|
+
if @revision_calc
|
151
|
+
@revision ||= @revision_calc.call(self)
|
152
|
+
else
|
153
|
+
@revision
|
154
|
+
end
|
155
|
+
elsif block.nil?
|
156
|
+
raise "revision value invalid #{revision.join(', ')}" unless revision.size == 1
|
157
|
+
@revision = revision[0]
|
158
|
+
self
|
159
|
+
else
|
160
|
+
@revision_calc = block
|
161
|
+
self
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Sets the status to use for the project, this is useful for custom status handling
|
166
|
+
# like integration, alpha, gold.
|
167
|
+
#
|
168
|
+
# To set a different status this method can be used in different ways.
|
169
|
+
# 1. project.ivy.status(status) to set the status directly
|
170
|
+
# 2. project.ivy.status { |ivy| [calculate status] } use the block for dynamic
|
171
|
+
# calculation of the status. You can access ivy4r via <tt>ivy.ivy4r.[method]</tt>
|
172
|
+
def status(*status, &block)
|
173
|
+
raise "Invalid call with parameters and block!" if status.size > 0 && block
|
174
|
+
if status.empty? && block.nil?
|
175
|
+
if @status_calc
|
176
|
+
@status ||= @status_calc.call(self)
|
177
|
+
else
|
178
|
+
@status
|
179
|
+
end
|
180
|
+
elsif status.empty? && block.nil?
|
181
|
+
raise "status value invalid #{status.join(', ')}" unless status.size == 1
|
182
|
+
@status = status[0]
|
183
|
+
self
|
184
|
+
else
|
185
|
+
@status_calc = block
|
186
|
+
self
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Sets the publish options to use for the project. The options are merged with the default
|
191
|
+
# options including value set via #publish_from and overwrite all of them.
|
192
|
+
#
|
193
|
+
# To set the options this method can be used in different ways.
|
194
|
+
# 1. project.ivy.publish_options(options) to set the options directly
|
195
|
+
# 2. project.ivy.publish_options { |ivy| [calculate options] } use the block for dynamic
|
196
|
+
# calculation of options. You can access ivy4r via <tt>ivy.ivy4r.[method]</tt>
|
197
|
+
def publish_options(*options, &block)
|
198
|
+
raise "Invalid call with parameters and block!" if options.size > 0 && block
|
199
|
+
if options.empty? && block.nil?
|
200
|
+
if @publish_options_calc
|
201
|
+
@publish_options ||= @publish_options_calc.call(self)
|
202
|
+
else
|
203
|
+
@publish_options ||= {}
|
204
|
+
end
|
205
|
+
else
|
206
|
+
if options.size > 0 && block.nil?
|
207
|
+
raise "publish options value invalid #{options.join(', ')}" unless options.size == 1
|
208
|
+
@publish_options = options[0]
|
209
|
+
self
|
210
|
+
else
|
211
|
+
@publish_options_calc = block
|
212
|
+
self
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
# Sets the additional properties for the ivy process use a Hash with the properties to set.
|
218
|
+
def properties(*properties)
|
219
|
+
if properties.empty?
|
220
|
+
@properties ||= {}
|
221
|
+
else
|
222
|
+
raise "properties value invalid #{properties.join(', ')}" unless properties.size == 1
|
223
|
+
@properties = properties[0]
|
224
|
+
self
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# Sets the local repository for ivy files
|
229
|
+
def local_repository(*local_repository)
|
230
|
+
if local_repository.empty?
|
231
|
+
@local_repository ||= "#{home}/repository"
|
232
|
+
else
|
233
|
+
raise "local_repository value invalid #{local_repository.join(', ')}" unless local_repository.size == 1
|
234
|
+
@local_repository = local_repository[0]
|
235
|
+
self
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
# Sets the directory to publish artifacts from.
|
240
|
+
def publish_from(*publish_dir)
|
241
|
+
if publish_dir.empty?
|
242
|
+
@publish_from ||= @application.original_dir
|
243
|
+
else
|
244
|
+
raise "publish_from value invalid #{publish_dir.join(', ')}" unless publish_dir.size == 1
|
245
|
+
@publish_from = publish_dir[0]
|
246
|
+
self
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# Sets the directory to create dependency reports in.
|
251
|
+
def report_dir(*report_dir)
|
252
|
+
if report_dir.empty?
|
253
|
+
@report_dir ||= @application.original_dir
|
254
|
+
else
|
255
|
+
raise "publish_from value invalid #{report_dir.join(', ')}" unless report_dir.size == 1
|
256
|
+
@report_dir = report_dir[0]
|
257
|
+
self
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# Adds given block as post resolve action that is executed directly after #resolve has been called.
|
263
|
+
# Yields this ivy config object into block.
|
264
|
+
# <tt>project.ivy.post_resolve { |ivy| p "all deps:" + ivy.deps('all').join(", ") }</tt>
|
265
|
+
def post_resolve(&block)
|
266
|
+
post_resolve_tasks << block if block
|
267
|
+
end
|
268
|
+
|
269
|
+
# Filter artifacts for given configuration with provided filter values, this is a post resolve
|
270
|
+
# task like #deps.
|
271
|
+
# <tt>project.ivy.filter('server', 'client', :include => /b.*.jar/, :exclude => [/a\.jar/, /other.*\.jar/])</tt>
|
272
|
+
def filter(*confs)
|
273
|
+
filter = confs.last.kind_of?(Hash) ? confs.pop : {}
|
274
|
+
unless (filter.keys - (TYPES - [:conf])).empty?
|
275
|
+
raise ArgumentError, "Invalid filter use :include and/or :exclude only: given #{filter.keys.inspect}"
|
276
|
+
end
|
277
|
+
includes, excludes, types = filter[:include] || [], filter[:exclude] || [], filter[:type] || []
|
278
|
+
|
279
|
+
artifacts = deps(confs.flatten, types.flatten)
|
280
|
+
if artifacts
|
281
|
+
artifacts = artifacts.find_all do |lib|
|
282
|
+
lib = File.basename(lib)
|
283
|
+
includes = includes.reject {|i| i.nil? || i.blank? }
|
284
|
+
should_include = includes.empty? || includes.any? {|include| include === lib }
|
285
|
+
should_include && !excludes.any? {|exclude| exclude === lib}
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
artifacts
|
290
|
+
end
|
291
|
+
|
292
|
+
class Tasks < ::Rake::TaskLib
|
293
|
+
def initialize(ivy = nil, &block)
|
294
|
+
@ivy = ivy || Rake::Ivy::IvyConfig.new(Rake.application)
|
295
|
+
yield @ivy if block_given?
|
296
|
+
Rake.application.ivy = @ivy
|
297
|
+
|
298
|
+
define
|
299
|
+
end
|
300
|
+
|
301
|
+
private
|
302
|
+
def define
|
303
|
+
namespace 'ivy' do
|
304
|
+
task :configure do
|
305
|
+
Rake.application.ivy.configure
|
306
|
+
end
|
307
|
+
|
308
|
+
desc 'Resolves the ivy dependencies'
|
309
|
+
task :resolve => "ivy:configure" do
|
310
|
+
Rake.application.ivy.__resolve__
|
311
|
+
end
|
312
|
+
|
313
|
+
desc 'Publish the artifacts to ivy repository'
|
314
|
+
task :publish => "ivy:resolve" do
|
315
|
+
Rake.application.ivy.__publish__
|
316
|
+
end
|
317
|
+
|
318
|
+
desc 'Creates a dependency report for the project'
|
319
|
+
task :report => "ivy:resolve" do
|
320
|
+
Rake.application.ivy.report
|
321
|
+
end
|
322
|
+
|
323
|
+
desc 'Clean the local Ivy cache and the local ivy repository'
|
324
|
+
task :clean do
|
325
|
+
Rake.application.ivy.ivy4r.clean
|
326
|
+
end
|
327
|
+
|
328
|
+
desc 'Clean the local Ivy result cache to force execution of ivy targets'
|
329
|
+
task :clean_result_cache do
|
330
|
+
puts "Deleting IVY result cache dir '#{Rake.application.ivy.result_cache_dir}'"
|
331
|
+
rm_rf Rake.application.ivy.result_cache_dir
|
332
|
+
end
|
333
|
+
|
334
|
+
desc 'Enable the local Ivy result cache by creating the marker file'
|
335
|
+
task :enable_result_cache do
|
336
|
+
puts "Creating IVY caching marker file '#{Rake.application.ivy.caching_marker}'"
|
337
|
+
touch Rake.application.ivy.caching_marker
|
338
|
+
end
|
339
|
+
|
340
|
+
desc 'Disable the local Ivy result cache by removing the marker file'
|
341
|
+
task :disable_result_cache do
|
342
|
+
puts "Deleting IVY caching marker file '#{Rake.application.ivy.caching_marker}'"
|
343
|
+
rm_f Rake.application.ivy.caching_marker
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
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.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Klaas Prause
|
@@ -73,11 +73,11 @@ dependencies:
|
|
73
73
|
version: 2.5.0
|
74
74
|
version:
|
75
75
|
description: |-
|
76
|
-
Apache Ivy dependency manager wrapper for ruby (see {Apache Ivy}[http://ant.apache.org/ivy/index.html] for more information).
|
77
|
-
Use {Apache Ivy}[http://ant.apache.org/ivy/index.html] via a ruby wrapper without the need to use Apache Ant.
|
78
|
-
The wrapper uses Antwrap[http://antwrap.rubyforge.org/] to interface with Ivy.
|
79
|
-
|
80
|
-
Includes a Extension for Buildr[http://buildr.apache.org/] and Rake[http://rake.rubyforge.org] to use
|
76
|
+
Apache Ivy dependency manager wrapper for ruby (see {Apache Ivy}[http://ant.apache.org/ivy/index.html] for more information).
|
77
|
+
Use {Apache Ivy}[http://ant.apache.org/ivy/index.html] via a ruby wrapper without the need to use Apache Ant.
|
78
|
+
The wrapper uses Antwrap[http://antwrap.rubyforge.org/] to interface with Ivy.
|
79
|
+
|
80
|
+
Includes a Extension for Buildr[http://buildr.apache.org/] and Rake[http://rake.rubyforge.org] to use
|
81
81
|
{Apache Ivy}[http://ant.apache.org/ivy/index.html] for dependency management.
|
82
82
|
email:
|
83
83
|
- klaas.prause@googlemail.com
|
@@ -130,7 +130,7 @@ files:
|
|
130
130
|
- test/ivy/test_targets.rb
|
131
131
|
- test/test_ivy4r.rb
|
132
132
|
has_rdoc: true
|
133
|
-
homepage: http://github.com/klaas1979/ivy4r/tree/master
|
133
|
+
homepage: http://github.com/klaas1979/ivy4r/tree/master
|
134
134
|
licenses: []
|
135
135
|
|
136
136
|
post_install_message:
|