ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Hanik" <fi...@filip.net>
Subject Re: interactive - done or should I write my own
Date Wed, 10 Jan 2001 23:16:21 GMT
problem solved.
here is the code for making your own task that asks for user password during
the jarsigning thing
this should get anybody who wants to write interactive tasks on top of the
ant built int tasks. you just overwrite the setAttribute methods

don't forget to add the taskdef into your build.xml file and by all means
contact me with any questions

Filip Hanik
Technical Architect
Pakana Corporation
fhanik@pakana.com


package com.Filip.ant;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Properties;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
 * Title:        Filip Ant Extensions
 * Description:  Extensions to the Ant build tool.
 * These extensions are proprietary for creating deployment specific tasks
for Filip
 * Copyright:    Copyright (c) 2001
 * Company:      Pakana Corporation
 * @author Filip Hanik
 * @version 1.0
 */

public class FILIPSignJar extends org.apache.tools.ant.taskdefs.SignJar
{
 private boolean mIsPasswordSet = false;
 static BufferedReader msgStream;
 static
 {
  msgStream = new BufferedReader (new InputStreamReader(System.in));

 }//static


 public void setStorepass(final String storepass) {
        try
  {
   System.out.print("Enter keystore password:");
   String pass = msgStream.readLine();
   super.setStorepass(pass);
   mIsPasswordSet = true;
  }
  catch (java.io.IOException ex)
  {
   ex.printStackTrace();
  }//catch
    }//setStorepass

  public void execute()
  throws BuildException
  {
  if (!mIsPasswordSet)
  {
      throw new BuildException("Store password was not set properly. check
for errors");
  }//end if
  super.execute();
  mIsPasswordSet = false;
  }
}.



----- Original Message -----
From: "Filip Hanik" <filip@filip.net>
To: <ant-user@jakarta.apache.org>
Sent: Wednesday, January 10, 2001 2:26 PM
Subject: interactive - done or should I write my own


> is there a task that asks the user to type in a value and assign that to a
> property?
> like a password for example.
> we don't want our buildscripts to contain the password for our keystore
when
> using the jarsigner
>
> thanks
> Filip
>
> Filip Hanik
> Technical Architect
> Pakana Corporation
> fhanik@pakana.com
> 415-371 9200 ext 3529
>
> "Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
system
> written for a 4 bit processor by a 2 bit company which can not stand 1 bit
> of competition."


Mime
View raw message