Browse Source

Added attribute serverPath which lets the user specify the path to the srcsafe.ini.

Submitted by Barranger Ridler <barranger.ridler@screamingsolutions.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268884 13f79535-47bb-0310-9956-ffa450edef68
master
Nico Seessle 24 years ago
parent
commit
839c93f9e0
3 changed files with 37 additions and 0 deletions
  1. +5
    -0
      docs/manual/OptionalTasks/vssget.html
  2. +5
    -0
      docs/manual/OptionalTasks/vsslabel.html
  3. +27
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java

+ 5
- 0
docs/manual/OptionalTasks/vssget.html View File

@@ -65,6 +65,11 @@ label only one will be used in the order version, date, label.</p>
task expects it to be in the PATH.</td> task expects it to be in the PATH.</td>
<td>No</td> <td>No</td>
</tr> </tr>
<tr>
<td>serverPath</td>
<td>directory where <code>srssafe.ini</code> resides.</td>
<td>No</td>
</tr>
</table> </table>
<p>Note that only one of version, date or label should be specified</p> <p>Note that only one of version, date or label should be specified</p>
<h3>Examples</h3> <h3>Examples</h3>


+ 5
- 0
docs/manual/OptionalTasks/vsslabel.html View File

@@ -28,6 +28,11 @@ project.</p>
<td>SourceSafe path</td> <td>SourceSafe path</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
<tr>
<td>serverPath</td>
<td>directory where <code>srssafe.ini</code> resides.</td>
<td>No</td>
</tr>
<tr> <tr>
<td>ssdir</td> <td>ssdir</td>
<td>directory where <code>ss.exe</code> resides. By default the task <td>directory where <code>ss.exe</code> resides. By default the task


+ 27
- 0
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java View File

@@ -81,6 +81,7 @@ public abstract class MSVSS extends Task {
private String m_SSDir = ""; private String m_SSDir = "";
private String m_vssLogin = null; private String m_vssLogin = null;
private String m_vssPath = null; private String m_vssPath = null;
private String m_serverPath = null;


/** /**
* Set the directory where ss.exe is located * Set the directory where ss.exe is located
@@ -149,11 +150,37 @@ public abstract class MSVSS extends Task {
return m_vssPath; return m_vssPath;
} }


/**
* Set the path to the location of the ss.ini
*
* @param serverPath
*/
public final void setServerpath(String serverPath) {
m_serverPath = serverPath;
}

protected int run(Commandline cmd) { protected int run(Commandline cmd) {
try { try {
Execute exe = new Execute(new LogStreamHandler(this, Execute exe = new Execute(new LogStreamHandler(this,
Project.MSG_INFO, Project.MSG_INFO,
Project.MSG_WARN)); Project.MSG_WARN));

// If location of ss.ini is specified we need to set the
// environment-variable SSDIR to this value
if (m_serverPath != null) {
String[] env = exe.getEnvironment();
if( env == null ) {
env = new String[0];
}
String[] newEnv = new String[env.length+1];
for( int i=0;i<env.length;i++ ) {
newEnv[i] = env[i];
}
newEnv[env.length] = "SSDIR=" + m_serverPath;

exe.setEnvironment(newEnv);
}
exe.setAntRun(project); exe.setAntRun(project);
exe.setWorkingDirectory(project.getBaseDir()); exe.setWorkingDirectory(project.getBaseDir());
exe.setCommandline(cmd.getCommandline()); exe.setCommandline(cmd.getCommandline());


Loading…
Cancel
Save