buildr-bnd 0.0.5 → 0.0.6
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/CHANGELOG +25 -21
- data/LICENSE +176 -176
- data/README.rdoc +230 -230
- data/Rakefile +41 -24
- data/buildr-bnd.gemspec +20 -20
- data/lib/buildr/bnd/bundle_task.rb +82 -81
- data/lib/buildr/bnd/core.rb +26 -26
- data/lib/buildr/bnd/project_extension.rb +35 -35
- data/lib/buildr/bnd/version.rb +10 -10
- data/lib/buildr_bnd.rb +4 -4
- data/spec/buildr/bnd/bundle_package_spec.rb +223 -223
- data/spec/buildr/bnd/defaults_spec.rb +78 -74
- data/spec/buildr/bnd/project_extension_spec.rb +11 -11
- data/spec/spec_helper.rb +39 -32
- metadata +7 -8
- data/spec/spec.opts +0 -1
@@ -1,74 +1,78 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "project.bnd defaults" do
|
4
|
-
|
5
|
-
before do
|
6
|
-
write "src/main/java/com/biz/Foo.java", <<SRC
|
7
|
-
package com.biz;
|
8
|
-
public class Foo {}
|
9
|
-
SRC
|
10
|
-
write "bar/src/main/java/com/biz/bar/Bar.java", <<SRC
|
11
|
-
package com.biz.bar;
|
12
|
-
public class Bar {}
|
13
|
-
SRC
|
14
|
-
|
15
|
-
@foo = define "foo" do
|
16
|
-
project.version = "2.1.3"
|
17
|
-
project.group = "mygroup"
|
18
|
-
package :bundle
|
19
|
-
compile.with Buildr::Ant.dependencies
|
20
|
-
desc "My Bar Project"
|
21
|
-
define "bar" do
|
22
|
-
package :bundle
|
23
|
-
end
|
24
|
-
end
|
25
|
-
@bar = @foo.project('bar')
|
26
|
-
end
|
27
|
-
|
28
|
-
it "defaults Bundle-Version to project.version" do
|
29
|
-
@foo.packages[0].to_params['Bundle-Version'].should eql('2.1.3')
|
30
|
-
@bar.packages[0].to_params['Bundle-Version'].should eql('2.1.3')
|
31
|
-
end
|
32
|
-
|
33
|
-
it "defaults -classpath to compile path and dependencies" do
|
34
|
-
@foo.packages[0].to_params['-classpath'].should include(@foo.compile.target.to_s)
|
35
|
-
@foo.packages[0].to_params['-classpath'].should include(Buildr.artifacts(Buildr::Ant.dependencies[0]).to_s)
|
36
|
-
@bar.packages[0].to_params['-classpath'].should include(@bar.compile.target.to_s)
|
37
|
-
end
|
38
|
-
|
39
|
-
it "classpath method returns compile path and dependencies" do
|
40
|
-
@foo.packages[0].classpath.should include(@foo.compile.target)
|
41
|
-
Buildr::Ant.dependencies.each do |dependency|
|
42
|
-
@foo.packages[0].classpath.to_s.should include(Buildr.artifacts(dependency).to_s)
|
43
|
-
end
|
44
|
-
@bar.packages[0].classpath.should include(@bar.compile.target)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "defaults Bundle-SymbolicName to combination of group and name" do
|
48
|
-
@foo.packages[0].to_params['Bundle-SymbolicName'].should eql('mygroup.foo')
|
49
|
-
@bar.packages[0].to_params['Bundle-SymbolicName'].should eql('mygroup.foo.bar')
|
50
|
-
end
|
51
|
-
|
52
|
-
it "defaults Export-Package to nil" do
|
53
|
-
@foo.packages[0].to_params['Export-Package'].should be_nil
|
54
|
-
@bar.packages[0].to_params['Export-Package'].should be_nil
|
55
|
-
end
|
56
|
-
|
57
|
-
it "defaults Import-Package to nil" do
|
58
|
-
@foo.packages[0].to_params['Import-Package'].should be_nil
|
59
|
-
@bar.packages[0].to_params['Import-Package'].should be_nil
|
60
|
-
end
|
61
|
-
|
62
|
-
it "defaults Bundle-Name to project.name if comment not present" do
|
63
|
-
@foo.packages[0].to_params['Bundle-Name'].should eql('foo')
|
64
|
-
end
|
65
|
-
|
66
|
-
it "defaults Bundle-Name to comment if present" do
|
67
|
-
@bar.packages[0].to_params['Bundle-Name'].should eql('My Bar Project')
|
68
|
-
end
|
69
|
-
|
70
|
-
it "defaults Bundle-Description to project.full_comment" do
|
71
|
-
@foo.packages[0].to_params['Bundle-Description'].should be_nil
|
72
|
-
@bar.packages[0].to_params['Bundle-Description'].should eql('My Bar Project')
|
73
|
-
end
|
74
|
-
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "project.bnd defaults" do
|
4
|
+
|
5
|
+
before do
|
6
|
+
write "src/main/java/com/biz/Foo.java", <<SRC
|
7
|
+
package com.biz;
|
8
|
+
public class Foo {}
|
9
|
+
SRC
|
10
|
+
write "bar/src/main/java/com/biz/bar/Bar.java", <<SRC
|
11
|
+
package com.biz.bar;
|
12
|
+
public class Bar {}
|
13
|
+
SRC
|
14
|
+
|
15
|
+
@foo = define "foo" do
|
16
|
+
project.version = "2.1.3"
|
17
|
+
project.group = "mygroup"
|
18
|
+
package :bundle
|
19
|
+
compile.with Buildr::Ant.dependencies
|
20
|
+
desc "My Bar Project"
|
21
|
+
define "bar" do
|
22
|
+
package :bundle
|
23
|
+
end
|
24
|
+
end
|
25
|
+
@bar = @foo.project('bar')
|
26
|
+
end
|
27
|
+
|
28
|
+
it "defaults Bundle-Version to project.version" do
|
29
|
+
@foo.packages[0].to_params['Bundle-Version'].should eql('2.1.3')
|
30
|
+
@bar.packages[0].to_params['Bundle-Version'].should eql('2.1.3')
|
31
|
+
end
|
32
|
+
|
33
|
+
it "defaults -classpath to compile path and dependencies" do
|
34
|
+
@foo.packages[0].to_params['-classpath'].should include(@foo.compile.target.to_s)
|
35
|
+
@foo.packages[0].to_params['-classpath'].should include(Buildr.artifacts(Buildr::Ant.dependencies[0]).to_s)
|
36
|
+
@bar.packages[0].to_params['-classpath'].should include(@bar.compile.target.to_s)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "classpath method returns compile path and dependencies" do
|
40
|
+
@foo.packages[0].classpath.should include(@foo.compile.target)
|
41
|
+
Buildr::Ant.dependencies.each do |dependency|
|
42
|
+
@foo.packages[0].classpath.to_s.should include(Buildr.artifacts(dependency).to_s)
|
43
|
+
end
|
44
|
+
@bar.packages[0].classpath.should include(@bar.compile.target)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "defaults Bundle-SymbolicName to combination of group and name" do
|
48
|
+
@foo.packages[0].to_params['Bundle-SymbolicName'].should eql('mygroup.foo')
|
49
|
+
@bar.packages[0].to_params['Bundle-SymbolicName'].should eql('mygroup.foo.bar')
|
50
|
+
end
|
51
|
+
|
52
|
+
it "defaults Export-Package to nil" do
|
53
|
+
@foo.packages[0].to_params['Export-Package'].should be_nil
|
54
|
+
@bar.packages[0].to_params['Export-Package'].should be_nil
|
55
|
+
end
|
56
|
+
|
57
|
+
it "defaults Import-Package to nil" do
|
58
|
+
@foo.packages[0].to_params['Import-Package'].should be_nil
|
59
|
+
@bar.packages[0].to_params['Import-Package'].should be_nil
|
60
|
+
end
|
61
|
+
|
62
|
+
it "defaults Bundle-Name to project.name if comment not present" do
|
63
|
+
@foo.packages[0].to_params['Bundle-Name'].should eql('foo')
|
64
|
+
end
|
65
|
+
|
66
|
+
it "defaults Bundle-Name to comment if present" do
|
67
|
+
@bar.packages[0].to_params['Bundle-Name'].should eql('My Bar Project')
|
68
|
+
end
|
69
|
+
|
70
|
+
it "defaults Bundle-Description to project.full_comment" do
|
71
|
+
@foo.packages[0].to_params['Bundle-Description'].should be_nil
|
72
|
+
@bar.packages[0].to_params['Bundle-Description'].should eql('My Bar Project')
|
73
|
+
end
|
74
|
+
|
75
|
+
it "defaults -removeheaders to" do
|
76
|
+
@foo.packages[0].to_params['-removeheaders'].should eql("Include-Resource,Bnd-LastModified,Created-By,Implementation-Title,Tool")
|
77
|
+
end
|
78
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "project extension" do
|
4
|
-
it "provides an 'bnd:print' task" do
|
5
|
-
Rake::Task.tasks.detect{|task| task.to_s == "bnd:print"}.should_not be_nil
|
6
|
-
end
|
7
|
-
|
8
|
-
it "documents the 'bnd:print' task" do
|
9
|
-
Rake::Task.tasks.detect{|task| task.to_s == "bnd:print"}.comment.should_not be_nil
|
10
|
-
end
|
11
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "project extension" do
|
4
|
+
it "provides an 'bnd:print' task" do
|
5
|
+
Rake::Task.tasks.detect{|task| task.to_s == "bnd:print"}.should_not be_nil
|
6
|
+
end
|
7
|
+
|
8
|
+
it "documents the 'bnd:print' task" do
|
9
|
+
Rake::Task.tasks.detect{|task| task.to_s == "bnd:print"}.comment.should_not be_nil
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,32 +1,39 @@
|
|
1
|
-
require 'spec'
|
2
|
-
|
3
|
-
DEFAULT_BUILDR_DIR=File.expand_path(File.dirname(__FILE__) + '/../../buildr')
|
4
|
-
BUILDR_DIR =
|
5
|
-
begin
|
6
|
-
if ENV['BUILDR_DIR']
|
7
|
-
ENV['BUILDR_DIR']
|
8
|
-
elsif File.exist?(File.expand_path('../buildr_dir', __FILE__))
|
9
|
-
File.read(File.expand_path('../buildr_dir', __FILE__)).strip
|
10
|
-
else
|
11
|
-
DEFAULT_BUILDR_DIR
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
unless File.exist?("#{BUILDR_DIR}/buildr.gemspec")
|
16
|
-
raise "Unable to find buildr.gemspec in #{BUILDR_DIR == DEFAULT_BUILDR_DIR ? 'guessed' : 'specified'} $BUILDR_DIR (#{BUILDR_DIR})"
|
17
|
-
end
|
18
|
-
|
19
|
-
# hook into buildr's spec_helpers load process
|
20
|
-
module SandboxHook
|
21
|
-
def SandboxHook.included(spec_helpers)
|
22
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
23
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
24
|
-
require 'buildr_bnd'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
#
|
31
|
-
|
32
|
-
|
1
|
+
require 'spec'
|
2
|
+
|
3
|
+
DEFAULT_BUILDR_DIR=File.expand_path(File.dirname(__FILE__) + '/../../buildr')
|
4
|
+
BUILDR_DIR =
|
5
|
+
begin
|
6
|
+
if ENV['BUILDR_DIR']
|
7
|
+
ENV['BUILDR_DIR']
|
8
|
+
elsif File.exist?(File.expand_path('../buildr_dir', __FILE__))
|
9
|
+
File.read(File.expand_path('../buildr_dir', __FILE__)).strip
|
10
|
+
else
|
11
|
+
DEFAULT_BUILDR_DIR
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
unless File.exist?("#{BUILDR_DIR}/buildr.gemspec")
|
16
|
+
raise "Unable to find buildr.gemspec in #{BUILDR_DIR == DEFAULT_BUILDR_DIR ? 'guessed' : 'specified'} $BUILDR_DIR (#{BUILDR_DIR})"
|
17
|
+
end
|
18
|
+
|
19
|
+
# hook into buildr's spec_helpers load process
|
20
|
+
module SandboxHook
|
21
|
+
def SandboxHook.included(spec_helpers)
|
22
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
23
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
24
|
+
require 'buildr_bnd'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
begin
|
29
|
+
require File.expand_path("#{BUILDR_DIR}/lib/buildr/version.rb")
|
30
|
+
require File.expand_path("#{BUILDR_DIR}/spec/spec_helpers.rb")
|
31
|
+
rescue Exception => e
|
32
|
+
$stderr.puts "Error initializing the build environment\n"
|
33
|
+
$stderr.puts "Cause: #{e.inspect}\n"
|
34
|
+
exit(22)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Download deps into real local dir
|
38
|
+
Buildr::repositories.remote << Buildr::Bnd.remote_repository
|
39
|
+
Buildr::Bnd.requires.each { |spec| artifact(spec).invoke }
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 6
|
9
|
+
version: 0.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Peter Donald
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-10-12 00:00:00 +11:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -33,15 +33,14 @@ extra_rdoc_files:
|
|
33
33
|
- CHANGELOG
|
34
34
|
files:
|
35
35
|
- lib/buildr_bnd.rb
|
36
|
-
- lib/buildr/bnd/version.rb
|
37
36
|
- lib/buildr/bnd/bundle_task.rb
|
38
|
-
- lib/buildr/bnd/project_extension.rb
|
39
37
|
- lib/buildr/bnd/core.rb
|
38
|
+
- lib/buildr/bnd/project_extension.rb
|
39
|
+
- lib/buildr/bnd/version.rb
|
40
40
|
- spec/spec_helper.rb
|
41
|
-
- spec/spec.opts
|
42
|
-
- spec/buildr/bnd/project_extension_spec.rb
|
43
41
|
- spec/buildr/bnd/bundle_package_spec.rb
|
44
42
|
- spec/buildr/bnd/defaults_spec.rb
|
43
|
+
- spec/buildr/bnd/project_extension_spec.rb
|
45
44
|
- buildr-bnd.gemspec
|
46
45
|
- LICENSE
|
47
46
|
- README.rdoc
|
@@ -54,7 +53,7 @@ licenses: []
|
|
54
53
|
post_install_message:
|
55
54
|
rdoc_options:
|
56
55
|
- --title
|
57
|
-
- buildr-bnd 0.0.
|
56
|
+
- buildr-bnd 0.0.6
|
58
57
|
- --main
|
59
58
|
- README.rdoc
|
60
59
|
require_paths:
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|