Class: BuildrIzPack::IzPackTask
- Inherits:
-
Buildr::ArchiveTask
- Object
- Buildr::ArchiveTask
- BuildrIzPack::IzPackTask
- Defined in:
- lib/buildrizpack/package.rb
Instance Attribute Summary collapse
-
#appName ⇒ Object
Application name used by the IzPack installer.
-
#basedir ⇒ Object
The base directory of compilation process (defaults project.path_to(:target)).
-
#compression ⇒ Object
defaults to deflate.
-
#compressionLevel ⇒ Object
defaults to 9.
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#dynamicvariables ⇒ Object
Returns the value of attribute dynamicvariables.
-
#guiprefs ⇒ Object
the supported locale’s.
-
#inheritAll ⇒ Object
It seems that in order to propagate all project properties to the the izpack compiler you need to set the inheritAll attribute to “true”.
-
#input ⇒ Object
“IzPack” to be used as starting point for calling the izpack installer some or all of its content may be overwritten, if you specify other attributes, e.g.
-
#installerrequirements ⇒ Object
Returns the value of attribute installerrequirements.
-
#installerType ⇒ Object
The installer type (defaults to standard).
-
#izpackVersion ⇒ Object
ther version of the izpack installer to be used.
-
#jar ⇒ Object
Returns the value of attribute jar.
-
#listeners ⇒ Object
Returns the value of attribute listeners.
-
#locales ⇒ Object
The supported locale’s for the installer.
-
#native ⇒ Object
Returns the value of attribute native.
-
#output ⇒ Object
The installer output directory and filename (defaults to <project>-<version>.izpack).
-
#packaging ⇒ Object
Returns the value of attribute packaging.
-
#packs ⇒ Object
the packs (including attributes, fileset, os-dependencies etc).
-
#panels ⇒ Object
IzPacks panels’s.
-
#properties ⇒ Object
a hash of name => value to be passed when calling the izpack installer See also IzPackTask.html.
-
#resources ⇒ Object
Returns the value of attribute resources.
-
#variables ⇒ Object
Returns the value of attribute variables.
Instance Method Summary collapse
-
#create_from(file_map) ⇒ Object
The ArchiveTask class delegates this method so we can create the archive.
Instance Attribute Details
#appName ⇒ Object
Application name used by the IzPack installer. Defaults to the current project
75 76 77 |
# File 'lib/buildrizpack/package.rb', line 75 def appName @appName end |
#basedir ⇒ Object
The base directory of compilation process (defaults project.path_to(:target))
79 80 81 |
# File 'lib/buildrizpack/package.rb', line 79 def basedir @basedir end |
#compression ⇒ Object
defaults to deflate. You can select between default, deflate and raw.
86 87 88 |
# File 'lib/buildrizpack/package.rb', line 86 def compression @compression end |
#compressionLevel ⇒ Object
defaults to 9. The compression level of the installation (defaults to -1 for no compression). Valid values are -1 to 9.
88 89 90 |
# File 'lib/buildrizpack/package.rb', line 88 def compressionLevel @compressionLevel end |
#conditions ⇒ Object
Returns the value of attribute conditions.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def conditions @conditions end |
#dynamicvariables ⇒ Object
Returns the value of attribute dynamicvariables.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def dynamicvariables @dynamicvariables end |
#guiprefs ⇒ Object
the supported locale’s. Must be an array of XmlMarkup object. Defaults to 680 x 520
98 99 100 |
# File 'lib/buildrizpack/package.rb', line 98 def guiprefs @guiprefs end |
#inheritAll ⇒ Object
It seems that in order to propagate all project properties to the the izpack compiler you need to set the inheritAll attribute to “true”. Therefore it defaults to true
84 85 86 |
# File 'lib/buildrizpack/package.rb', line 84 def inheritAll @inheritAll end |
#input ⇒ Object
“IzPack” to be used as starting point for calling the izpack installer some or all of its content may be overwritten, if you specify other attributes, e.g. if you want to specify one or mor pack bundles with a file list maintained by buildr. If not specified BuildrIzPack will create one at File.join(project.path_to(:target, ‘install.xml’))
71 72 73 |
# File 'lib/buildrizpack/package.rb', line 71 def input @input end |
#installerrequirements ⇒ Object
Returns the value of attribute installerrequirements.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def installerrequirements @installerrequirements end |
#installerType ⇒ Object
The installer type (defaults to standard). You can select between standard and web.
81 82 83 |
# File 'lib/buildrizpack/package.rb', line 81 def installerType @installerType end |
#izpackVersion ⇒ Object
ther version of the izpack installer to be used. Defaults to 4.3.5
73 74 75 |
# File 'lib/buildrizpack/package.rb', line 73 def izpackVersion @izpackVersion end |
#jar ⇒ Object
Returns the value of attribute jar.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def jar @jar end |
#listeners ⇒ Object
Returns the value of attribute listeners.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def listeners @listeners end |
#locales ⇒ Object
The supported locale’s for the installer. Must be an array of XmlMarkup object. Defaults to [‘eng’] For details look at IzPacks installation.dtd (Distributed with this gem)
94 95 96 |
# File 'lib/buildrizpack/package.rb', line 94 def locales @locales end |
#native ⇒ Object
Returns the value of attribute native.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def native @native end |
#output ⇒ Object
The installer output directory and filename (defaults to <project>-<version>.izpack)
77 78 79 |
# File 'lib/buildrizpack/package.rb', line 77 def output @output end |
#packaging ⇒ Object
Returns the value of attribute packaging.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def packaging @packaging end |
#packs ⇒ Object
the packs (including attributes, fileset, os-dependencies etc). Must be an array of XmlMarkup object.
90 91 92 |
# File 'lib/buildrizpack/package.rb', line 90 def packs @packs end |
#panels ⇒ Object
IzPacks panels’s. Must be an array of XmlMarkup object. Defaults to [‘TargetPanel’, ‘InstallPack’]
96 97 98 |
# File 'lib/buildrizpack/package.rb', line 96 def panels @panels end |
#properties ⇒ Object
a hash of name => value to be passed when calling the izpack installer See also IzPackTask.html
66 67 68 |
# File 'lib/buildrizpack/package.rb', line 66 def properties @properties end |
#resources ⇒ Object
Returns the value of attribute resources.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def resources @resources end |
#variables ⇒ Object
Returns the value of attribute variables.
100 101 102 |
# File 'lib/buildrizpack/package.rb', line 100 def variables @variables end |
Instance Method Details
#create_from(file_map) ⇒ Object
The ArchiveTask class delegates this method so we can create the archive. the file_map is the result of the computations of the include and exclude filters.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/buildrizpack/package.rb', line 107 def create_from(file_map) @izpackVersion ||= '4.3.5' @appName ||= project.id @izpackBaseDir = File.dirname(@output) if !@izpackBaseDir @installerType ||= 'standard' @inheritAll ||= 'true' @compression ||= 'deflate' @compressionLevel ||= '9' @locales ||= ['eng'] @panels ||= ['TargetPanel', 'InstallPanel'] @packs ||= raise "You must include at least one file to create an izPack installer" if file_map.size == 0 and !File.exists?(@input) izPackArtifact = Buildr.artifact( "org.codehaus.izpack:izpack-standalone-compiler:jar:#{@izpackVersion}") doc = nil if !File.exists?(@input) genInstaller(Builder::XmlMarkup.new(:target=>File.open(@input, 'w+'), :indent => 2), file_map) # genInstaller(Builder::XmlMarkup.new(:target=>$stdout, :indent => 2), file_map) # genInstaller(Builder::XmlMarkup.new(:target=>File.open('/home/niklaus/tmp2.xml', 'w+'), :indent => 2), file_map) end Buildr.ant('izpack-ant') do |x| izPackArtifact.invoke msg = "Generating izpack aus #{File.(@input)}" trace msg if properties properties.each{ |name, value| puts "Need added property #{name} with value #{value}" x.property(:name => name, :value => value) } end x.echo(:message =>msg) x.taskdef :name=>'izpack', :classname=>'com.izforge.izpack.ant.IzPackTask', :classpath=>izPackArtifact.to_s x.izpack :input=> @input, :output => @output, :basedir => @izpackBaseDir, :installerType=> @installerType, :inheritAll=> @inheritAll, :compression => @compression, :compressionLevel => @compressionLevel do end end end |