source: other-projects/trunk/gs3-release-maker/apache-ant-1.6.5/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 5.0 KB
Line 
1/*
2 * Copyright 2001-2004 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18package org.apache.tools.ant.taskdefs.optional.vss;
19
20import org.apache.tools.ant.BuildException;
21import org.apache.tools.ant.types.Commandline;
22import org.apache.tools.ant.types.Path;
23
24/**
25 * Performs CheckOut commands to Microsoft Visual SourceSafe.
26 *
27 *
28 * @ant.task name="vsscheckout" category="scm"
29 * @ant.attribute.group name="vdl" description="Only one of version, date or label"
30 */
31public class MSVSSCHECKOUT extends MSVSS {
32
33 /**
34 * Builds a command line to execute ss.
35 * @return The constructed commandline.
36 */
37 protected Commandline buildCmdLine() {
38 Commandline commandLine = new Commandline();
39
40 // first off, make sure that we've got a command and a vssdir ...
41 if (getVsspath() == null) {
42 String msg = "vsspath attribute must be set!";
43 throw new BuildException(msg, getLocation());
44 }
45
46 // build the command line from what we got the format is
47 // ss Checkout VSS items [-G] [-C] [-H] [-I-] [-N] [-O] [-R] [-V] [-Y] [-?]
48 // as specified in the SS.EXE help
49 commandLine.setExecutable(getSSCommand());
50 commandLine.createArgument().setValue(COMMAND_CHECKOUT);
51
52 // VSS items
53 commandLine.createArgument().setValue(getVsspath());
54 // -GL
55 commandLine.createArgument().setValue(getLocalpath());
56 // -I- or -I-Y or -I-N
57 commandLine.createArgument().setValue(getAutoresponse());
58 // -R
59 commandLine.createArgument().setValue(getRecursive());
60 // -V
61 commandLine.createArgument().setValue(getVersionDateLabel());
62 // -Y
63 commandLine.createArgument().setValue(getLogin());
64 // -G
65 commandLine.createArgument().setValue(getFileTimeStamp());
66 // -GWS or -GWR
67 commandLine.createArgument().setValue(getWritableFiles());
68 // -G-
69 commandLine.createArgument().setValue(getGetLocalCopy());
70
71 return commandLine;
72 }
73
74 /**
75 * Override the project working directory.
76 *
77 * @param localPath The path on disk.
78 */
79 public void setLocalpath(Path localPath) {
80 super.setInternalLocalPath(localPath.toString());
81 }
82
83 /**
84 * Check-out files recursively. Defaults to false.
85 *
86 * @param recursive The boolean value for recursive.
87 */
88 public void setRecursive(boolean recursive) {
89 super.setInternalRecursive(recursive);
90 }
91
92 /**
93 * Version to check-out.
94 *
95 * @param version The version to check-out.
96 *
97 * @ant.attribute group="vdl"
98 */
99 public void setVersion(String version) {
100 super.setInternalVersion(version);
101 }
102
103 /**
104 * Date to check-out.
105 *
106 * @param date The date to check-out.
107 *
108 * @ant.attribute group="vdl"
109 */
110 public void setDate(String date) {
111 super.setInternalDate(date);
112 }
113
114 /**
115 * Label to check-out.
116 *
117 * @param label The label to check-out.
118 *
119 * @ant.attribute group="vdl"
120 */
121 public void setLabel(String label) {
122 super.setInternalLabel(label);
123 }
124
125 /**
126 * Autoresponce behaviour. Valid options are Y and N.
127 *
128 * @param response The auto response value.
129 */
130 public void setAutoresponse(String response) {
131 super.setInternalAutoResponse(response);
132 }
133
134 /**
135 * Date and time stamp given to the local copy. Defaults to <code>current</code>.
136 *
137 * @param timestamp The file time stamping behaviour.
138 */
139 public void setFileTimeStamp(CurrentModUpdated timestamp) {
140 super.setInternalFileTimeStamp(timestamp);
141 }
142
143 /**
144 * Action taken when local files are writable. Defaults to <code>fail</code>.
145 * <p>
146 * Due to ss.exe returning with an exit code of '100' for both errors and when
147 * a file has been skipped, <code>failonerror</code> is set to false when using
148 * the <code>skip</code> option.
149 * </p>
150 *
151 * @param files The writable files behaviour
152 */
153 public void setWritableFiles(WritableFiles files) {
154 super.setInternalWritableFiles(files);
155 }
156
157 /**
158 * Retrieve a local copy during a checkout. Defaults to true.
159 *
160 * @param get The get local copy behaviour
161 */
162 public void setGetLocalCopy(boolean get) {
163 super.setInternalGetLocalCopy(get);
164 }
165}
Note: See TracBrowser for help on using the repository browser.