[izpack-users] Feature Request - Scripting Languages for custom actions
Matthew Inger
mattinger at gmail.com
Fri Dec 21 21:10:47 CET 2007
I'd like to be able to use scripting languages for custom actions.
Using ANT is cumbersome in some respects, and doesn't support
listening for file operations.
I'd like to have the ability to use scripting languages to implement custom
actions. Languages such as groovy or jruby would immediately come to mind.
An example spec file might be something like:
groovyActionsSpec.xml
-------------------------------------
<groovyactions>
<pack name="pack1">
<groovy><![CDATA[
void beforePacks(com.izforge.izpack.installer.AutomatedInstallDataidata,
java.lang.Integer npacks,
com.izforge.izpack.util.AbstractUIProgressHandler handler)
{
// do your groovy scripting here
}
]]></groovy>
</pack>
<pack name="pack2">
<groovy file="pack2groovyActions.groovy" />
</pack>
</groovyactions>
For a language like groovy, it's easy to create a java class on the fly
based on either a hardcoded script or a file. You could then attempt to
look for the particular interface method on the created java class (ie a
method on the generated class that has the same signature as a method on the
InstallerListener interface). If the method isn't defined you assume a
no-op, and do nothing. If it's found, you execute that method with the
appropriate arguments.
It would be a really nice way to do custom actions, without having to
compile additional java classes.
I've started working on a basic groovy based one but I would need some help
in getting it ready for the masses.
Is there any interest in this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-users/attachments/20071221/9cafaf5f/attachment.html
More information about the izpack-users
mailing list