Class: Buildr4OSGi::FeatureTask
- Inherits:
-
Buildr::Packaging::Java::JarTask
- Object
- Buildr::Packaging::Java::JarTask
- Buildr4OSGi::FeatureTask
- Includes:
- FeaturePackaging
- Defined in:
- lib/buildr4osgi/eclipse/feature.rb
Instance Attribute Summary collapse
-
#feature_properties ⇒ Object
Returns the value of attribute feature_properties.
-
#feature_xml ⇒ Object
Returns the value of attribute feature_xml.
-
#p2_inf ⇒ Object
Returns the value of attribute p2_inf.
-
#plugins ⇒ Object
Returns the value of attribute plugins.
Instance Method Summary collapse
- #generateFeature(project) ⇒ Object
-
#initialize(*args) ⇒ FeatureTask
constructor
:nodoc:.
Constructor Details
#initialize(*args) ⇒ FeatureTask
:nodoc:
131 132 133 134 135 136 |
# File 'lib/buildr4osgi/eclipse/feature.rb', line 131 def initialize(*args) #:nodoc: super @unjarred = {} @plugins = ArrayAddWithOptions.new(@unjarred) end |
Instance Attribute Details
#feature_properties ⇒ Object
Returns the value of attribute feature_properties.
123 124 125 |
# File 'lib/buildr4osgi/eclipse/feature.rb', line 123 def feature_properties @feature_properties end |
#feature_xml ⇒ Object
Returns the value of attribute feature_xml.
122 123 124 |
# File 'lib/buildr4osgi/eclipse/feature.rb', line 122 def feature_xml @feature_xml end |
#p2_inf ⇒ Object
Returns the value of attribute p2_inf.
124 125 126 |
# File 'lib/buildr4osgi/eclipse/feature.rb', line 124 def p2_inf @p2_inf end |
#plugins ⇒ Object
Returns the value of attribute plugins.
120 121 122 |
# File 'lib/buildr4osgi/eclipse/feature.rb', line 120 def plugins @plugins end |
Instance Method Details
#generateFeature(project) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/buildr4osgi/eclipse/feature.rb', line 138 def generateFeature(project) mkpath File.join(project.base_dir, 'target') resolved_plugins = create_resolved_plugins enhance(resolved_plugins.values) enhance([p2_inf]) if p2_inf unless feature_xml File.open(File.join(project.base_dir, 'target', 'feature.xml'), 'w') do |f| f.write(writeFeatureXml(resolved_plugins.keys, feature_xml.nil? && feature_properties.nil? )) end path("eclipse/features/#{feature_id}_#{project.version}").include File.join(project.base_dir, 'target', 'feature.xml') else path("eclipse/features/#{feature_id}_#{project.version}").include feature_xml end unless feature_properties || feature_xml File.open(File.join(project.base_dir, 'target', 'feature.properties'), 'w') do |f| f.write(writeFeatureProperties()) end path("eclipse/features/#{feature_id}_#{project.version}").include File.join(project.base_dir, 'target', 'feature.properties') else path("eclipse/features/#{feature_id}_#{project.version}").include feature_properties if feature_properties end path("eclipse/features/#{feature_id}_#{project.version}").include(p2_inf.to_s, :as => "p2.inf") if p2_inf resolved_plugins.each_pair do |info, plugin| unless info[:manifest].nil? cp plugin.to_s, project.path_to("target/#{plugin.id}_#{plugin.version}.jar") plugin = project.path_to("target/#{plugin.id}_#{plugin.version}.jar") ::Buildr::Packaging::Java::Manifest.update_manifest(plugin) {|manifest| #applies to sources bundles only: if it was the runtime manifest, then remove it altogether: unless manifest.main["Bundle-SymbolicName"].nil? #there was a symbolic name: assume this manifest was the runtime one. #we don't want OSGi to confuse the runtime jar with the sources. #ideally we would want keep an archive of the original #runtime manifest as for example MANIFEST.MF.source manifest.main.clear end manifest.main.merge! info[:manifest] } end if info[:unjarred] merge(plugin, :path => "eclipse/plugins/#{info[:id]}_#{info[:version]}") else include(plugin, :as => "eclipse/plugins/#{info[:id]}_#{info[:version]}.jar") end end end |