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 | * Creates a new project in Microsoft Visual SourceSafe.
|
---|
25 | *
|
---|
26 | * @ant.task name="vsscreate" category="scm"
|
---|
27 | */
|
---|
28 | public class MSVSSCREATE extends MSVSS {
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Builds a command line to execute ss.
|
---|
32 | * @return The constructed commandline.
|
---|
33 | */
|
---|
34 | Commandline buildCmdLine() {
|
---|
35 | Commandline commandLine = new Commandline();
|
---|
36 |
|
---|
37 | // first off, make sure that we've got a command and a vssdir...
|
---|
38 | if (getVsspath() == null) {
|
---|
39 | String msg = "vsspath attribute must be set!";
|
---|
40 | throw new BuildException(msg, getLocation());
|
---|
41 | }
|
---|
42 |
|
---|
43 | // build the command line from what we got
|
---|
44 | // the format is:
|
---|
45 | // ss Create VSS items [-C] [-H] [-I-] [-N] [-O] [-S] [-Y] [-?]
|
---|
46 | // as specified in the SS.EXE help
|
---|
47 | commandLine.setExecutable(getSSCommand());
|
---|
48 | commandLine.createArgument().setValue(COMMAND_CREATE);
|
---|
49 |
|
---|
50 | // VSS items
|
---|
51 | commandLine.createArgument().setValue(getVsspath());
|
---|
52 | // -C
|
---|
53 | commandLine.createArgument().setValue(getComment());
|
---|
54 | // -I- or -I-Y or -I-N
|
---|
55 | commandLine.createArgument().setValue(getAutoresponse());
|
---|
56 | // -O-
|
---|
57 | commandLine.createArgument().setValue(getQuiet());
|
---|
58 | // -Y
|
---|
59 | commandLine.createArgument().setValue(getLogin());
|
---|
60 |
|
---|
61 | return commandLine;
|
---|
62 | }
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * Comment to apply to the project created in SourceSafe.
|
---|
66 | *
|
---|
67 | * @param comment The comment to apply in SourceSafe
|
---|
68 | */
|
---|
69 | public void setComment(String comment) {
|
---|
70 | super.setInternalComment(comment);
|
---|
71 | }
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Enable quiet mode. Defaults to false.
|
---|
75 | *
|
---|
76 | * @param quiet The boolean value for quiet.
|
---|
77 | */
|
---|
78 | public final void setQuiet (boolean quiet) {
|
---|
79 | super.setInternalQuiet(quiet);
|
---|
80 | }
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Autoresponce behaviour. Valid options are Y and N.
|
---|
84 | *
|
---|
85 | * @param response The auto response value.
|
---|
86 | */
|
---|
87 | public void setAutoresponse(String response) {
|
---|
88 | super.setInternalAutoResponse(response);
|
---|
89 | }
|
---|
90 | }
|
---|