[14982] | 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 |
|
---|
| 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 | import org.apache.tools.ant.types.Path;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * Performs CheckIn commands to Microsoft Visual SourceSafe.
|
---|
| 26 | *
|
---|
| 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 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 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 comment) {
|
---|
| 112 | super.setInternalComment(comment);
|
---|
| 113 | }
|
---|
| 114 | }
|
---|