Class: BuildrIzPack::IzPackTask

Inherits:
Buildr::ArchiveTask
  • Object
show all
Defined in:
lib/buildrizpack/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appNameObject

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

#basedirObject

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

#compressionObject

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

#compressionLevelObject

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

#conditionsObject

Returns the value of attribute conditions.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def conditions
  @conditions
end

#dynamicvariablesObject

Returns the value of attribute dynamicvariables.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def dynamicvariables
  @dynamicvariables
end

#guiprefsObject

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

#inheritAllObject

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

#inputObject

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

#installerrequirementsObject

Returns the value of attribute installerrequirements.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def installerrequirements
  @installerrequirements
end

#installerTypeObject

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

#izpackVersionObject

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

#jarObject

Returns the value of attribute jar.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def jar
  @jar
end

#listenersObject

Returns the value of attribute listeners.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def listeners
  @listeners
end

#localesObject

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

#nativeObject

Returns the value of attribute native.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def native
  @native
end

#outputObject

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

#packagingObject

Returns the value of attribute packaging.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def packaging
  @packaging
end

#packsObject

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

#panelsObject

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

#propertiesObject

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

#resourcesObject

Returns the value of attribute resources.



100
101
102
# File 'lib/buildrizpack/package.rb', line 100

def resources
  @resources
end

#variablesObject

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.expand_path(@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