1 | /*
|
---|
2 | * Copyright 2002-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 |
|
---|
18 | package org.apache.tools.ant.taskdefs.optional.vss;
|
---|
19 |
|
---|
20 | import org.apache.tools.ant.BuildException;
|
---|
21 | import org.apache.tools.ant.types.Commandline;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Performs CP (Change Project) commands to Microsoft Visual SourceSafe.
|
---|
25 | * <p>This task is typically used before a VssAdd in order to set the target project</p>
|
---|
26 | *
|
---|
27 | * @ant.task name="vsscp" category="scm"
|
---|
28 | */
|
---|
29 | public class MSVSSCP extends MSVSS {
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Builds a command line to execute ss.
|
---|
33 | * @return The constructed commandline.
|
---|
34 | */
|
---|
35 | protected Commandline buildCmdLine() {
|
---|
36 | Commandline commandLine = new Commandline();
|
---|
37 |
|
---|
38 | // first off, make sure that we've got a command and a vssdir ...
|
---|
39 | if (getVsspath() == null) {
|
---|
40 | String msg = "vsspath attribute must be set!";
|
---|
41 | throw new BuildException(msg, getLocation());
|
---|
42 | }
|
---|
43 |
|
---|
44 | // build the command line from what we got the format is
|
---|
45 | // ss CP VSS items [-H] [-I-] [-Y] [-?]
|
---|
46 | // as specified in the SS.EXE help
|
---|
47 | commandLine.setExecutable(getSSCommand());
|
---|
48 | commandLine.createArgument().setValue(COMMAND_CP);
|
---|
49 |
|
---|
50 | // VSS items
|
---|
51 | commandLine.createArgument().setValue(getVsspath());
|
---|
52 | // -I- or -I-Y or -I-N
|
---|
53 | commandLine.createArgument().setValue(getAutoresponse());
|
---|
54 | // -Y
|
---|
55 | commandLine.createArgument().setValue(getLogin());
|
---|
56 |
|
---|
57 | return commandLine;
|
---|
58 | }
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Autoresponce behaviour. Valid options are Y and N.
|
---|
62 | *
|
---|
63 | * @param response The auto response value.
|
---|
64 | */
|
---|
65 | public void setAutoresponse(String response) {
|
---|
66 | super.setInternalAutoResponse(response);
|
---|
67 | }
|
---|
68 | }
|
---|