|
[
Permalink
| « Hide
]
Thomas Diesler added a comment - 05/Sep/08 05:03 AM
Email that I sent to the dev list: I need the ability to run an ant action before packs are installed. Currently the build file called must exist on the system since at the point the ant action is called, no files have been extracted from the packs. In my use case, the build file does not exist on the system, so this is not going to work. What I would like to do is to modify the AntActiionInstallListener to be able to reference a build file that is stored as a resource of the installed: <?xml version="1.0" encoding="UTF-8"?> In the above example, "embedded_build_xml" would be a reference to a resource: <resource id="embedded_build_xml" src="build.xml" parse="yes" type="ant"/> What this will do is extract out the resource into a temporary file while substituting variables and then set the temporary file as the build file. The DTD for AntActionSpec would be changed to have a new "buildresource" attribute and the "buildfile" attribute would be changed to IMPLIED. Either "buildfile" or "buildresource" must be specified but not both. I have the code up and running. Attached is a patch to show the changes. If after review no one objects, I will open an enhancement issue and apply the changes including updating the documentation. I modified this to follow the standard build file processing in that the build resource, when extracted, will NOT substitute variables into the extracted build file. Like the standard build file processing, variables can be passed into the extracted build file by using ant properties. Added support for referencing a "buildresource" by resource Id in the AntActionSpec.xml. The Id given must match one defined like: The file "prebuild.xml" will be extracted into a temporary file and ant will be called with this file as its build file. The temporary will be removed when the installation completes. Thanks for this fix! ... One issue though that seems unresolved... If you use buildresource rather than buildfile and also have an <uninstall_target> defined for that <antcall>, then un-installation will fail looking for the buildresource in the Temp directory. Here's some information... The <antcall> The Exception System Info: The work-around that I'm planning is to declare separate _<antcall>_s for my uninstall tasks, which point to a different Ant build.xml file than I use for my install tasks. That build file would be installed at installation into the Uninstaller directory. It should work for now, but I really like the idea of not exposing any of these tasks to users. Any chance this could be addressed? Thanks! Tom, I do use a separate "antcall" in my installer for this. My use case was that I needed to upgrade an installation. My upgrade uses ant but there was not currently a build file on the system and in fact the upgrade process build file did not need to exist after the upgrade. I needed to perform some actions before packs were installed, so I came up with this solution. I did not think about an uninstall situation. I will take a look at what it will take to extract out the same build file during the uninstall and execute it there. Reopen this issue to support extracting the embedded build file when uninstalling. Right now, the ant call will fail during uninstallation if there is an uninstall target. Hi Brett, Any news on this issue? Thanks I will try to get to this over the weekend. I know I can fix it, it is just finding the time. Made changes to AntActionInstallListener and AntActionUninstallListerner and IOHelper to copy the internal build script to Hi Brett and Julien, Thanks for your work on this issue. I'm excited to upgrade to 4.3.1 to try it out. Thanks again, For my reference: IzPack-4.3.1 install-definition.xml <!-- jars --> <!-- Listeners --> <!-- Resources --> ant-actions-spec.xml <antactions> ant-jbossas-integration.xml <project> |
|||||||||||||||||||||||||||||||||||||||||