Skip to content

Commit

Permalink
Remove the content folder restriction
Browse files Browse the repository at this point in the history
When using the core, this bug is killer and doesn't mean anything once
you get outside of NuGet.
  • Loading branch information
ferventcoder committed Jan 20, 2016
1 parent 740a034 commit 8acde68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
22 changes: 12 additions & 10 deletions src/Core/PackageWalker/PackageWalker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,24 +200,26 @@ private void ProcessPackageTarget(IPackage package)

Debug.Assert(parentInfo != null);


if (parentInfo.InitialTarget == PackageTargets.None)
{
// Update the parent target type
parentInfo.Target |= info.Target;

// If we ended up with both that means we found a dependency only packages
// that has a mix of solution and project level packages
if (parentInfo.Target == PackageTargets.All)
{
throw new InvalidOperationException(NuGetResources.DependencyOnlyCannotMixDependencies);
}
}

// Solution packages can't depend on project level packages
if (parentInfo.Target == PackageTargets.External && info.Target.HasFlag(PackageTargets.Project))
{
throw new InvalidOperationException(NuGetResources.ExternalPackagesCannotDependOnProjectLevelPackages);
//if (parentInfo.Target == PackageTargets.All)
//{
// throw new InvalidOperationException(NuGetResources.DependencyOnlyCannotMixDependencies);
//}
}
// Choco doesn't care about this at all

//// Solution packages can't depend on project level packages
//if (parentInfo.Target == PackageTargets.External && info.Target.HasFlag(PackageTargets.Project))
//{
// throw new InvalidOperationException(NuGetResources.ExternalPackagesCannotDependOnProjectLevelPackages);
//}
}
}

Expand Down
5 changes: 3 additions & 2 deletions test/Core.Test/PackageWalkerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ public void AfterPackageWalkSatellitePackageIsClassifiedTheSameAsDependencies()
Assert.Equal(PackageTargets.Project, walker.GetPackageInfo(satellitePackage).Target);
}

[Fact]
//[Fact]
public void MetaPackageWithMixedTargetsThrows()
{
// Arrange
Expand All @@ -1078,7 +1078,8 @@ public void MetaPackageWithMixedTargetsThrows()
ExceptionAssert.Throws<InvalidOperationException>(() => walker.Walk(metaPackage), "Child dependencies of dependency only packages cannot mix external and project packages.");
}

[Fact]

//[Fact]
public void ExternalPackagesThatDepdendOnProjectLevelPackagesThrows()
{
// Arrange
Expand Down
2 changes: 1 addition & 1 deletion test/Core.Test/ProjectManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ public void AddPackageReferenceAllowsAddingMetadataPackage()
Assert.True(localRepository.Exists("B"));
}

[Fact]
//[Fact]
public void AddPackageReferenceDoesNotAllowAddingDependencyPackageWhichHasToolsFiles()
{
// Arrange
Expand Down

0 comments on commit 8acde68

Please sign in to comment.