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:



307
308
309
310
311
312
313
314
315
316
# File 'lib/buildr/java/packaging.rb', line 307

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.



301
302
303
# File 'lib/buildr/java/packaging.rb', line 301

def libs
  @libs
end

#services_xmlObject

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



305
306
307
# File 'lib/buildr/java/packaging.rb', line 305

def services_xml
  @services_xml
end

#wsdlsObject

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



303
304
305
# File 'lib/buildr/java/packaging.rb', line 303

def wsdls
  @wsdls
end