ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31520] - Extending JAR-Task for SPI
Date Mon, 04 Oct 2004 20:46:42 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31520>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31520

Extending JAR-Task for SPI





------- Additional Comments From bernd@dutkowski.net  2004-10-04 20:46 -------
I had al look at the ANT 1.6.2 Sources and tis is my Idea:

package org.apache.tools.ant.taskdefs;

class Service
{
  private String type;
  private List providerList;

  setType(String type)...
  Provider createProvider()...
  //writing the File
  void write(ZipOutputStream zOut)
  {
     
  }
}

class Provider
{
 private String clazz;
 setClass(String clazz)...
}

class Jar ..
{
  private List serviceList = new LinkedList();

  ...

    protected void initZipOutputStream(ZipOutputStream zOut)
        throws IOException, BuildException {

        if (!skipWriting) {
            Manifest jarManifest = createManifest();
            writeManifest(zOut, jarManifest);
            writeService(zOut);//add this line
        }
    }

  public Service createService()
  {
    Service service = new Service();
    serviceList.add(service);
    return service;
  }

  private void writeService(ZipOutputStream zOut)
  {
     Iterator i = serviceList.iterator();
     while(i.hasNext())
     {
       ((Service) i.next()).write(zOut);
     }
  }
}

I will try to implement this.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message