Class: Buildr::Packaging::Java::AarTask

Inherits:
JarTask show all
Defined in:
lib/buildr/java/packaging.rb

Overview

Extends the JarTask to create an AAR file (Axis2 service archive).

Supports all the same options as JarTask, with the addition of :wsdls, :services_xml and :libs.

  • :wsdls – WSDL files to include (under META-INF). By default packaging will include all WSDL files found under src/main/axis2.

  • :services_xml – Location of services.xml file (included under META-INF). By default packaging takes this from src/main/axis2/services.xml. Use a different path if you genereate the services.xml file as part of the build.

  • :libs – Array of files, tasks, artifact specifications, etc that will be added to the /lib directory.

For example:

package(:aar).with(:libs=>'log4j:log4j:jar:1.1')

filter.from('src/main/axis2').into('target').include('services.xml', '*.wsdl').using('http_port'=>'8080')
package(:aar).wsdls.clear
package(:aar).with(:services_xml=>_('target/services.xml'), :wsdls=>_('target/*.wsdl'))

Instance Attribute Summary collapse

Attributes inherited from ZipTask

#compression_level

Instance Method Summary collapse

Methods inherited from JarTask

#with

Methods inherited from ZipTask

#entries, #entry

Methods inherited from ArchiveTask

#clean, #contain?, #empty?, #exclude, #include, #invoke_prerequisites, #merge, #needed?, #path, #root, #with

Methods inherited from Rake::FileTask

#contain?, #empty?, #exist?

Constructor Details

#initialize(*args) ⇒ AarTask

:nodoc:



300
301
302
303
304
305
306
307
308
309
# File 'lib/buildr/java/packaging.rb', line 300

def initialize(*args) #:nodoc:
  super
  @libs = []
  @wsdls = []
  prepare do
    path('META-INF').include @wsdls
    path('META-INF').include @services_xml, :as=>'services.xml' if @services_xml
    path('lib').include Buildr.artifacts(@libs) unless @libs.nil? || @libs.empty?
  end
end

Instance Attribute Details

#libsObject

Artifacts to include under /lib.



294
295
296
# File 'lib/buildr/java/packaging.rb', line 294

def libs
  @libs
end

#services_xmlObject

Location of services.xml file (defaults to src/main/axis2/services.xml).



298
299
300
# File 'lib/buildr/java/packaging.rb', line 298

def services_xml
  @services_xml
end

#wsdlsObject

WSDLs to include under META-INF (defaults to all WSDLs under src/main/axis2).



296
297
298
# File 'lib/buildr/java/packaging.rb', line 296

def wsdls
  @wsdls
end