Bugs item #1534864, was opened at 2006-08-05 02:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1534864&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tasks
Group: 0.85
Status: Open
Resolution: None
Priority: 5
Submitted By: asherf (asherfoa)
Assigned to: Nobody/Anonymous (nobody)
Summary: Solution task doesn’t handle project dependencies properly

Initial Comment:
Solution task doesn’t handle project dependencies
properly when working with enterprise templates (etp).
 When a solution files points to a ETP project and the
project section contains dependencies they are not
handles properly by the solution task.
I am working with the latest nightly build (2006-07-23)

The bug is in NAnt.VSNet\Everett\Solution.cs:

     // set-up project dependencies
                Regex reDependencies = new
Regex(@"^\s+(?<guid>\{[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}\})\s+=\s+(?<dep>\{[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}\})",
RegexOptions.Multiline);
                MatchCollection dependencyMatches =
reDependencies.Matches(projectMatch.Value);

                foreach (Match dependencyMatch in
dependencyMatches) {
                    string dependency =
dependencyMatch.Groups["dep"].Value;

                    if
(!explicitProjectDependencies.ContainsKey(guid)) {
                       
explicitProjectDependencies[guid] =
CollectionsUtil.CreateCaseInsensitiveHashtable();
                    }
                    ((Hashtable)
explicitProjectDependencies[guid])[dependency] = null;
                }


As you can see the code doesn’t actually extracts the
GUID from the string (using regex). The guid variable
in the loop contains the guid from the outer scope,
which is the guid of the ETP project. 

Fixed code:
                Regex reDependencies = new
Regex(@"^\s+(?<guid>\{[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}\})\s+=\s+(?<dep>\{[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}\})",
RegexOptions.Multiline);
                MatchCollection dependencyMatches =
reDependencies.Matches(projectMatch.Value);

                foreach (Match dependencyMatch in
dependencyMatches) {
                    string dependency =
dependencyMatch.Groups["dep"].Value;
                string projGuide = dependencyMatch.Groups["guid"].Value;

                    if
(!explicitProjectDependencies.ContainsKey(projGuide)) {
                       
explicitProjectDependencies[projGuide] =
CollectionsUtil.CreateCaseInsensitiveHashtable();
                    }
                    ((Hashtable)
explicitProjectDependencies[projGuide])[dependency] = null;
                }

That’s all.



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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1534864&group_id=31650

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to