Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1974 jgill 1
package com.erggroup.mass.ant.taskdefs;
2
 
3
import com.erggroup.mass.ant.Utils;
4
import net.sourceforge.clearcase.api.IClearcase;
5
import net.sourceforge.clearcase.simple.ClearcaseCLI;
6
import org.apache.tools.ant.BuildException;
7
import org.apache.tools.ant.Project;
8
 
9
/**
10
 *
11
 */
12
public class CCRemoveLabel extends org.apache.tools.ant.Task
13
{
14
	/**
15
	 * The label name to remove
16
	 */
17
	private String labelname;
18
 
19
	public void setLabelname( String value )
20
	{
21
		this.labelname = value;
22
	}
23
 
24
	public void execute() throws BuildException
25
	{
26
		IClearcase clearcase = new ClearcaseCLI();
27
		Utils.setWorkingDirectory(clearcase,project);
28
 
29
		IClearcase.Status rmlabel = clearcase.cleartool( "rmtype -rmall -force lbtype:" + labelname);
30
		if ( ! rmlabel.status )
31
		{
32
			project.log(rmlabel.message, Project.MSG_ERR );
33
			throw new BuildException("Could not remove label \'" + labelname + "\'.");
34
		}
35
 
36
		project.log("Successfully removed label '" + labelname + ".", Project.MSG_INFO );
37
	}
38
}