ivy4r 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +2 -0
- data/lib/ivy/java/all_version_matcher.rb +31 -0
- data/lib/ivy4r.rb +1 -1
- data/lib/ivy4r_java_extensions.rb +42 -0
- metadata +4 -2
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -13,6 +13,7 @@ lib/ivy/cleancache.rb
|
|
13
13
|
lib/ivy/configure.rb
|
14
14
|
lib/ivy/findrevision.rb
|
15
15
|
lib/ivy/info.rb
|
16
|
+
lib/ivy/java/all_version_matcher.rb
|
16
17
|
lib/ivy/listmodules.rb
|
17
18
|
lib/ivy/makepom.rb
|
18
19
|
lib/ivy/publish.rb
|
@@ -23,6 +24,7 @@ lib/ivy/settings.rb
|
|
23
24
|
lib/ivy/target.rb
|
24
25
|
lib/ivy/targets.rb
|
25
26
|
lib/ivy4r.rb
|
27
|
+
lib/ivy4r_java_extensions.rb
|
26
28
|
lib/rake/ivy_extension.rb
|
27
29
|
test/buildlist/p1/buildfile
|
28
30
|
test/buildlist/p1/ivy.xml
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Ivy
|
2
|
+
# Matcher that accepts all versions of the same module as a match, i.e.
|
3
|
+
# only checking that the module is the same.
|
4
|
+
class IvyAllVersionMatcher
|
5
|
+
include Java::OrgApacheIvyPluginsVersion::VersionMatcher
|
6
|
+
|
7
|
+
def is_dynamic(askedMrid)
|
8
|
+
false
|
9
|
+
end
|
10
|
+
|
11
|
+
def accept(askedMrid, foundMrid)
|
12
|
+
true
|
13
|
+
end
|
14
|
+
|
15
|
+
def need_module_descriptor(askedMrid, foundMrid)
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
19
|
+
def accept(askedMrid, foundMD)
|
20
|
+
true
|
21
|
+
end
|
22
|
+
|
23
|
+
def compare(askedMrid, foundMrid, staticComparator)
|
24
|
+
0
|
25
|
+
end
|
26
|
+
|
27
|
+
def getName
|
28
|
+
self.class
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/ivy4r.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
# basic stuff
|
2
|
+
require 'ivy4r'
|
3
|
+
|
4
|
+
# java extensions
|
5
|
+
Dir[Ivy4rJars.lib_dir + "/*.jar"].each {|jar| require jar}
|
6
|
+
require 'ivy/java/all_version_matcher'
|
7
|
+
|
8
|
+
class Ivy4r
|
9
|
+
# Returns the ivy instance for underlying ant project with the current ivy settings.
|
10
|
+
def ivy_instance
|
11
|
+
unless @ivy_instance
|
12
|
+
variable_container = Java::OrgApacheIvyAnt::IvyAntVariableContainer.new(ant.project)
|
13
|
+
settings_file = find_settings_file(variable_container) unless settings_file
|
14
|
+
raise "no settings file set and no default settings found, cannot create ivy instance" unless settings_file
|
15
|
+
raise "settings file does not exist: #{settings_file}" unless File.exists? settings_file
|
16
|
+
|
17
|
+
settings = Java::OrgApacheIvyCoreSettings::IvySettings.new(variable_container)
|
18
|
+
settings.base_dir = ant.project.base_dir
|
19
|
+
@ivy_instance = Java::OrgApacheIvy::Ivy.new_instance(settings)
|
20
|
+
@ivy_instance.configure(Java::JavaIo::File.new(settings_file))
|
21
|
+
end
|
22
|
+
|
23
|
+
@ivy_instance
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns the ant references, note that this are java objects.
|
27
|
+
def ant_references
|
28
|
+
ant.project.references
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
def find_settings_file(variable_container)
|
33
|
+
settings_file_name = variable_container.get_variable("ivy.conf.file") || variable_container.get_variable("ivy.settings.file")
|
34
|
+
setting_locations = [
|
35
|
+
File.join(ant.project.base_dir.absolute_path, settings_file_name),
|
36
|
+
File.join(ant.project.base_dir.absolute_path, 'ivyconf.xml'),
|
37
|
+
settings_file_name,
|
38
|
+
'ivyconf.xml'
|
39
|
+
]
|
40
|
+
setting_locations.find {|path| File.exists? path }
|
41
|
+
end
|
42
|
+
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.9.
|
4
|
+
version: 0.9.7
|
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: 2009-12-
|
12
|
+
date: 2009-12-10 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/ivy/configure.rb
|
86
86
|
- lib/ivy/findrevision.rb
|
87
87
|
- lib/ivy/info.rb
|
88
|
+
- lib/ivy/java/all_version_matcher.rb
|
88
89
|
- lib/ivy/listmodules.rb
|
89
90
|
- lib/ivy/makepom.rb
|
90
91
|
- lib/ivy/publish.rb
|
@@ -95,6 +96,7 @@ files:
|
|
95
96
|
- lib/ivy/target.rb
|
96
97
|
- lib/ivy/targets.rb
|
97
98
|
- lib/ivy4r.rb
|
99
|
+
- lib/ivy4r_java_extensions.rb
|
98
100
|
- lib/rake/ivy_extension.rb
|
99
101
|
- test/buildlist/p1/buildfile
|
100
102
|
- test/buildlist/p1/ivy.xml
|