You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ja...@rzf.fin-nrw.de on 2004/04/30 06:57:43 UTC

RE: Is it possible to change System PATH variable through ant tas k ?

I only see these possiblities:
- add the cvs-dir to PATH
- modify the start script to do that
- do a quick hack:
  - subclass org.apache.tools.ant.taskdefs.Cvs
  - overwrite 
    protected void configureCommandline(Commandline c)
    (comes from org.apache.tools.ant.taskdefs.AbstractCvsTask)
  - modify the line AbstractCvsTask:737: 
        c.setExecutable("cvs"); 
    to an appropriate value.
  - taskdef this class in your buildfile
    mycvs=...
  - use <mycvs> instead of <cvs>

Jan
   

> -----Original Message-----
> From: sudip barat [mailto:sbarat@cisco.com]
> Sent: Friday, April 30, 2004 12:45 AM
> To: 'Ant Users List'
> Subject: Is it possible to change System PATH variable 
> through ant task
> ?
> 
> 
> I wanted to know if it is possible to update the System PATH 
> variable to
> include path of CVS.exe . I am writing a web based 
> application . The tomcat
> on the unix box does not have CVS in the  system path as a 
> result my <cvs>
> task fails . Is it possible for me to have the cvs.exe path 
> included in
> build.xml or is it possible to set the path in the
> org.apche.tools.ant.Project I am creating from my servlet to 
> execute the
> build.xml ?
> 
> Thx 
>  sb
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

RE: Is it possible to change System PATH variable through ant tas k ?

Posted by sudip barat <sb...@cisco.com>.
Thanks to Atsushi and Jan ,the suggestions worked good for me . :)


-----Original Message-----
From: Atsushi SUGAWARA [mailto:asugawar@f3.dion.ne.jp] 
Sent: Thursday, April 29, 2004 10:24 PM
To: Ant Users List
Subject: Re: Is it possible to change System PATH variable through ant tas k
?


Hi.
I created a small patch.

patch to AbstractCvsTask.java
---------------------------------------------------------------------
151a152,154
>     private static final String DEFAULT_EXECUTABLE = "cvs";
>     private String executable;
> 
449a453,465
>     public void setExecutable(String executable) {
>         if (executable != null) {
>             if (executable.trim().equals("")) {
>                 executable = null;
>             }
>         }
>         this.executable = executable;
>     }
> 
>     public String getExecutable() {
>         return this.executable;
>     }
> 
744c760,764
<         c.setExecutable("cvs");
---
>         if (executable == null) {
>             c.setExecutable(DEFAULT_EXECUTABLE);
>         } else {
>             c.setExecutable(executable);
>         }
---------------------------------------------------------------------

Now, you can use a attribute "executable" in <cvs> task.
like this:

  <cvs
    cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
    package="ant"
    command="checkout"
    executable="path/to/cvs"
  />

-- 
Atsushi SUGAWARA <as...@f3.dion.ne.jp>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Is it possible to change System PATH variable through ant tas k ?

Posted by Atsushi SUGAWARA <as...@f3.dion.ne.jp>.
Hi.
I created a small patch.

patch to AbstractCvsTask.java
---------------------------------------------------------------------
151a152,154
>     private static final String DEFAULT_EXECUTABLE = "cvs";
>     private String executable;
> 
449a453,465
>     public void setExecutable(String executable) {
>         if (executable != null) {
>             if (executable.trim().equals("")) {
>                 executable = null;
>             }
>         }
>         this.executable = executable;
>     }
> 
>     public String getExecutable() {
>         return this.executable;
>     }
> 
744c760,764
<         c.setExecutable("cvs");
---
>         if (executable == null) {
>             c.setExecutable(DEFAULT_EXECUTABLE);
>         } else {
>             c.setExecutable(executable);
>         }
---------------------------------------------------------------------

Now, you can use a attribute "executable" in <cvs> task.
like this:

  <cvs
    cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
    package="ant"
    command="checkout"
    executable="path/to/cvs"
  />

-- 
Atsushi SUGAWARA <as...@f3.dion.ne.jp>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org