Harmon,

Expansion of environment variables in path should not be part done in
FileUtils, as this is not something that should to be done for all paths.

The modifications should be limited to the <solution> task's support for C++
(meaning src\NAnt.VSNet\Vc*.cs).

Can you also make that patch against NAnt cvs (or a recent nightly build),
and also create a small repro for this issue ?

Gert

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Harmon Nine
> Sent: donderdag 13 april 2006 18:33
> To: nant-developers@lists.sourceforge.net
> Subject: [nant-dev] $(ENV_VAR) references in project-file 
> RelativePath attribute
> 
> Hello all.
> 
>  
> 
> I'm currently trying to use NAnt as an automated build tool 
> for a project here at Vanderbilt.  The code is in C++ and is 
> modified through Visual Studio 7.1.
> 
>  
> 
> We are using the NAnt <solution> task in the NAnt build file. 
>  A problem occurs using the NAnt <solution> task under the 
> following circumstances:
> 
>  
> 
> Some of the source files (e.g. *.cpp files) in the project 
> are not within the project directory structure.  Rather, they 
> are part of a separate package that must already be installed 
> in order to perform the project build.  The location of the 
> package is indicated by an environment variable called 
> "PKG_ROOT", which is set to "C:\Path_To_Package".
> 
>  
> 
> To include a source file from the this package in the 
> project, i.e. so that it will be compiled as part of the 
> project, the file's "Relative Path", as set in the file 
> "properties" window of VS, is 
> "$(PKG_ROOT)\path_to_file_from_PKG_ROOT".  In the .vcproj 
> file, this value shows up in the "RelativePath" attribute of 
> a "File" element.
> 
>  
> 
> Note the syntax of the environment variable reference, i.e. 
> $(ENV_VAR).  This syntax is used elsewhere in VS, e.g. in the 
> Tools->Options->Projects->Directories window for specifying 
> various pertinent directories (e.g. include directories).
> 
>  
> 
> Unfortunately, when this RelativePath is expanded by NAnt, it 
> becomes 
> "C:\Build_Directory\$(PKG_ROOT)\path_to_file_from_PKG_ROOT", 
> which (obviously) causes the build to fail.
> 
>  
> 
>  
> 
> The build in VS works fine, leading me to believe that VS:
> 
>  
> 
> 1. Expands environment variable references ( like $(ENV_VAR) 
> ) in the "RelativePath" attribute before it uses this attribute.
> 
> 2. When VS notices that the value of the "RelativePath" 
> attribute is actually an absolute path (e.g. it starts with 
> C:\), it does not prepend the project directory path onto it.
> 
>  
> 
>  
> 
> I made a modification to the NAnt code to implement this 
> functionality.  The "diff" file is included as an attachment. 
>  There may be a better means of implementing this, but 
> regardless, it would be nice to have this functionality in 
> the final 0.85 release.
> 
>  
> 
> Thanks.
> 
> -- Harmon
> 
> 



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to