<target name="hello.jar" depends="rmics" >
<classdepandjar jarfile="${lib}/hello.jar" files="true"
manifest="${src}/org/jini/project/example/jade/serviceimpl/example/hello.mf" >
<classpath refid="project.path" />
<in name="net.jini" />
<in name="org.jini" />
<in name="com.sun.jini" />
<topclass name="org.jini.project.example.jade.serviceimpl.example.StartHelloService" />
<topclass name="org.jini.project.example.jade.serviceimpl.example.HelloImpl_Stub" />
<topclass name="net.jini.lookup.JoinManager" />
</classdepandjar>
</target>
<target name="hello-dl.jar" depends="rmics" >
<classdepandjar jarfile="${lib}/hello-dl.jar" files="true" >
<classpath refid="project.path" />
<in name="net.jini" />
<in name="org.jini" />
<in name="com.sun.jini" />
<topclass name="org.jini.project.example.jade.service.example.Hello" />
<topclass name="org.jini.project.example.jade.serviceimpl.example.HelloImpl_Stub" />
<topclass name="net.jini.lookup.entry.Name" />
<topclass name="net.jini.lookup.entry.ServiceInfo" />
<topclass name="net.jini.lookup.entry.UIDescriptor" />
<fileset dir="${src}"
includes="org/jini/project/example/jade/action/example/hello*.gif" />
<fileset dir="${classes}"
includes="org/jini/project/example/jade/action/example/*Hello*.class" />
</classdepandjar>
</target>
Acknowledgements:
Steven Harris wrote the class that does all the work: ClassDepJarFactory.
His code utilizes some Jar support classes developed by Jimmy Torres.
Jim Clarke wrote a ClassDepTask that served as a guide for writing this Ant
Task. The author has used his ClassDepTask.
- Version:
- 1.0
- Author:
- Peter C. Marks (Assembler)
|
Inner Class Summary |
protected class |
ClassDepAndJarTask.Argument
A class to handle the name attribute of child elements:
"name = value" and
"name = value1 <delimiter> value2 <delimiter> ... |
| Fields inherited from class org.apache.tools.ant.Task |
description, location, project, target, taskName, taskType, wrapper |
| Methods inherited from class org.apache.tools.ant.Task |
getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassDepAndJarTask
public ClassDepAndJarTask()
- Creates a new
ClassDepAndJarTask
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path classpath)
- Set the classpath to be used for this compilation
- Parameters:
classpath - The classpath to store.
createClasspath
public org.apache.tools.ant.types.Path createClasspath()
- Maybe create a nested classpath element
- Returns:
- The classpath
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference ref)
- Adds a reference to a classpath defined elsewhere.
- Parameters:
ref - An Ant reference to a path
getClasspath
protected org.apache.tools.ant.types.Path getClasspath()
- Getter for classpath.
- Returns:
- The stored classpath
setEdges
public void setEdges(boolean edges)
- Set the edges attribute
- Parameters:
edges - classes outside of namespaces
isEdges
public boolean isEdges()
- Getter for edges.
- Returns:
- if edges has been specified
setFiles
public void setFiles(boolean files)
- Set the files attribute
- Parameters:
files - true or false
isFiles
public boolean isFiles()
- Getter for files
- Returns:
- true or false
createHide
public ClassDepAndJarTask.Argument createHide()
- Creator for hide element.
setHide
public void setHide(java.lang.String arg)
- Set the hide element
createIn
public ClassDepAndJarTask.Argument createIn()
- Creator for in element.
setIn
public void setIn(java.lang.String arg)
- Set the in element.
setJarfile
public void setJarfile(java.io.File jarfile)
- Set the jarfile attribute
getJarfile
public java.io.File getJarfile()
- Getter for the jarfile attribute
setManifest
public void setManifest(java.io.File manifestFile)
- Set the manifest attribute
getManifest
public java.util.jar.Manifest getManifest()
- Getter for the manifest attribute
createOut
public ClassDepAndJarTask.Argument createOut()
- Creator for out element.
setOut
public void setOut(java.lang.String arg)
- Set the out element.
setOuter
public void setOuter(boolean outer)
- Set the outer attribute
isOuter
public boolean isOuter()
- Getter for outer.
createPrune
public ClassDepAndJarTask.Argument createPrune()
- Creator for prune element.
setPrune
public void setPrune(java.lang.String arg)
- Set the prune element.
createShow
public ClassDepAndJarTask.Argument createShow()
- Creator for show element.
setShow
public void setShow(java.lang.String arg)
- Set the show element.
createSkip
public ClassDepAndJarTask.Argument createSkip()
- Creator for skip element.
setSkip
public void setSkip(java.lang.String arg)
- Set the skip element.
createTell
public ClassDepAndJarTask.Argument createTell()
- Creator for tell element.
setTell
public void setTell(java.lang.String arg)
- Set the tell element.
createTopclass
public ClassDepAndJarTask.Argument createTopclass()
- Creator for topclass element.
setTopclass
public void setTopclass(java.lang.String arg)
- Set the topclass element.
- Parameters:
arg - Name of a class
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet fs)
- Append another fileset
- Parameters:
fs - Additional fileset
getClassDepArgs
protected java.lang.String[] getClassDepArgs()
- Transform all the Ant task attributes and elements into an
array of Strings that we can feed to
ClassDep
- Returns:
- Ant attributes in array format
isDebug
public boolean isDebug()
- Getter for debug attribute
- Returns:
- To debug or not to debug
setDebug
public void setDebug(boolean debug)
- Setter for debug attribute
- Parameters:
debug - true or false
getDescription
public java.lang.String getDescription()
- Return a text description of this Task.
- Overrides:
getDescription in class org.apache.tools.ant.Task
- Returns:
- Description of this Task.
execute
public void execute()
throws org.apache.tools.ant.BuildException
- Ant calls this execute() method to have the task do its thing.
Gather arguments given to us by Ant and have a
ClassDepJarFileFactory
run ClassDep and then create a jar file. Finally, add any
files specified via fileset elements.
- Overrides:
execute in class org.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException - Thrown when an error occurs within the task.
Copyright (c) 2001 Sun MicroSystems Inc. All Rights Reserved.