I'd recommend against comparing only filenames. This will likely end up causing trouble down the line. VS.NET is certainly a mess when it comes to hint paths, but I've found that they are generally accurate. I don't even think it uses them half of the time. :)

Can you describe your situation with more detail (perhaps some examples) so I can see what is happening?.

Martin Aliger wrote:

Last one - and I'm not sure there.

There are problems with references between projects when projects have different output paths. Project references are ok, but external refenreces sometimes brokes. Currently nant compares files as full pathnames using path from HintPath attribute. I suggest to compare filenames as names only without path. Could this be a problem? It works for me, but... Btw: Visual studio is real mess in this. Hope nant could be better! :)

I send patch I made, but consider this as suggestion, not real patch

Thanks!
Martin

----------> Created by Email.cz http://www.email.cz <---------- Get Your Free Email



----------> Created by Email.cz http://www.email.cz <---------- Get Your Free Email



------------------------------------------------------------------------

--- E:\src\nant\distrib\NAnt.VSNet\Solution.cs  Fri Jul 25 10:07:28 2003
+++ E:\src\nant\src\NAnt.VSNet\Solution.cs      Tue Aug 19 18:41:12 2003
@@ -181,11 +180,11 @@
            foreach ( DictionaryEntry de in _htProjects ) {
                string strGUID = ( string )de.Key;
                Project p = ( Project )de.Value;
-
+/* ??without path??
                foreach ( string strConfiguration in p.Configurations ) {
-                    //Console.WriteLine( "{0} [{1}] -> {2}", p.Name, 
strConfiguration, p.GetConfigurationSettings( strConfiguration ).FullOutputFile.ToLower() );
-                    _htOutputFiles[ p.GetConfigurationSettings( strConfiguration 
).FullOutputFile.ToLower() ] = strGUID;
-                }
+                    _htOutputFiles[ GetConfigurationSettings( strConfiguration 
).FullOutputFile .ToLower() ] = strGUID;
+                } */
+                    _htOutputFiles[ p.ProjectSettings.OutputFile.ToLower() ] = 
strGUID;
            }

            // Then build the dependency list
@@ -196,8 +195,12 @@
                foreach ( Reference r in p.References ) {
                    if ( r.IsProjectReference )
                        AddProjectDependency( strGUID, r.ProjectReferenceGUID );
-                    else if ( _htOutputFiles.Contains( r.Filename.ToLower() ) )
-                        AddProjectDependency( strGUID, ( string )_htOutputFiles[ 
r.Filename.ToLower() ] );
+                    else
+                   {
+                           string refName = Path.GetFileName(r.Filename).ToLower(); 
/* ??without path?? r.Filename.ToLower()*/
+                           if ( _htOutputFiles.Contains( refName ) )
+                           AddProjectDependency( strGUID, ( string )_htOutputFiles[ 
refName ] );
+                   }
                }
            }
        }
@@ -231,24 +234,29 @@

if ( !bFailed ) {
// Fixup references
- //Console.WriteLine( "Fixing up references..." );
+ //_nanttask.Log(Level.Info, _nanttask.LogPrefix + "Fixing up references..." );
foreach ( Reference r in p.References ) {
- //Console.WriteLine( "Original: {0}", r.Filename );
if ( r.IsProjectReference ) {
+ // Console.WriteLine( "Original: project {0} {1}", r.Filename,r.ProjectReferenceGUID );
Project pRef = ( Project )_htProjects[ r.ProjectReferenceGUID ];
if ( pRef == null )
throw new Exception( "Unable to locate referenced project while loading " + p.Name );
if ( pRef.GetConfigurationSettings( strConfiguration ) == null )
- throw new Exception( "Unable to find appropriate configuration for project reference" );
+ throw new Exception( String.Format( "Unable to find appropriate configuration ({0}) for project reference {1}", strConfiguration, GetProjectFileFromGUID(pRef.GUID) ));
if ( pRef != null )
r.Filename = pRef.GetConfigurationSettings( strConfiguration ).FullOutputFile.ToLower();
} - else if ( _htOutputFiles.Contains( r.Filename.ToLower() ) ) {
- Project pRef = ( Project )_htProjects[ ( string )_htOutputFiles[ r.Filename.ToLower() ] ];
- if ( pRef != null && pRef.GetConfigurationSettings( strConfiguration ) != null )
- r.Filename = pRef.GetConfigurationSettings( strConfiguration ).FullOutputFile.ToLower();
- }
- + else
+ {
+ //Console.WriteLine( "Original: external {0}", r.Filename );
+ string refName = Path.GetFileName(r.Filename).ToLower(); /* ??without path?? r.Filename.ToLower()*/
+ if ( _htOutputFiles.Contains( refName ) )
+ {
+ Project pRef = ( Project )_htProjects[ ( string )_htOutputFiles[ refName ] ];
+ if ( pRef != null && pRef.GetConfigurationSettings( strConfiguration ) != null )
+ r.Filename = pRef.GetConfigurationSettings( strConfiguration ).FullOutputFile.ToLower();
+ }
+ } //Console.WriteLine( " Now: {0}", r.Filename );
}
}






-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to