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 net.sourceforge.clearcase.api.IClearcase;
4
import net.sourceforge.clearcase.simple.ClearcaseCLI;
5
import org.apache.tools.ant.BuildException;
6
import org.apache.tools.ant.Project;
7
 
8
/**
9
 *
10
 */
11
public class CCLockLabel extends org.apache.tools.ant.Task
12
{
13
	/**
14
	 * The view name to remove
15
	 */
16
	private String labelname;
17
 
18
	public void setLabelname( String value )
19
	{
20
		this.labelname = value;
21
	}
22
 
23
	public void execute() throws BuildException
24
	{
25
		IClearcase clearcase = new ClearcaseCLI();
26
		IClearcase.Status lock = clearcase.cleartool( "lock lbtype:" + labelname);
27
		if ( ! lock.status )
28
		{
29
			project.log(lock.message,Project.MSG_ERR);
30
			throw new BuildException("Could not lock label \'" + labelname + "\'.");
31
		}
32
		project.log("Successfully locked label '" + labelname + "'.",Project.MSG_INFO);
33
	}
34
}