buildr4osgi 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/buildr4osgi.gemspec +1 -1
- data/lib/buildr4osgi/eclipse/feature.rb +5 -2
- data/spec/eclipse/feature_spec.rb +5 -0
- metadata +4 -4
data/buildr4osgi.gemspec
CHANGED
@@ -121,6 +121,7 @@ PROPERTIES
|
|
121
121
|
|
122
122
|
attr_accessor :feature_xml
|
123
123
|
attr_accessor :feature_properties
|
124
|
+
attr_accessor :p2_inf
|
124
125
|
|
125
126
|
FeatureWriter::VARS << :plugins
|
126
127
|
FeatureWriter::VARS << :feature_xml
|
@@ -138,6 +139,7 @@ PROPERTIES
|
|
138
139
|
mkpath File.join(project.base_dir, 'target')
|
139
140
|
resolved_plugins = create_resolved_plugins
|
140
141
|
enhance(resolved_plugins.values)
|
142
|
+
enhance([p2_inf]) if p2_inf
|
141
143
|
unless feature_xml
|
142
144
|
File.open(File.join(project.base_dir, 'target', 'feature.xml'), 'w') do |f|
|
143
145
|
f.write(writeFeatureXml(resolved_plugins.keys, feature_xml.nil? && feature_properties.nil? ))
|
@@ -154,6 +156,7 @@ PROPERTIES
|
|
154
156
|
else
|
155
157
|
path("eclipse/features/#{feature_id}_#{project.version}").include feature_properties if feature_properties
|
156
158
|
end
|
159
|
+
path("eclipse/features/#{feature_id}_#{project.version}").include(p2_inf.to_s, :as => "p2.inf") if p2_inf
|
157
160
|
|
158
161
|
resolved_plugins.each_pair do |info, plugin|
|
159
162
|
unless info[:manifest].nil?
|
@@ -341,7 +344,7 @@ PROPERTIES
|
|
341
344
|
artifact = Buildr::artifact(artifact.to_hash.merge(:classifier => "sources")) if artifact.is_a?(Buildr::Artifact)
|
342
345
|
info, as_dir = adapt_plugin(artifact)
|
343
346
|
if !info.nil?
|
344
|
-
info[:unjarred] = as_dir || (!@unjarred[plugin].nil? && @unjarred[plugin][:unjarred])
|
347
|
+
info[:unjarred] = false #as_dir || (!@unjarred[plugin].nil? && @unjarred[plugin][:unjarred]) never explode a sources bundle.
|
345
348
|
resolved_plugins[info] = artifact
|
346
349
|
end
|
347
350
|
end
|
@@ -394,7 +397,7 @@ PROPERTIES
|
|
394
397
|
raise "Cannot use same feature.xml file for both binary and source features packaging" if (!featurePackage.feature_xml.nil?) && featurePackage.feature_xml == sdkTask.feature_xml
|
395
398
|
sdkTask.label += " - Sources" if featurePackage.label == sdkTask.label
|
396
399
|
sdkTask.description = "Sources for " + sdkTask.description if featurePackage.description == sdkTask.description
|
397
|
-
sdkTask.feature_id += ".
|
400
|
+
sdkTask.feature_id += ".source" if featurePackage.feature_id == sdkTask.feature_id
|
398
401
|
sdkTask.generateFeature(project)
|
399
402
|
end
|
400
403
|
|
@@ -116,6 +116,7 @@ end
|
|
116
116
|
describe Buildr4OSGi::FeatureTask, "configuration" do
|
117
117
|
|
118
118
|
it "should accept the feature parameters" do
|
119
|
+
Buildr::write "p2.inf", ""
|
119
120
|
foo = define("foo", :version => "1.0.0")
|
120
121
|
f = foo.package(:feature)
|
121
122
|
lambda {
|
@@ -131,6 +132,7 @@ describe Buildr4OSGi::FeatureTask, "configuration" do
|
|
131
132
|
f.update_sites << {:url => "http://example.com/update", :name => "My update site"}
|
132
133
|
f.discovery_sites = [{:url => "http://example.com/update2", :name => "My update site2"},
|
133
134
|
{:url => "http://example.com/upup", :name => "My update site in case"}]
|
135
|
+
f.p2_inf = "p2.inf"
|
134
136
|
}.should_not raise_error
|
135
137
|
end
|
136
138
|
|
@@ -205,6 +207,7 @@ end
|
|
205
207
|
describe Buildr4OSGi::FeatureTask, " when running" do
|
206
208
|
|
207
209
|
before do
|
210
|
+
Buildr::write "myp2.inf", "#p2 properties\n"
|
208
211
|
@foo = define("foo", :version => "1.0.0")
|
209
212
|
f = @foo.package(:feature)
|
210
213
|
f.plugins << DEBUG_UI
|
@@ -218,6 +221,7 @@ describe Buildr4OSGi::FeatureTask, " when running" do
|
|
218
221
|
f.update_sites << {:url => "http://example.com/update", :name => "My update site"}
|
219
222
|
f.discovery_sites = [{:url => "http://example.com/update2", :name => "My update site2"},
|
220
223
|
{:url => "http://example.com/upup", :name => "My update site in case"}]
|
224
|
+
f.p2_inf = "myp2.inf"
|
221
225
|
end
|
222
226
|
|
223
227
|
it "should create a jar file with a eclipse/plugins and a eclipse/features structure" do
|
@@ -227,6 +231,7 @@ describe Buildr4OSGi::FeatureTask, " when running" do
|
|
227
231
|
Zip::ZipFile.open(feature_file) do |zip|
|
228
232
|
zip.find_entry("eclipse/features/foo_1.0.0/feature.xml").should_not be_nil
|
229
233
|
zip.find_entry("eclipse/features/foo_1.0.0/feature.properties").should_not be_nil
|
234
|
+
zip.find_entry("eclipse/features/foo_1.0.0/p2.inf").should_not be_nil
|
230
235
|
zip.find_entry("eclipse/plugins/org.eclipse.debug.ui_3.4.1.v20080811_r341.jar").should_not be_nil
|
231
236
|
end
|
232
237
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildr4osgi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 6
|
10
|
+
version: 0.9.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Antoine Toulme
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-05 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|