KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > taskdefs > optional > vss > MSVSSCHECKIN


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */

18
19 package org.apache.tools.ant.taskdefs.optional.vss;
20
21 import org.apache.tools.ant.BuildException;
22 import org.apache.tools.ant.types.Commandline;
23 import org.apache.tools.ant.types.Path;
24
25 /**
26  * Performs CheckIn commands to Microsoft Visual SourceSafe.
27  *
28  * @ant.task name="vsscheckin" category="scm"
29  */

30 public class MSVSSCHECKIN extends MSVSS {
31
32     /**
33      * Builds a command line to execute ss.
34      * @return The constructed commandline.
35      */

36     protected Commandline buildCmdLine() {
37         Commandline commandLine = new Commandline();
38
39         // first off, make sure that we've got a command and a vssdir ...
40
if (getVsspath() == null) {
41             String JavaDoc msg = "vsspath attribute must be set!";
42             throw new BuildException(msg, getLocation());
43         }
44
45         // build the command line from what we got the format is
46
// ss Checkin VSS items [-H] [-C] [-I-] [-N] [-O] [-R] [-W] [-Y] [-?]
47
// as specified in the SS.EXE help
48
commandLine.setExecutable(getSSCommand());
49         commandLine.createArgument().setValue(COMMAND_CHECKIN);
50
51         // VSS items
52
commandLine.createArgument().setValue(getVsspath());
53         // -GL
54
commandLine.createArgument().setValue(getLocalpath());
55         // -I- or -I-Y or -I-N
56
commandLine.createArgument().setValue(getAutoresponse());
57         // -R
58
commandLine.createArgument().setValue(getRecursive());
59         // -W
60
commandLine.createArgument().setValue(getWritable());
61         // -Y
62
commandLine.createArgument().setValue(getLogin());
63         // -C
64
commandLine.createArgument().setValue(getComment());
65
66         return commandLine;
67     }
68
69     /**
70      * Override the project working directory.
71      *
72      * @param localPath The path on disk.
73      */

74     public void setLocalpath(Path localPath) {
75         super.setInternalLocalPath(localPath.toString());
76     }
77
78     /**
79      * Check-in files recursively. Defaults to false.
80      *
81      * @param recursive The boolean value for recursive.
82      */

83     public void setRecursive(boolean recursive) {
84         super.setInternalRecursive(recursive);
85     }
86
87     /**
88      * Unset the READ-ONLY flag on local copies of files checked-in to VSS.
89      * Defaults to false.
90      *
91      * @param writable The boolean value for writable.
92      */

93     public final void setWritable(boolean writable) {
94         super.setInternalWritable(writable);
95     }
96
97     /**
98      * Autoresponce behaviour. Valid options are Y and N.
99      *
100      * @param response The auto response value.
101      */

102     public void setAutoresponse(String JavaDoc response) {
103         super.setInternalAutoResponse(response);
104     }
105
106     /**
107      * Comment to apply to files checked-in to SourceSafe.
108      *
109      * @param comment The comment to apply in SourceSafe
110      */

111     public void setComment(String JavaDoc comment) {
112         super.setInternalComment(comment);
113     }
114 }
115
Popular Tags