Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

package com.erggroup.mass.ant.taskdefs;

import net.sourceforge.clearcase.api.IClearcase;
import net.sourceforge.clearcase.simple.ClearcaseCLI;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;

/**
 *
 */
public class CCLockLabel extends org.apache.tools.ant.Task
{
        /**
         * The view name to remove
         */
        private String labelname;

        public void setLabelname( String value )
        {
                this.labelname = value;
        }

        public void execute() throws BuildException
        {
                IClearcase clearcase = new ClearcaseCLI();
                IClearcase.Status lock = clearcase.cleartool( "lock lbtype:" + labelname);
                if ( ! lock.status )
                {
                        project.log(lock.message,Project.MSG_ERR);
                        throw new BuildException("Could not lock label \'" + labelname + "\'.");
                }
                project.log("Successfully locked label '" + labelname + "'.",Project.MSG_INFO);
        }
}