You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Magesh Umasankar <um...@apache.org> on 2003/06/10 16:54:03 UTC

[PATCH] Shar - Task to create self-extracting Shell archive

The Shar task creates a Unix shell script that extracts
one or more files from within its body and executes 
additional shell commands.  It UUEncodes the files 
added to the archive unless specified otherwise.

Foreseen use-cases include being able to create
an installer with Ant as its internal engine and
distributing the installer with no pre-requisites
(like Java or Ant) being installed on the
deploymant machine - the self extracting archive
would itself include a JRE and Ant in it.

This task may be used as follows:

<shar destFile="installer.sh">
  <fileset dir="${dir}" includes="**/*.jar"/>
  <postscript>
  echo "Hello World!"
  </postscript>
</shar>

This task will create the self-extracting script such 
that the script creates sub directories as needed
when unarchiving itself.

The user of installer.sh would just type

sh installer.sh

at the shell prompt to start the installation process.

Comments?

Worthwhile addition?

Cheers,
Magesh