Handle per configuration package references when genning projects.

This commit is contained in:
David Fowler 2014-01-25 23:25:52 -08:00
parent 77b1c3fe3b
commit d3ca896dd0
1 changed files with 10 additions and 2 deletions

View File

@ -185,6 +185,8 @@ functions
foreach (var pair in configs)
{
var allPackageReferences = new Dictionary<string, string>(packageReferences);
var targetFramework = pair.Key;
var props = (IDictionary<string, object>)pair.Value;
@ -197,10 +199,16 @@ functions
{
if (!projectMapping.ContainsKey(dep.Key))
{
if(String.IsNullOrEmpty((string)dep.Value))
var version = (string)dep.Value;
if(String.IsNullOrEmpty(version))
{
gacReferences.Add(dep.Key);
}
else
{
allPackageReferences[dep.Key] = version;
}
}
else
{
@ -215,7 +223,7 @@ functions
.Replace("{ExtraProperties}", extraProperties)
.Replace("{Files}", filesString)
.Replace("{ProjectReferences}", BuildProjectReferences(projectReferences, targetFramework, projectMapping))
.Replace("{References}", BuildReferences(packageReferences, gacReferences, packagesDir, targetFramework, GetCandidates(targetFramework)));
.Replace("{References}", BuildReferences(allPackageReferences, gacReferences, packagesDir, targetFramework, GetCandidates(targetFramework)));
if (targetFramework.StartsWith("k"))
{