buildr-resolver 0.3.3 → 0.3.4
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/Gemfile +1 -1
- data/README.rdoc +0 -48
- data/VERSION +1 -1
- data/buildr-resolver.gemspec +5 -6
- data/lib/buildr/resolver.rb +27 -11
- data/spec/resolver_spec.rb +3 -3
- metadata +3 -4
- data/Gemfile.lock +0 -75
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -62,54 +62,6 @@ all the additional dependencies for it. If you added a <tt>puts dep</tt> after <
|
|
62
62
|
org.springframework.osgi:spring-osgi-io:jar:1.2.1
|
63
63
|
|
64
64
|
|
65
|
-
You can also manually exclude dependencies as an optional parameter to <tt>Buildr::Resolver.resolve</tt>. The exclusions
|
66
|
-
are regex matched, so you can pass in only a groupId or the full dependency notation.
|
67
|
-
|
68
|
-
example +buildfile+ with exclusions
|
69
|
-
|
70
|
-
require 'buildr/resolver'
|
71
|
-
Java.load # must be called before Buildr::Resolver.resolve if using Ruby due to Rjb startup of JVM by Buildr
|
72
|
-
deps = ['org.apache.activemq:activemq-spring:jar:5.4.2']
|
73
|
-
excluded = ['commons-logging', 'log4j', 'logkit' ]
|
74
|
-
deps = Buildr::Resolver.resolve( deps, excluded )
|
75
|
-
define 'example' do
|
76
|
-
project.version = '0.1.0'
|
77
|
-
compile.with deps
|
78
|
-
package :jar
|
79
|
-
end
|
80
|
-
|
81
|
-
Will result in the following, excluding commons-logging:commons-logging-api:jar:1.1, commons-logging:commons-logging:jar:1.1
|
82
|
-
log4j:log4j:jar:1.2.12, and logkit:logkit:jar:1.0.1
|
83
|
-
|
84
|
-
org.apache.activemq:activemq-spring:jar:5.4.2
|
85
|
-
org.apache.activemq:activemq-core:jar:5.4.2
|
86
|
-
org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1
|
87
|
-
org.apache.activemq:activeio-core:jar:3.1.2
|
88
|
-
avalon-framework:avalon-framework:jar:4.1.3
|
89
|
-
javax.servlet:servlet-api:jar:2.3
|
90
|
-
org.apache.activemq:kahadb:jar:5.4.2
|
91
|
-
org.apache.activemq.protobuf:activemq-protobuf:jar:1.1
|
92
|
-
org.osgi:org.osgi.core:jar:4.1.0
|
93
|
-
org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1
|
94
|
-
org.springframework:spring-context:jar:3.0.3.RELEASE
|
95
|
-
org.springframework:spring-aop:jar:3.0.3.RELEASE
|
96
|
-
aopalliance:aopalliance:jar:1.0
|
97
|
-
org.springframework:spring-expression:jar:3.0.3.RELEASE
|
98
|
-
org.springframework:spring-asm:jar:3.0.3.RELEASE
|
99
|
-
commons-net:commons-net:jar:2.0
|
100
|
-
org.jasypt:jasypt:jar:1.6
|
101
|
-
commons-lang:commons-lang:jar:2.1
|
102
|
-
commons-codec:commons-codec:jar:1.1
|
103
|
-
com.ibm.icu:icu4j:jar:4.0.1
|
104
|
-
org.apache.activemq:activemq-pool:jar:5.4.2
|
105
|
-
org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1
|
106
|
-
commons-pool:commons-pool:jar:1.5.4
|
107
|
-
org.springframework:spring-beans:jar:3.0.3.RELEASE
|
108
|
-
org.springframework:spring-core:jar:3.0.3.RELEASE
|
109
|
-
org.springframework:spring-test:jar:3.0.3.RELEASE
|
110
|
-
org.springframework.osgi:spring-osgi-core:jar:1.2.1
|
111
|
-
org.springframework.osgi:spring-osgi-io:jar:1.2.1
|
112
|
-
|
113
65
|
== License
|
114
66
|
|
115
67
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/buildr-resolver.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{buildr-resolver}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Guymon"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-14}
|
13
13
|
s.description = %q{Java dependency resolver for Buildr using Maven's Aether}
|
14
14
|
s.email = %q{michael.guymon@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
"Gemfile",
|
21
|
-
"Gemfile.lock",
|
22
21
|
"LICENSE",
|
23
22
|
"README.rdoc",
|
24
23
|
"Rakefile",
|
@@ -42,20 +41,20 @@ Gem::Specification.new do |s|
|
|
42
41
|
s.specification_version = 3
|
43
42
|
|
44
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
-
s.add_runtime_dependency(%q<naether>, ["= 0.3.
|
44
|
+
s.add_runtime_dependency(%q<naether>, ["= 0.3.3"])
|
46
45
|
s.add_runtime_dependency(%q<buildr>, [">= 1.4.4"])
|
47
46
|
s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
|
48
47
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
49
48
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
50
49
|
else
|
51
|
-
s.add_dependency(%q<naether>, ["= 0.3.
|
50
|
+
s.add_dependency(%q<naether>, ["= 0.3.3"])
|
52
51
|
s.add_dependency(%q<buildr>, [">= 1.4.4"])
|
53
52
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
54
53
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
55
54
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
56
55
|
end
|
57
56
|
else
|
58
|
-
s.add_dependency(%q<naether>, ["= 0.3.
|
57
|
+
s.add_dependency(%q<naether>, ["= 0.3.3"])
|
59
58
|
s.add_dependency(%q<buildr>, [">= 1.4.4"])
|
60
59
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
61
60
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
data/lib/buildr/resolver.rb
CHANGED
@@ -10,19 +10,26 @@ module Buildr
|
|
10
10
|
Buildr::Resolver::Java.instance.naether
|
11
11
|
end
|
12
12
|
|
13
|
-
# Resolve dependencies for an array of dependencies
|
13
|
+
# Resolve dependencies for an array of dependencies in the format of 'groupId:artifactId:type:version'
|
14
|
+
# or as a hash to define the scope, 'groupId:artifactId:type:version' => 'compile'. Example:
|
14
15
|
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
|
16
|
+
# [ 'ch.qos.logback:logback-classic:jar:0.9.24', {'junit:junit:jar:4.8.2' => 'test'} ]
|
17
|
+
#
|
18
|
+
# Options
|
19
|
+
# * :excludes - an array of dependencies to regex exclude
|
20
|
+
# * :repos - an array of {:url => '', :username => '', :password => '' } of additional remote repos that require auth
|
21
|
+
def resolve( dependencies, opts = {} )
|
22
|
+
|
23
|
+
options = opts
|
24
|
+
|
19
25
|
if Buildr.repositories.remote.size > 0
|
20
26
|
naether.clear_remote_repositories
|
21
27
|
Buildr.repositories.remote.each do |repo|
|
22
28
|
naether.add_remote_repository( repo )
|
23
29
|
end
|
24
30
|
|
25
|
-
unless repos.nil?
|
31
|
+
unless options[:repos].nil?
|
32
|
+
repos = options[:repos]
|
26
33
|
unless repos.is_a? Array
|
27
34
|
repos = [repos]
|
28
35
|
end
|
@@ -38,17 +45,26 @@ module Buildr
|
|
38
45
|
naether.dependencies = dependencies
|
39
46
|
naether.resolve_dependencies( false )
|
40
47
|
|
41
|
-
|
42
|
-
|
43
|
-
|
48
|
+
unless options[:excludes].nil?
|
49
|
+
|
50
|
+
excludes = options[:excludes]
|
51
|
+
|
44
52
|
unless excludes.is_a? Array
|
45
53
|
excludes = [excludes]
|
46
54
|
end
|
47
55
|
|
48
|
-
|
49
|
-
|
56
|
+
dependencies = naether.dependencies
|
57
|
+
dependencies.delete_if do |dep|
|
58
|
+
excludes.select do |exclude|
|
59
|
+
dep.toString() =~ /^#{exclude}/
|
60
|
+
end.size > 0
|
50
61
|
end
|
62
|
+
|
63
|
+
naether.dependencies = dependencies
|
64
|
+
|
51
65
|
end
|
66
|
+
|
67
|
+
naether.dependenciesNotation
|
52
68
|
end
|
53
69
|
|
54
70
|
def deploy_artifact( notation, file_path, url, opts = {} )
|
data/spec/resolver_spec.rb
CHANGED
@@ -13,13 +13,13 @@ describe Buildr::Resolver do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should resolve dependencies with exclusions" do
|
16
|
-
dependencies = Buildr::Resolver.resolve( ['ch.qos.logback:logback-classic:jar:0.9.24'], ['ch.qos.logback:logback-classic'] )
|
16
|
+
dependencies = Buildr::Resolver.resolve( ['ch.qos.logback:logback-classic:jar:0.9.24'], { :excludes => ['ch.qos.logback:logback-classic'] } )
|
17
17
|
dependencies.should eql ["ch.qos.logback:logback-core:jar:0.9.24", "org.slf4j:slf4j-api:jar:1.6.0"]
|
18
18
|
|
19
|
-
dependencies = Buildr::Resolver.resolve( ['ch.qos.logback:logback-classic:jar:0.9.24'], ['org.slf4j'] )
|
19
|
+
dependencies = Buildr::Resolver.resolve( ['ch.qos.logback:logback-classic:jar:0.9.24'], { :excludes => ['org.slf4j'] } )
|
20
20
|
dependencies.should eql ["ch.qos.logback:logback-classic:jar:0.9.24","ch.qos.logback:logback-core:jar:0.9.24"]
|
21
21
|
|
22
|
-
dependencies = Buildr::Resolver.resolve( ['ch.qos.logback:logback-classic:jar:0.9.24'], ['ch.qos.logback:logback-classic:jar:0.9.24', 'ch.qos.logback:logback-core:jar:0.9.24'] )
|
22
|
+
dependencies = Buildr::Resolver.resolve( ['ch.qos.logback:logback-classic:jar:0.9.24'], { :excludes => ['ch.qos.logback:logback-classic:jar:0.9.24', 'ch.qos.logback:logback-core:jar:0.9.24'] } )
|
23
23
|
dependencies.should eql ["org.slf4j:slf4j-api:jar:1.6.0"]
|
24
24
|
end
|
25
25
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: buildr-resolver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Guymon
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-14 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.3.
|
23
|
+
version: 0.3.3
|
24
24
|
requirement: *id001
|
25
25
|
prerelease: false
|
26
26
|
type: :runtime
|
@@ -79,7 +79,6 @@ extra_rdoc_files:
|
|
79
79
|
- README.rdoc
|
80
80
|
files:
|
81
81
|
- Gemfile
|
82
|
-
- Gemfile.lock
|
83
82
|
- LICENSE
|
84
83
|
- README.rdoc
|
85
84
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
atoulme-Antwrap (0.7.1)
|
5
|
-
rjb (>= 1.0.3)
|
6
|
-
atoulme-Antwrap (0.7.1-java)
|
7
|
-
bouncy-castle-java (1.5.0145.2)
|
8
|
-
builder (2.1.2)
|
9
|
-
buildr (1.4.4)
|
10
|
-
atoulme-Antwrap (= 0.7.1)
|
11
|
-
builder (= 2.1.2)
|
12
|
-
highline (= 1.5.1)
|
13
|
-
hoe (= 2.3.3)
|
14
|
-
json_pure (= 1.4.3)
|
15
|
-
minitar (= 0.5.3)
|
16
|
-
net-sftp (= 2.0.4)
|
17
|
-
net-ssh (= 2.0.23)
|
18
|
-
rake (= 0.8.7)
|
19
|
-
rjb (= 1.3.3)
|
20
|
-
rspec (~> 1.3.1)
|
21
|
-
rubyforge (= 2.0.3)
|
22
|
-
rubyzip (= 0.9.1)
|
23
|
-
xml-simple (= 1.0.12)
|
24
|
-
buildr (1.4.4-java)
|
25
|
-
atoulme-Antwrap (= 0.7.1)
|
26
|
-
builder (= 2.1.2)
|
27
|
-
highline (= 1.5.1)
|
28
|
-
hoe (= 2.3.3)
|
29
|
-
jruby-openssl (>= 0.7)
|
30
|
-
json_pure (= 1.4.3)
|
31
|
-
minitar (= 0.5.3)
|
32
|
-
net-sftp (= 2.0.4)
|
33
|
-
net-ssh (= 2.0.23)
|
34
|
-
rake (= 0.8.7)
|
35
|
-
rspec (~> 1.3.1)
|
36
|
-
rubyforge (= 2.0.3)
|
37
|
-
rubyzip (= 0.9.1)
|
38
|
-
xml-simple (= 1.0.12)
|
39
|
-
git (1.2.5)
|
40
|
-
highline (1.5.1)
|
41
|
-
hoe (2.3.3)
|
42
|
-
rake (>= 0.8.7)
|
43
|
-
rubyforge (>= 1.0.4)
|
44
|
-
jeweler (1.5.2)
|
45
|
-
bundler (~> 1.0.0)
|
46
|
-
git (>= 1.2.5)
|
47
|
-
rake
|
48
|
-
jruby-openssl (0.7.3)
|
49
|
-
bouncy-castle-java
|
50
|
-
json_pure (1.4.3)
|
51
|
-
minitar (0.5.3)
|
52
|
-
naether (0.3.2)
|
53
|
-
rjb (= 1.3.3)
|
54
|
-
naether (0.3.2-java)
|
55
|
-
net-sftp (2.0.4)
|
56
|
-
net-ssh (>= 2.0.9)
|
57
|
-
net-ssh (2.0.23)
|
58
|
-
rake (0.8.7)
|
59
|
-
rjb (1.3.3)
|
60
|
-
rspec (1.3.1)
|
61
|
-
rubyforge (2.0.3)
|
62
|
-
json_pure (>= 1.1.7)
|
63
|
-
rubyzip (0.9.1)
|
64
|
-
xml-simple (1.0.12)
|
65
|
-
|
66
|
-
PLATFORMS
|
67
|
-
java
|
68
|
-
ruby
|
69
|
-
|
70
|
-
DEPENDENCIES
|
71
|
-
buildr (>= 1.4.4)
|
72
|
-
bundler (~> 1.0.0)
|
73
|
-
jeweler (~> 1.5.2)
|
74
|
-
naether (= 0.3.2)
|
75
|
-
rspec (~> 1.3.1)
|