StarTeamLabelpublic class StarTeamLabel extends StarTeamTask Creates a view label in StarTeam at the specified view.
Ant Usage:
<taskdef name="stlabel"
classname="org.apache.tools.ant.taskdefs.optional.starteam.StarTeamLabel"/<
<stlabel
label="1.0" lastbuild="20011514100000" description="Successful Build"
username="BuildMaster" password="ant"
starteamurl="server:port/project/view"/>
|
Fields Summary |
---|
private String | labelNameThe name of the label to be set in Starteam. | private String | descriptionThe label description to be set in Starteam. | private boolean | buildlabelIf true, this will be a build label. If false, it will be a non-build
label. The default is false. Has no effect if revision label is
true. | private boolean | revisionlabelIf true, this will be a revision label. If false, it will be a build
label. The default is false. | private com.starbase.util.OLEDate | lastBuildThe time of the last successful. The new label will be a snapshot of the
repository at this time. String should be formatted as "yyyyMMddHHmmss" | private static final SimpleDateFormat | DATE_FORMAT |
Methods Summary |
---|
protected com.starbase.starteam.View | createSnapshotView(com.starbase.starteam.View raw)Override of base-class abstract function creates an
appropriately configured view. For labels this a view
configured as of this.lastBuild.
/*
if (this.revisionlabel) {
return raw;
}
return new View(raw, ViewConfiguration.createFromTime(this.lastBuild));
*/
return raw;
| public void | execute()This method does the work of creating the new view and checking it into
Starteam.
if (this.revisionlabel && this.buildlabel) {
throw new BuildException("'revisionlabel' and 'buildlabel' "
+ "both specified. A revision label cannot be a build label.");
}
try {
View snapshot = openView();
// Create the new label and update the repository
if (this.revisionlabel) {
new Label(snapshot, this.labelName, this.description).update();
log("Created Revision Label " + this.labelName);
} else if (null != lastBuild) {
new Label(snapshot, this.labelName, this.description, this.lastBuild,
this.buildlabel).update();
log("Created View Label ("
+ (this.buildlabel ? "" : "non-") + "build) " + this.labelName
+ " as of " + this.lastBuild.toString());
} else {
new Label(snapshot, this.labelName, this.description,
this.buildlabel).update();
log("Created View Label ("
+ (this.buildlabel ? "" : "non-") + "build) " + this.labelName);
}
} catch (Exception e) {
throw new BuildException(e);
} finally {
disconnectFromServer();
}
| public void | setBuildLabel(boolean buildlabel)set the type of label based on the supplied value - if true, this
label will be a revision label, if false, a build label.
this.buildlabel = buildlabel;
| public void | setDescription(java.lang.String description)Description of the label to be stored in the StarTeam project.
this.description = description;
| public void | setLabel(java.lang.String label)The name to be given to the label; required.
this.labelName = label;
| public void | setLastBuild(java.lang.String lastbuild)The timestamp of the build that will be stored with the label; required.
Must be formatted yyyyMMddHHmmss
try {
Date lastBuildTime = DATE_FORMAT.parse(lastbuild);
this.lastBuild = new OLEDate(lastBuildTime);
} catch (ParseException e) {
throw new BuildException("Unable to parse the date '"
+ lastbuild + "'", e);
}
| public void | setRevisionLabel(boolean revisionlabel)set the type of label based on the supplied value - if true, this
label will be a revision label, if false, a build label.
this.revisionlabel = revisionlabel;
|
|