lock_jar 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -2
- data/README.md +101 -54
- data/VERSION +1 -1
- data/lib/lock_jar/buildr.rb +8 -8
- data/lib/lock_jar/bundler.rb +155 -0
- data/lib/lock_jar/domain/artifact.rb +117 -0
- data/lib/lock_jar/domain/dsl.rb +177 -0
- data/lib/lock_jar/domain/dsl_helper.rb +66 -0
- data/lib/lock_jar/domain/gem_dsl.rb +45 -0
- data/lib/lock_jar/domain/jarfile_dsl.rb +37 -0
- data/lib/lock_jar/domain/lockfile.rb +114 -0
- data/lib/lock_jar/maven.rb +13 -1
- data/lib/lock_jar/registry.rb +46 -5
- data/lib/lock_jar/resolver.rb +5 -1
- data/lib/lock_jar/runtime.rb +230 -165
- data/lib/lock_jar.rb +22 -19
- data/lock_jar.gemspec +17 -12
- data/spec/Jarfile +3 -3
- data/spec/lock_jar/class_loader_spec.rb +47 -43
- data/spec/lock_jar/domain/dsl_helper_spec.rb +52 -0
- data/spec/lock_jar/domain/dsl_spec.rb +54 -0
- data/spec/lock_jar_spec.rb +155 -81
- metadata +15 -10
- data/lib/lock_jar/dsl.rb +0 -184
- data/lib/lock_jar/rubygems.rb +0 -21
- data/spec/lock_jar/dsl_spec.rb +0 -84
- data/spec/lock_jar/rubygems_spec.rb +0 -43
data/spec/Jarfile
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
|
1
|
+
local_repo '~/.m2/repository'
|
2
2
|
repository 'http://mirrors.ibiblio.org/pub/mirrors/maven2'
|
3
3
|
|
4
4
|
jar "org.apache.mina:mina-core:2.0.4"
|
5
5
|
pom 'spec/pom.xml'
|
6
6
|
|
7
|
-
|
7
|
+
group 'development' do
|
8
8
|
jar 'com.typesafe:config:jar:0.5.0'
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
group 'test' do
|
12
12
|
jar 'junit:junit:jar:4.10'
|
13
13
|
end
|
@@ -4,50 +4,54 @@ require 'lib/lock_jar/class_loader'
|
|
4
4
|
|
5
5
|
describe LockJar::ClassLoader, "#isolate" do
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if Naether.platform != 'java'
|
8
|
+
pending "need tests for RJB backed classloader"
|
9
|
+
else
|
10
|
+
it "should create a SimpleEmail" do
|
11
|
+
# Generate the IsolateJarfile.lock
|
12
|
+
LockJar.lock( :lockfile => 'tmp/IsolateJarfile.lock' ) do
|
13
|
+
jar 'org.apache.commons:commons-email:1.2'
|
14
|
+
end
|
15
|
+
|
16
|
+
email = LockJar::ClassLoader.new( 'tmp/IsolateJarfile.lock' ).isolate do
|
17
|
+
email = new_instance( 'org.apache.commons.mail.SimpleEmail' )
|
18
|
+
email.setSubject( 'test subject' )
|
19
|
+
|
20
|
+
email
|
21
|
+
end
|
22
|
+
|
23
|
+
email.getSubject().should eql 'test subject'
|
24
|
+
|
25
|
+
unless $CLASSPATH.nil?
|
26
|
+
$CLASSPATH.to_a.join(' ').should_not =~ /commons-email-1\.2\.jar/
|
27
|
+
end
|
28
|
+
|
29
|
+
expect { org.apache.commons.mail.SimpleEmail.new }.to raise_error
|
11
30
|
end
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
31
|
+
|
32
|
+
it "should create a JsonFactory and ObjectMapper" do
|
33
|
+
# Generate the IsolateJarfile.lock
|
34
|
+
LockJar.lock( :lockfile => 'tmp/IsolateJarfile.lock' ) do
|
35
|
+
jar 'com.fasterxml.jackson.core:jackson-core:2.0.6'
|
36
|
+
jar 'com.fasterxml.jackson.core:jackson-databind:2.0.6'
|
37
|
+
end
|
38
|
+
|
39
|
+
json = '{ "test1": "1test1", "test2": "2test2"}'
|
40
|
+
|
41
|
+
map = LockJar::ClassLoader.new( 'tmp/IsolateJarfile.lock' ).isolate do
|
42
|
+
factory = new_instance( 'com.fasterxml.jackson.core.JsonFactory' )
|
43
|
+
mapper = new_instance( 'com.fasterxml.jackson.databind.ObjectMapper', factory)
|
44
|
+
mapper.readValue(json, java.util.Map.java_class)
|
45
|
+
end
|
46
|
+
|
47
|
+
map.get('test1').should eql "1test1"
|
48
|
+
map.get('test2').should eql "2test2"
|
49
|
+
|
50
|
+
unless $CLASSPATH.nil?
|
51
|
+
$CLASSPATH.to_a.join(' ').should_not =~ /jackson-databind-2\.0\.6\.jar/
|
52
|
+
end
|
53
|
+
|
54
|
+
expect { com.fasterxml.jackson.core.JsonFactory.new }.to raise_error
|
18
55
|
end
|
19
|
-
|
20
|
-
email.getSubject().should eql 'test subject'
|
21
|
-
|
22
|
-
unless $CLASSPATH.nil?
|
23
|
-
$CLASSPATH.to_a.join(' ').should_not =~ /commons-email-1\.2\.jar/
|
24
|
-
end
|
25
|
-
|
26
|
-
expect { org.apache.commons.mail.SimpleEmail.new }.to raise_error
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should create a JsonFactory and ObjectMapper" do
|
30
|
-
# Generate the IsolateJarfile.lock
|
31
|
-
LockJar.lock( :lockfile => 'tmp/IsolateJarfile.lock' ) do
|
32
|
-
jar 'com.fasterxml.jackson.core:jackson-core:2.0.6'
|
33
|
-
jar 'com.fasterxml.jackson.core:jackson-databind:2.0.6'
|
34
|
-
end
|
35
|
-
|
36
|
-
json = '{ "test1": "1test1", "test2": "2test2"}'
|
37
|
-
|
38
|
-
map = LockJar::ClassLoader.new( 'tmp/IsolateJarfile.lock' ).isolate do
|
39
|
-
factory = new_instance( 'com.fasterxml.jackson.core.JsonFactory' )
|
40
|
-
mapper = new_instance( 'com.fasterxml.jackson.databind.ObjectMapper', factory)
|
41
|
-
mapper.readValue(json, java.util.Map.java_class)
|
42
|
-
end
|
43
|
-
|
44
|
-
map.get('test1').should eql "1test1"
|
45
|
-
map.get('test2').should eql "2test2"
|
46
|
-
|
47
|
-
unless $CLASSPATH.nil?
|
48
|
-
$CLASSPATH.to_a.join(' ').should_not =~ /jackson-databind-2\.0\.6\.jar/
|
49
|
-
end
|
50
|
-
|
51
|
-
expect { com.fasterxml.jackson.core.JsonFactory.new }.to raise_error
|
52
56
|
end
|
53
57
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'../../spec_helper'))
|
2
|
+
|
3
|
+
require 'lock_jar/domain/dsl_helper'
|
4
|
+
|
5
|
+
describe LockJar::Domain::DslHelper do
|
6
|
+
|
7
|
+
it "should merge dsl" do
|
8
|
+
block1 = LockJar::Domain::Dsl.create do
|
9
|
+
repository 'http://repository.jboss.org/nexus/content/groups/public-jboss'
|
10
|
+
|
11
|
+
jar "org.apache.mina:mina-core:2.0.4"
|
12
|
+
pom 'spec/pom.xml'
|
13
|
+
|
14
|
+
group 'runtime' do
|
15
|
+
jar 'org.apache.tomcat:servlet-api:jar:6.0.35'
|
16
|
+
end
|
17
|
+
|
18
|
+
group 'test' do
|
19
|
+
jar 'junit:junit:jar:4.10'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
block2 = LockJar::Domain::Dsl.create do
|
24
|
+
repository 'http://repository.jboss.org/nexus/content/groups/public-jboss'
|
25
|
+
repository 'http://new-repo'
|
26
|
+
|
27
|
+
jar "org.apache.mina:mina-core:2.0.4"
|
28
|
+
jar "compile-jar"
|
29
|
+
|
30
|
+
group 'runtime' do
|
31
|
+
jar 'runtime-jar'
|
32
|
+
pom 'runtime-pom.xml'
|
33
|
+
end
|
34
|
+
|
35
|
+
group 'test' do
|
36
|
+
jar 'test-jar'
|
37
|
+
pom 'test-pom.xml'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
dsl = LockJar::Domain::DslHelper.merge( block1, block2 )
|
42
|
+
|
43
|
+
dsl.artifacts['default'].should =~ [LockJar::Domain::Jar.new("org.apache.mina:mina-core:2.0.4"), LockJar::Domain::Pom.new("spec/pom.xml",["runtime", "compile"]), LockJar::Domain::Jar.new("compile-jar")]
|
44
|
+
|
45
|
+
# "runtime" => [LockJar::Domain::Jar.new("org.apache.tomcat:servlet-api:jar:6.0.35"), LockJar::Domain::Jar.new("runtime-jar"), LockJar::Domain::Pom.new("runtime-pom.xml")],
|
46
|
+
# "test" => [LockJar::Domain::Jar.new("junit:junit:jar:4.10"), LockJar::Domain::Jar.new("test-jar"), LockJar::Domain::Pom.new("test-pom.xml")]
|
47
|
+
|
48
|
+
|
49
|
+
dsl.remote_repositories.should eql( ["http://repository.jboss.org/nexus/content/groups/public-jboss", 'http://new-repo'] )
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'../../spec_helper'))
|
2
|
+
require 'lock_jar/domain/artifact'
|
3
|
+
describe LockJar::Domain::Dsl do
|
4
|
+
context "Instance" do
|
5
|
+
it "should load a Jarfile" do
|
6
|
+
jarfile = LockJar::Domain::Dsl.create( "spec/Jarfile" )
|
7
|
+
|
8
|
+
jarfile.local_repository.should eql '~/.m2/repository'
|
9
|
+
jarfile.artifacts["default"][0].should == LockJar::Domain::Jar.new("org.apache.mina:mina-core:2.0.4")
|
10
|
+
jarfile.artifacts["default"][1].path.should eql "spec/pom.xml"
|
11
|
+
jarfile.artifacts["default"][2].should be_nil
|
12
|
+
|
13
|
+
jarfile.artifacts["development"][0].should == LockJar::Domain::Jar.new("com.typesafe:config:jar:0.5.0")
|
14
|
+
jarfile.artifacts["development"][1].should be_nil
|
15
|
+
|
16
|
+
jarfile.artifacts["test"][0].should == LockJar::Domain::Jar.new("junit:junit:jar:4.10")
|
17
|
+
jarfile.artifacts["test"][1].should be_nil
|
18
|
+
|
19
|
+
jarfile.remote_repositories.should eql( ['http://mirrors.ibiblio.org/pub/mirrors/maven2'] )
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should load a block" do
|
23
|
+
block = LockJar::Domain::Dsl.create do
|
24
|
+
local_repo '~/.m2'
|
25
|
+
repository 'http://repository.jboss.org/nexus/content/groups/public-jboss'
|
26
|
+
|
27
|
+
jar "org.apache.mina:mina-core:2.0.4"
|
28
|
+
pom 'spec/pom.xml'
|
29
|
+
|
30
|
+
group 'pirate' do
|
31
|
+
jar 'org.apache.tomcat:servlet-api:jar:6.0.35'
|
32
|
+
end
|
33
|
+
|
34
|
+
group 'test' do
|
35
|
+
jar 'junit:junit:jar:4.10'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
block.local_repository.should eql '~/.m2'
|
40
|
+
block.artifacts.should == {
|
41
|
+
"default" => [LockJar::Domain::Jar.new("org.apache.mina:mina-core:2.0.4"), LockJar::Domain::Pom.new("spec/pom.xml")],
|
42
|
+
"pirate" => [LockJar::Domain::Jar.new("org.apache.tomcat:servlet-api:jar:6.0.35")],
|
43
|
+
"test" => [LockJar::Domain::Jar.new("junit:junit:jar:4.10")]
|
44
|
+
}
|
45
|
+
block.remote_repositories.should eql( ["http://repository.jboss.org/nexus/content/groups/public-jboss"] )
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should raise an error without arguments" do
|
50
|
+
lambda { LockJar::Domain::Dsl.create }.should raise_error
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
data/spec/lock_jar_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__),'spec_helper'))
|
2
2
|
require 'rubygems'
|
3
3
|
require 'lib/lock_jar'
|
4
|
+
require 'lib/lock_jar/domain/dsl'
|
4
5
|
require 'naether'
|
5
6
|
|
6
7
|
describe LockJar, "#lock" do
|
@@ -15,47 +16,86 @@ describe LockJar, "#lock" do
|
|
15
16
|
File.exists?( 'tmp/Jarfile.lock' ).should be_true
|
16
17
|
|
17
18
|
lockfile = LockJar.read('tmp/Jarfile.lock')
|
18
|
-
lockfile.should eql(
|
19
|
+
lockfile.to_hash.should eql({
|
20
|
+
"version"=> LockJar::VERSION,
|
19
21
|
"local_repository"=>"~/.m2/repository",
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"dependencies"=>["
|
23
|
-
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"commons-
|
27
|
-
|
28
|
-
"
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
22
|
+
"groups"=>{
|
23
|
+
"default"=>{
|
24
|
+
"dependencies"=>["ch.qos.logback:logback-classic:jar:0.9.24",
|
25
|
+
"ch.qos.logback:logback-core:jar:0.9.24", "com.metapossum:metapossum-scanner:jar:1.0",
|
26
|
+
"com.slackworks:modelcitizen:jar:0.2.2",
|
27
|
+
"commons-beanutils:commons-beanutils:jar:1.8.3", "commons-io:commons-io:jar:1.4",
|
28
|
+
"commons-lang:commons-lang:jar:2.6", "commons-logging:commons-logging:jar:1.1.1",
|
29
|
+
"org.apache.mina:mina-core:jar:2.0.4",
|
30
|
+
"org.slf4j:slf4j-api:jar:1.6.1"],
|
31
|
+
"artifacts"=>[{
|
32
|
+
"jar:org.apache.mina:mina-core:jar:2.0.4"=>{
|
33
|
+
"transitive"=>{"org.slf4j:slf4j-api:jar:1.6.1"=>{}}
|
34
|
+
}
|
35
|
+
}, {
|
36
|
+
"pom:spec/pom.xml"=>{
|
37
|
+
"scopes"=>["runtime", "compile"],
|
38
|
+
"transitive"=>{
|
39
|
+
"com.slackworks:modelcitizen:jar:0.2.2" => {
|
40
|
+
"com.metapossum:metapossum-scanner:jar:1.0"=>{
|
41
|
+
"commons-io:commons-io:jar:1.4"=>{}
|
42
|
+
},
|
43
|
+
"commons-beanutils:commons-beanutils:jar:1.8.3"=>{
|
44
|
+
"commons-logging:commons-logging:jar:1.1.1"=>{}
|
45
|
+
},
|
46
|
+
"ch.qos.logback:logback-classic:jar:0.9.24"=>{
|
47
|
+
"ch.qos.logback:logback-core:jar:0.9.24"=>{}
|
48
|
+
},
|
49
|
+
"commons-lang:commons-lang:jar:2.6"=>{}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}]
|
54
|
+
},
|
55
|
+
"development"=>{
|
56
|
+
"dependencies"=>["com.typesafe:config:jar:0.5.0"],
|
57
|
+
"artifacts"=>[{
|
58
|
+
"jar:com.typesafe:config:jar:0.5.0"=>{"transitive"=>{}}
|
59
|
+
}]
|
60
|
+
},
|
33
61
|
"test"=>{
|
34
|
-
"dependencies"=>["
|
35
|
-
"
|
36
|
-
"
|
37
|
-
|
62
|
+
"dependencies"=>["junit:junit:jar:4.10", "org.hamcrest:hamcrest-core:jar:1.1"],
|
63
|
+
"artifacts"=>[{
|
64
|
+
"jar:junit:junit:jar:4.10"=>{
|
65
|
+
"transitive"=>{"org.hamcrest:hamcrest-core:jar:1.1"=>{}}}
|
66
|
+
}]
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"remote_repositories" => ["http://mirrors.ibiblio.org/pub/mirrors/maven2", "http://repository.jboss.org/nexus/content/groups/public-jboss"]
|
38
70
|
})
|
39
71
|
end
|
40
72
|
|
41
|
-
it "should
|
42
|
-
dsl = LockJar::Dsl.
|
73
|
+
it "should replace dependencies with map" do
|
74
|
+
dsl = LockJar::Domain::Dsl.create do
|
43
75
|
map 'junit:junit:4.10', 'tmp'
|
44
76
|
jar 'junit:junit:4.10'
|
45
77
|
end
|
46
78
|
|
47
79
|
LockJar.lock( dsl, :local_repo => 'tmp/test-repo', :lockfile => 'tmp/Jarfile.lock' )
|
48
80
|
lockfile = LockJar.read('tmp/Jarfile.lock')
|
49
|
-
lockfile.should eql(
|
50
|
-
"
|
81
|
+
lockfile.to_hash.should eql({
|
82
|
+
"version"=> LockJar::VERSION,
|
51
83
|
"maps"=>{"junit:junit:4.10"=>["tmp"]},
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"dependencies"=>["junit:junit:
|
84
|
+
"groups"=>{
|
85
|
+
"default"=>{
|
86
|
+
"dependencies"=>["junit:junit:jar:4.10", "org.hamcrest:hamcrest-core:jar:1.1"],
|
87
|
+
"artifacts"=>[{
|
88
|
+
"jar:junit:junit:jar:4.10"=>{
|
89
|
+
"transitive"=>{"org.hamcrest:hamcrest-core:jar:1.1"=>{}}}
|
90
|
+
}]
|
91
|
+
}
|
92
|
+
},
|
93
|
+
"remote_repositories" => ["http://mirrors.ibiblio.org/pub/mirrors/maven2", "http://repository.jboss.org/nexus/content/groups/public-jboss"]
|
94
|
+
})
|
55
95
|
end
|
56
96
|
|
57
97
|
it "should exclude excludes from dependencies" do
|
58
|
-
dsl = LockJar::Dsl.
|
98
|
+
dsl = LockJar::Domain::Dsl.create do
|
59
99
|
exclude 'commons-logging', 'logkit'
|
60
100
|
jar 'opensymphony:oscache:jar:2.4.1'
|
61
101
|
end
|
@@ -63,19 +103,33 @@ describe LockJar, "#lock" do
|
|
63
103
|
LockJar.lock( dsl, :local_repo => 'tmp/test-repo', :lockfile => 'tmp/Jarfile.lock' )
|
64
104
|
File.exists?( 'tmp/Jarfile.lock' ).should be_true
|
65
105
|
lockfile = LockJar.read('tmp/Jarfile.lock')
|
66
|
-
lockfile.should eql(
|
106
|
+
lockfile.to_hash.should eql({
|
107
|
+
"version"=>"0.7.0",
|
67
108
|
"excludes"=>["commons-logging", "logkit"],
|
68
|
-
"
|
69
|
-
|
70
|
-
|
71
|
-
"
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
109
|
+
"groups"=>{
|
110
|
+
"default"=>{
|
111
|
+
"dependencies"=>[
|
112
|
+
"avalon-framework:avalon-framework:jar:4.1.3", "javax.jms:jms:jar:1.1",
|
113
|
+
"javax.servlet:servlet-api:jar:2.3", "log4j:log4j:jar:1.2.12",
|
114
|
+
"opensymphony:oscache:jar:2.4.1"],
|
115
|
+
"artifacts"=>[{
|
116
|
+
"jar:opensymphony:oscache:jar:2.4.1"=>{
|
117
|
+
"transitive"=>{
|
118
|
+
"commons-logging:commons-logging:jar:1.1"=>{
|
119
|
+
"logkit:logkit:jar:1.0.1"=>{},
|
120
|
+
"log4j:log4j:jar:1.2.12"=>{},
|
121
|
+
"avalon-framework:avalon-framework:jar:4.1.3"=>{}
|
122
|
+
},
|
123
|
+
"javax.jms:jms:jar:1.1"=>{},
|
124
|
+
"javax.servlet:servlet-api:jar:2.3"=>{}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}]
|
128
|
+
}
|
129
|
+
},
|
130
|
+
"remote_repositories" => ["http://mirrors.ibiblio.org/pub/mirrors/maven2", "http://repository.jboss.org/nexus/content/groups/public-jboss"]
|
77
131
|
})
|
78
|
-
|
132
|
+
|
79
133
|
end
|
80
134
|
|
81
135
|
|
@@ -87,19 +141,38 @@ describe LockJar, "#lock" do
|
|
87
141
|
File.exists?( 'tmp/NoRepoJarfile.lock' ).should be_true
|
88
142
|
|
89
143
|
lockfile = LockJar.read('tmp/NoRepoJarfile.lock')
|
90
|
-
lockfile.should eql(
|
91
|
-
"
|
92
|
-
|
93
|
-
|
94
|
-
"
|
144
|
+
lockfile.to_hash.should eql({
|
145
|
+
"version"=>"0.7.0",
|
146
|
+
"groups"=>{
|
147
|
+
"default"=>{
|
148
|
+
"dependencies"=>["org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016",
|
149
|
+
"org.eclipse.jetty:jetty-continuation:jar:8.1.3.v20120416",
|
150
|
+
"org.eclipse.jetty:jetty-http:jar:8.1.3.v20120416",
|
95
151
|
"org.eclipse.jetty:jetty-io:jar:8.1.3.v20120416",
|
96
|
-
"org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016",
|
97
152
|
"org.eclipse.jetty:jetty-security:jar:8.1.3.v20120416",
|
98
|
-
"org.eclipse.jetty:jetty-continuation:jar:8.1.3.v20120416",
|
99
|
-
"org.eclipse.jetty:jetty-servlet:jar:8.1.3.v20120416",
|
100
153
|
"org.eclipse.jetty:jetty-server:jar:8.1.3.v20120416",
|
101
|
-
"org.eclipse.jetty:jetty-
|
102
|
-
|
154
|
+
"org.eclipse.jetty:jetty-servlet:jar:8.1.3.v20120416",
|
155
|
+
"org.eclipse.jetty:jetty-util:jar:8.1.3.v20120416"],
|
156
|
+
"artifacts"=>[{
|
157
|
+
"jar:org.eclipse.jetty:jetty-servlet:jar:8.1.3.v20120416"=>{
|
158
|
+
"transitive"=>{
|
159
|
+
"org.eclipse.jetty:jetty-security:jar:8.1.3.v20120416"=>{
|
160
|
+
"org.eclipse.jetty:jetty-server:jar:8.1.3.v20120416"=>{
|
161
|
+
"org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016"=>{},
|
162
|
+
"org.eclipse.jetty:jetty-continuation:jar:8.1.3.v20120416"=>{},
|
163
|
+
"org.eclipse.jetty:jetty-http:jar:8.1.3.v20120416"=>{
|
164
|
+
"org.eclipse.jetty:jetty-io:jar:8.1.3.v20120416"=>{
|
165
|
+
"org.eclipse.jetty:jetty-util:jar:8.1.3.v20120416"=>{}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
}]
|
173
|
+
}
|
174
|
+
}
|
175
|
+
})
|
103
176
|
end
|
104
177
|
end
|
105
178
|
|
@@ -108,19 +181,20 @@ describe LockJar, "#install" do
|
|
108
181
|
|
109
182
|
LockJar.lock( "spec/Jarfile", :download_artifacts => false, :local_repo => 'tmp/test-repo-install', :lockfile => 'tmp/Jarfile.lock' )
|
110
183
|
|
111
|
-
jars = LockJar.install( 'tmp/Jarfile.lock', ['
|
112
|
-
jars.should eql(
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
184
|
+
jars = LockJar.install( 'tmp/Jarfile.lock', ['default'], :local_repo => 'tmp/test-repo-install' )
|
185
|
+
jars.should eql([
|
186
|
+
File.expand_path("tmp/test-repo-install/ch/qos/logback/logback-classic/0.9.24/logback-classic-0.9.24.jar"),
|
187
|
+
File.expand_path("tmp/test-repo-install/ch/qos/logback/logback-core/0.9.24/logback-core-0.9.24.jar"),
|
188
|
+
File.expand_path("tmp/test-repo-install/com/metapossum/metapossum-scanner/1.0/metapossum-scanner-1.0.jar"),
|
189
|
+
File.expand_path("tmp/test-repo-install/com/slackworks/modelcitizen/0.2.2/modelcitizen-0.2.2.jar"),
|
190
|
+
File.expand_path("tmp/test-repo-install/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar"),
|
191
|
+
File.expand_path("tmp/test-repo-install/commons-io/commons-io/1.4/commons-io-1.4.jar"),
|
192
|
+
File.expand_path("tmp/test-repo-install/commons-lang/commons-lang/2.6/commons-lang-2.6.jar"),
|
193
|
+
File.expand_path("tmp/test-repo-install/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"),
|
194
|
+
File.expand_path("tmp/test-repo-install/org/apache/mina/mina-core/2.0.4/mina-core-2.0.4.jar"),
|
195
|
+
File.expand_path("tmp/test-repo-install/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar")
|
196
|
+
|
197
|
+
])
|
124
198
|
end
|
125
199
|
|
126
200
|
end
|
@@ -130,18 +204,18 @@ describe LockJar, "#list" do
|
|
130
204
|
|
131
205
|
LockJar.lock( "spec/Jarfile", :local_repo => 'tmp/test-repo', :lockfile => 'tmp/Jarfile.lock' )
|
132
206
|
|
133
|
-
jars = LockJar.list( 'tmp/Jarfile.lock', ['
|
207
|
+
jars = LockJar.list( 'tmp/Jarfile.lock', ['default', 'development', 'bad scope'], :local_repo => 'tmp/test-repo' )
|
134
208
|
jars.should eql([
|
135
|
-
"
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
209
|
+
"ch.qos.logback:logback-classic:jar:0.9.24", "ch.qos.logback:logback-core:jar:0.9.24",
|
210
|
+
"com.metapossum:metapossum-scanner:jar:1.0", "com.slackworks:modelcitizen:jar:0.2.2",
|
211
|
+
"commons-beanutils:commons-beanutils:jar:1.8.3", "commons-io:commons-io:jar:1.4",
|
212
|
+
"commons-lang:commons-lang:jar:2.6", "commons-logging:commons-logging:jar:1.1.1",
|
213
|
+
"org.apache.mina:mina-core:jar:2.0.4",
|
214
|
+
"org.slf4j:slf4j-api:jar:1.6.1", "com.typesafe:config:jar:0.5.0" ])
|
141
215
|
end
|
142
216
|
|
143
217
|
it "should replace dependencies with maps" do
|
144
|
-
dsl = LockJar::Dsl.
|
218
|
+
dsl = LockJar::Domain::Dsl.create do
|
145
219
|
map 'junit:junit', 'tmp'
|
146
220
|
jar 'junit:junit:4.10'
|
147
221
|
end
|
@@ -152,7 +226,7 @@ describe LockJar, "#list" do
|
|
152
226
|
end
|
153
227
|
|
154
228
|
it "should replace dependencies with maps and get local paths" do
|
155
|
-
dsl = LockJar::Dsl.
|
229
|
+
dsl = LockJar::Domain::Dsl.create do
|
156
230
|
map 'junit:junit', 'tmp'
|
157
231
|
jar 'junit:junit:4.10'
|
158
232
|
end
|
@@ -173,22 +247,22 @@ describe LockJar, "#load" do
|
|
173
247
|
|
174
248
|
|
175
249
|
LockJar.lock( "spec/Jarfile", :local_repo => 'tmp/test-repo', :lockfile => 'tmp/Jarfile.lock' )
|
176
|
-
|
177
|
-
jars = LockJar.load( 'tmp/Jarfile.lock', ['
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
File.expand_path("tmp/test-repo/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar"),
|
250
|
+
|
251
|
+
jars = LockJar.load( 'tmp/Jarfile.lock', ['default'], :local_repo => 'tmp/test-repo' )
|
252
|
+
LockJar::Registry.instance.lockfile_registered?( "tmp/Jarfile.lock" ).should be_false
|
253
|
+
|
254
|
+
jars.should eql([
|
182
255
|
File.expand_path("tmp/test-repo/ch/qos/logback/logback-classic/0.9.24/logback-classic-0.9.24.jar"),
|
183
|
-
File.expand_path("tmp/test-repo/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"),
|
184
|
-
File.expand_path("tmp/test-repo/junit/junit/4.7/junit-4.7.jar"),
|
185
256
|
File.expand_path("tmp/test-repo/ch/qos/logback/logback-core/0.9.24/logback-core-0.9.24.jar"),
|
186
|
-
File.expand_path("tmp/test-repo/
|
257
|
+
File.expand_path("tmp/test-repo/com/metapossum/metapossum-scanner/1.0/metapossum-scanner-1.0.jar"),
|
187
258
|
File.expand_path("tmp/test-repo/com/slackworks/modelcitizen/0.2.2/modelcitizen-0.2.2.jar"),
|
188
|
-
File.expand_path("tmp/test-repo/
|
259
|
+
File.expand_path("tmp/test-repo/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar"),
|
189
260
|
File.expand_path("tmp/test-repo/commons-io/commons-io/1.4/commons-io-1.4.jar"),
|
190
|
-
File.expand_path("tmp/test-repo/
|
191
|
-
|
261
|
+
File.expand_path("tmp/test-repo/commons-lang/commons-lang/2.6/commons-lang-2.6.jar"),
|
262
|
+
File.expand_path("tmp/test-repo/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"),
|
263
|
+
File.expand_path("tmp/test-repo/org/apache/mina/mina-core/2.0.4/mina-core-2.0.4.jar"),
|
264
|
+
File.expand_path("tmp/test-repo/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"),
|
265
|
+
])
|
192
266
|
if Naether.platform == 'java'
|
193
267
|
lambda { include_class 'org.apache.mina.core.IoUtil' }.should_not raise_error
|
194
268
|
else
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: lock_jar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.7.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Guymon
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: naether
|
@@ -17,13 +17,13 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.10.0
|
21
21
|
none: false
|
22
22
|
requirement: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.10.0
|
27
27
|
none: false
|
28
28
|
prerelease: false
|
29
29
|
type: :runtime
|
@@ -97,13 +97,13 @@ dependencies:
|
|
97
97
|
requirements:
|
98
98
|
- - ~>
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: 0.0
|
100
|
+
version: 0.1.0
|
101
101
|
none: false
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
104
|
- - ~>
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: 0.0
|
106
|
+
version: 0.1.0
|
107
107
|
none: false
|
108
108
|
prerelease: false
|
109
109
|
type: :development
|
@@ -144,22 +144,27 @@ files:
|
|
144
144
|
- bin/lockjar
|
145
145
|
- lib/lock_jar.rb
|
146
146
|
- lib/lock_jar/buildr.rb
|
147
|
+
- lib/lock_jar/bundler.rb
|
147
148
|
- lib/lock_jar/class_loader.rb
|
148
149
|
- lib/lock_jar/cli.rb
|
149
|
-
- lib/lock_jar/
|
150
|
+
- lib/lock_jar/domain/artifact.rb
|
151
|
+
- lib/lock_jar/domain/dsl.rb
|
152
|
+
- lib/lock_jar/domain/dsl_helper.rb
|
153
|
+
- lib/lock_jar/domain/gem_dsl.rb
|
154
|
+
- lib/lock_jar/domain/jarfile_dsl.rb
|
155
|
+
- lib/lock_jar/domain/lockfile.rb
|
150
156
|
- lib/lock_jar/maven.rb
|
151
157
|
- lib/lock_jar/registry.rb
|
152
158
|
- lib/lock_jar/resolver.rb
|
153
|
-
- lib/lock_jar/rubygems.rb
|
154
159
|
- lib/lock_jar/runtime.rb
|
155
160
|
- lib/lock_jar/version.rb
|
156
161
|
- lock_jar.gemspec
|
157
162
|
- spec/Jarfile
|
158
163
|
- spec/lock_jar/class_loader_spec.rb
|
159
|
-
- spec/lock_jar/
|
164
|
+
- spec/lock_jar/domain/dsl_helper_spec.rb
|
165
|
+
- spec/lock_jar/domain/dsl_spec.rb
|
160
166
|
- spec/lock_jar/maven_spec.rb
|
161
167
|
- spec/lock_jar/resolver_spec.rb
|
162
|
-
- spec/lock_jar/rubygems_spec.rb
|
163
168
|
- spec/lock_jar/runtime_spec.rb
|
164
169
|
- spec/lock_jar_spec.rb
|
165
170
|
- spec/pom.xml
|