Can a build file be executed from a JAR?

Discussion in 'Java' started by hust6, Aug 23, 2005.

  1. hust6

    hust6 Guest

    If I have a build file sitting in a jar, is there a way to execute an
    ant script from within that build file? If so, how?

    Thanks, as always, for the help.

    hust6
    hust6, Aug 23, 2005
    #1
    1. Advertising

  2. hust6

    Roedy Green Guest

    On 23 Aug 2005 07:00:58 -0700, "hust6" <> wrote or
    quoted :

    >If I have a build file sitting in a jar, is there a way to execute an
    >ant script from within that build file? If so, how?


    There are two basic approaches.


    1. Extract the script from the jar with winzip or the like and feed it
    to ant normally.

    2. fire up ant from Java. Your java program fishes the script out of
    the jar using the java.util.zip.ZipEntry and java.util.zip.ZipFile
    and feeds it to ant.

    The advantage of the first is you can do it in two lines.

    The advantage of the second approach is you never have to touch a
    platform-specific script language.



    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com
    Roedy Green, Aug 23, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    554
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,688
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,724
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    637
    Arnold Peters
    Jan 5, 2005
  5. Replies:
    13
    Views:
    1,610
    Roedy Green
    Aug 18, 2007
Loading...

Share This Page