[izpack-users] Feature Request - Scripting Languages for custom actions
Mark Fortner
phidias51 at yahoo.com
Sat Dec 29 03:08:31 CET 2007
I sent this to the list earlier, but it somehow didn't make it
through. You'll find more information on BSF at
http://jakarta.apache.org/bsf
On Dec 22, 2007 8:38 AM, Mark Fortner <phidias51 at gmail.com> wrote:
> The tags that you propose seem groovy-centric. I was wondering if you
> had any thoughts about how multiple languages would be supported?
> Would a general-purpose <script> tag work better -- along the lines of
> the Ant script tag.
>
> <script language="text/javascript" src="installer.js" />
>
> <script language="text/groovy">
> <![CDATA[
> void beforePacks(com.izforge.izpack.installer.AutomatedInstallData
> idata,
> java.lang.Integer npacks,
>
> com.izforge.izpack.util.AbstractUIProgressHandler handler)
> {
> // do your groovy scripting here
> }
> ]]>
> </script>
>
> The flexibility to be able to either embed or refer to a script (as
> Julien suggested) would be useful.
>
> Also, being able to support scripting through either BSF or Java 6's
> built-in support would be useful. This would insure that the
> scripting functionality is available in both 1.4 and 1.5. BSF
> supports JSR-223 scripting engines.
>
> Regards,
>
> Mark
>
>
> On Dec 21, 2007 12:10 PM, Matthew Inger <mattinger at gmail.com> wrote:
> > 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.AutomatedInstallData
> > idata,
> > 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?
> >
> >
> >
>
> > _______________________________________________
> > izpack-users mailing list
> > izpack-users at lists.berlios.de
> > https://lists.berlios.de/mailman/listinfo/izpack-users
> >
> >
>
More information about the izpack-users
mailing list