| java.lang.Object org.netbeans.api.project.ant.AntArtifact
All known Subclasses: org.netbeans.spi.project.support.ant.SimpleAntArtifact,
AntArtifact | abstract public class AntArtifact (Code) | | Represents one artifact of an Ant build.
For example, if a build script is known to generate a JAR of a certain name
as a result of running a certain target, this object will name that JAR
and point to the script and target responsible for creating it. You can use
this information to add an <ant> task to another project
which will generate that JAR as a dependency before using it.
See Also: org.netbeans.spi.project.support.ant.SimpleAntArtifact author: Jesse Glick |
Constructor Summary | |
protected | AntArtifact() Empty constructor for use from subclasses. |
Method Summary | |
final public FileObject | getArtifactFile() Convenience method to find the actual artifact, if it currently exists. | final public FileObject[] | getArtifactFiles() Convenience method to find the actual artifacts, if they currently exist.
Uses
AntArtifact.getScriptFile or
AntArtifact.getScriptLocation and resolves
AntArtifact.getArtifactLocations from it.
Note that a project which has been cleaned more recently than it has been built
will generally not have the build artifacts on disk and so this call may easily
return empty array. | public URI | getArtifactLocation() Get the location of the build artifact relative to the Ant script. | public URI[] | getArtifactLocations() Get the locations of the build artifacts relative to the Ant script.
For example, dist/mylib.jar. | abstract public String | getCleanTargetName() Get the name of an Ant target that will delete this artifact. | public String | getID() Returns identifier of the AntArtifact which must be unique within
one project. | public Project | getProject() Find the project associated with this script, if any. | public Properties | getProperties() Optional properties which are used for Ant target execution. | final public FileObject | getScriptFile() Convenience method to find the actual script file, if it currently exists. | abstract public File | getScriptLocation() Get a location for the Ant script that is able to produce this artifact. | abstract public String | getTargetName() Get the name of the Ant target that is able to produce this artifact.
E.g. | abstract public String | getType() Get the type of the build artifact.
This can refer to both the physical content type or format;
and to the intended category of usage.
Typically a given client (e.g. |
AntArtifact | protected AntArtifact()(Code) | | Empty constructor for use from subclasses.
|
getArtifactFiles | final public FileObject[] getArtifactFiles()(Code) | | Convenience method to find the actual artifacts, if they currently exist.
Uses
AntArtifact.getScriptFile or
AntArtifact.getScriptLocation and resolves
AntArtifact.getArtifactLocations from it.
Note that a project which has been cleaned more recently than it has been built
will generally not have the build artifacts on disk and so this call may easily
return empty array. If you do not rely on the actual presence of the file but just need to
refer to it abstractly, use
AntArtifact.getArtifactLocations instead.
the artifact files which exist on disk, or empty array if none could be found since: 1.5 |
getArtifactLocations | public URI[] getArtifactLocations()(Code) | | Get the locations of the build artifacts relative to the Ant script.
For example, dist/mylib.jar. The method is not defined
as abstract only for backward compatibility reasons. It must be
overridden. The order is important and should stay the same
unless the artifact was changed.
an array of URIs to the build artifacts, resolved relative to AntArtifact.getScriptLocation;may be either relative, or an absolute file -protocol URI since: 1.5 |
getCleanTargetName | abstract public String getCleanTargetName()(Code) | | Get the name of an Ant target that will delete this artifact.
Typically this should be clean.
The target may delete other build products as well.
an Ant target name |
getID | public String getID()(Code) | | Returns identifier of the AntArtifact which must be unique within
one project. By default it is target name which produces the
artifact, but if your target produces more that one artifact then
you must override this method and uniquely identify each artifact.
|
getProject | public Project getProject()(Code) | | Find the project associated with this script, if any.
The default implementation uses
AntArtifact.getScriptLocation and
FileOwnerQuery ,
but subclasses may override that to return something else.
the associated project, or null if there is none or it could not be located |
getProperties | public Properties getProperties()(Code) | | Optional properties which are used for Ant target execution. Only
properties necessary for customization of Ant target execution should
be used. These properties are stored in project.xml of project using
this artifact so care should be taken in defining what properties
are used, e.g. never use absolute path like values
since: 1.5 |
getScriptFile | final public FileObject getScriptFile()(Code) | | Convenience method to find the actual script file, if it currently exists.
Uses
AntArtifact.getScriptLocation .
The script must exist on disk (Ant cannot run scripts from NetBeans
filesystems unless they are represented on disk).
the Ant build script file, or null if it could not be found |
getScriptLocation | abstract public File getScriptLocation()(Code) | | Get a location for the Ant script that is able to produce this artifact.
The name build.xml is conventional.
the location of an Ant project file (might not currently exist) |
getTargetName | abstract public String getTargetName()(Code) | | Get the name of the Ant target that is able to produce this artifact.
E.g. jar would be conventional for JAR artifacts.
an Ant target name |
getType | abstract public String getType()(Code) | | Get the type of the build artifact.
This can refer to both the physical content type or format;
and to the intended category of usage.
Typically a given client (e.g. superproject) will be interested
in only a certain artifact type for a certain purpose, e.g.
inclusion in a Java classpath.
Particular type identifiers should be agreed upon between
providers and clients.
For example, JavaProjectConstants.ARTIFACT_TYPE_JAR
is defined for JAR outputs.
Others may be defined as needed; for example, tag library JARs,
WARs, EJB JARs, deployment descriptor fragments, etc.
XXX format - NMTOKEN maybe
the type (format or usage) of the build artifact |
|
|