-----Original Message-----
From: Blake Winton 
Sent: Monday, March 19, 2001 6:42 PM
To: '[EMAIL PROTECTED] '
Cc: '[EMAIL PROTECTED] '; Barranger Ridler
Subject: MSVSSGET Task in Ant.



Hi, I've found the vssget task in Ant to be phenomenally useful,
but...

My ss.ini is located on a different computer than the one I'm working on.
This is a problem, since the only way to tell SS.exe that you want to use a
different ss.ini is through an environment variable.  Since I have to use
different ss.ini's I don't want to set it globally.  So I hacked MSVSS.java
to add in support for a "serverpath" attribute that would point at the
ss.ini.  Thinking back on it, calling it "inipath" might have made more
sense, but c'est la vie.

The code changes are rather small.  They consist of adding:

    private String m_serverPath = null;

and:

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

and finally, in the run() method, after you create the Execute:

            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);

I'll also attach the file, so you can check for differences yourselves.

Thanks,
Blake.

Attachment: MSVSS.java
Description: Binary data

Reply via email to