From d72b05b9acd82977add5b0054301850f8c50da88 Mon Sep 17 00:00:00 2001 From: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Date: Tue, 21 Jul 2020 09:42:22 -0700 Subject: [PATCH] Do not include dependencies with PrivateAssets="All" in the compiler package (#526) * Ignore PrivateAssets="All" in FindNuspecReferences.ps1 * Remove parentheses --- src/QsCompiler/Compiler/FindNuspecReferences.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/QsCompiler/Compiler/FindNuspecReferences.ps1 b/src/QsCompiler/Compiler/FindNuspecReferences.ps1 index 49c9c23160..57e66d2781 100644 --- a/src/QsCompiler/Compiler/FindNuspecReferences.ps1 +++ b/src/QsCompiler/Compiler/FindNuspecReferences.ps1 @@ -37,7 +37,7 @@ function Add-NuGetDependencyFromCsprojToNuspec($PathToCsproj) # Check if package already added as dependency, only add if new: $added = $dep.dependency | Where { $_.id -eq $id } - if (!$added) { + if (!$added -and $_.PrivateAssets -ne "All") { Write-Host "Adding $id" $onedependency = $dep.AppendChild($nuspec.CreateElement('dependency', $nuspec.package.metadata.NamespaceURI)) $onedependency.SetAttribute('id', $id) @@ -58,4 +58,3 @@ Add-NuGetDependencyFromCsprojToNuspec "Compiler.csproj" $dep # Save into .nuspec file: $nuspec.package.metadata.AppendChild($dep) $nuspec.Save("$PSScriptRoot\Compiler.nuspec") -