Skip to content

Commit

Permalink
Remove extra code paths, add tests, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-boyarshin committed Apr 3, 2020
1 parent 4209f1f commit 2a0ed07
Show file tree
Hide file tree
Showing 17 changed files with 386 additions and 31 deletions.
9 changes: 8 additions & 1 deletion MSBuild.Sdk.Extras.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{19A683CB
Tools\MSBuild.Packaging.targets = Tools\MSBuild.Packaging.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UwpClassLibrary", "Tests\UwpClassLibrary\UwpClassLibrary.csproj", "{B7617E50-4107-4C19-BDCF-012CCDB22FB0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UwpClassLibrary", "Tests\UwpClassLibrary\UwpClassLibrary.csproj", "{B7617E50-4107-4C19-BDCF-012CCDB22FB0}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ClasslibPackTests", "Tests\ClasslibPackTests.msbuildproj", "{8DB76FFF-B050-433B-B478-1FC44DB9DF6B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -80,6 +82,10 @@ Global
{B7617E50-4107-4C19-BDCF-012CCDB22FB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7617E50-4107-4C19-BDCF-012CCDB22FB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7617E50-4107-4C19-BDCF-012CCDB22FB0}.Release|Any CPU.Build.0 = Release|Any CPU
{8DB76FFF-B050-433B-B478-1FC44DB9DF6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DB76FFF-B050-433B-B478-1FC44DB9DF6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DB76FFF-B050-433B-B478-1FC44DB9DF6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DB76FFF-B050-433B-B478-1FC44DB9DF6B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -94,6 +100,7 @@ Global
{C2EE161F-0521-47F7-BE2D-0B55CA8B3C53} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{19A683CB-8C5D-480B-8D60-30F28DA40660} = {8647C74A-083C-4EAF-B9B0-2172D4A27BFC}
{B7617E50-4107-4C19-BDCF-012CCDB22FB0} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{8DB76FFF-B050-433B-B478-1FC44DB9DF6B} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {93349570-79D8-4F89-8E78-C66401620727}
Expand Down
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,45 @@ More information on how SDK's are resolved can be found [here](https://docs.micr

### <a id="rids"></a>Creating Per-RuntimeIdentifier packages

You'll need a few things
You'll need to perform a few simple steps:

1. Make sure to use `TargetFrameworks` instead of `TargetFramework`, even if you're only building a single target framework. I am piggy-backing off of its looping capabilities.
2. Set the `RuntimeIdentifiers` property to [valid RID's](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) ([full list](https://github.com/dotnet/runtime/blob/master/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json)), separated by a semi-colon. (`<RuntimeIdentifiers>win;unix</RuntimeIdentifiers>`). These can be set per TFM using a condition on the property. This lets you have multiple TFM's, but only some of which have RID's.
3. For the TFM's that you want want to build separately, set the property `ExtrasBuildEachRuntimeIdentifier` to `true`.
1. Set the `RuntimeIdentifiers` property to [valid RID's](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) ([full list](https://github.com/dotnet/runtime/blob/master/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json)), separated by a semi-colon (`<RuntimeIdentifiers>win;unix</RuntimeIdentifiers>`).
2. For the TFM's that you want want to build separately, set the `ExtrasBuildEachRuntimeIdentifier` property to `true`.

Note: You must use the `Sdk="MSBuild.Sdk.Extras"` method for this. Using `PackageReference` is unsupported for this scenario.
When you're done, you should be able to run build/pack and it'll produce a NuGet package.

While the Visual Studio context won't show each RID, it'll build for each. The Extras defines a symbol for each RID for use (`win-x86` would be `WIN_X86` and `centos.7-x64` would be `CENTOS_7_X64`). Dots and dashes become underbars.
Notes:
* You must use the `Sdk="MSBuild.Sdk.Extras"` method for this. Using `PackageReference` is unsupported for this scenario.
* While the Visual Studio context won't show each RID, it'll build for each.
* The Extras defines a preprocessor symbol for each RID for use (`win-x86` would be `WIN_X86` and `centos.7-x64` would be `CENTOS_7_X64`). Dots and dashes become underbars.
* The default path for per-RID output assemblies and symbols in NuGet package is `runtimes/<RuntimeIdentifier>/lib/<TargetFramework>`.
* `RuntimeIdentifiers` can be set per-`TargetFramework` using a condition on the property. This lets you have multiple TFM's, but only some of which have RID's.

You will also need a Reference Assembly for the `ref` folder. Please see my [two](https://claires.site/2018/07/09/create-and-pack-reference-assemblies-made-easy/) [blogs](https://claires.site/2018/07/03/create-and-pack-reference-assemblies/) articles for details.

When you're done, you should be able to build/pack these and it'll create a NuGet package. Your per-RID targets will be in `runtimes/<rid>/lib/<tfm>` and the Reference Assembly will be in `ref/<tfm>`.
#### Reference Assemblies
You will likely need to create reference assemblies to simplify development and consumption of your libraries with complex flavor (`TargetFramework` × `RuntimeIdentifier`) matrix.
Reference assemblies are packed into `ref/<TargetFramework>` folder. Please see my [two](https://claires.site/2018/07/09/create-and-pack-reference-assemblies-made-easy/) [blogs](https://claires.site/2018/07/03/create-and-pack-reference-assemblies/) articles for details.

#### Packing additional contents
If you need to add native assets into runtimes, the easiest way is to use:
```xml
<None Include="path/to/native.dll" PackagePath="runtimes/<rid>/native" Pack="true" />
```

#### Overriding content paths in output package
Minimal example to pack output assemblies and symbols to `tools` (instead of `runtimes`) subfolders.
```xml
<PropertyGroup>
<ExtrasIncludeDefaultProjectBuildOutputInPackTarget>IncludeDefaultProjectBuildOutputInPack</ExtrasIncludeDefaultProjectBuildOutputInPackTarget>
</PropertyGroup>

<Target Name="IncludeDefaultProjectBuildOutputInPack">
<ItemGroup>
<None Include="@(RidSpecificOutput)" PackagePath="tools/%(TargetFramework)/%(Rid)" Pack="true" />
</ItemGroup>
</Target>
```

`<None Include="path/to/native.dll" PackagePath="runtimes/<rid>/native" Pack="true" />`
For advanced options, see _ClasslibPack*_ SDK tests and _RIDs.targets_ file.


### Migrate from the old way (VS pre-15.6)
Expand Down
30 changes: 13 additions & 17 deletions Source/MSBuild.Sdk.Extras/Build/RIDs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ExtrasIncludeDefaultProjectBuildOutputInPackTarget Condition="'$(ExtrasIncludeDefaultProjectBuildOutputInPackTarget)' == ''">_SdkIncludeDefaultProjectBuildOutputInPackImpl</ExtrasIncludeDefaultProjectBuildOutputInPackTarget>
</PropertyGroup>


<Target Name="_SdkGetRidsPerTargetFramework" Returns="@(_SdkRuntimeId)">

<PropertyGroup>
Expand All @@ -26,7 +27,8 @@
<!-- Rationale: it's not produced by _ComputeTargetFrameworkItems, most likely a result of copy-paste -->
<Target Name="_ComputeTargetFrameworkItemsCore">
<ItemGroup>
<_TargetFramework Include="$(TargetFrameworks)" />
<_TargetFramework Include="$(TargetFrameworks)" Condition="'$(TargetFrameworks)' != ''" />
<_TargetFramework Include="$(TargetFramework)" Condition="'$(TargetFramework)' != ''" />
<!-- Make normalization explicit: Trim; Deduplicate by keeping first occurrence, case insensitive -->
<_TargetFrameworkNormalized Include="@(_TargetFramework->Trim()->Distinct())" />
<_InnerBuildProjects Include="$(MSBuildProjectFile)">
Expand Down Expand Up @@ -57,8 +59,8 @@
<_SdkProjectFlavorMatrixItem Remove="@(_SdkProjectFlavorMatrixItem)" />
<_SdkProjectFlavorMatrixItem Include="@(_SdkProjectFlavorMatrixItemStaging->'%(OriginalItemSpec)')" KeepMetadata="TargetFramework;SetTargetFramework;Rid;SetRuntimeIdentifier" />
<_SdkProjectFlavorMatrixItemStaging Remove="@(_SdkProjectFlavorMatrixItemStaging)" />
<_SdkProjectFlavorMatrixItem Update="@(_SdkProjectFlavorMatrixItem->HasMetadata('Rid'))">
<SetRuntimeIdentifier Condition="'%(Rid)' != ''">RuntimeIdentifier=%(Rid)</SetRuntimeIdentifier>
<_SdkProjectFlavorMatrixItem Update="@(_SdkProjectFlavorMatrixItem)">
<SetRuntimeIdentifier Condition="'%(_SdkProjectFlavorMatrixItem.Rid)' != ''">RuntimeIdentifier=%(_SdkProjectFlavorMatrixItem.Rid)</SetRuntimeIdentifier>
</_SdkProjectFlavorMatrixItem>
</ItemGroup>

Expand All @@ -85,6 +87,8 @@
<PropertyGroup>
<ExtrasDisableRidSpecificOutputMetadataReleaseOptimization Condition="'$(ExtrasDisableRidSpecificOutputMetadataReleaseOptimization)' == ''">false</ExtrasDisableRidSpecificOutputMetadataReleaseOptimization>
<ExtrasRidSpecificOutputKeepMetadata Condition="'$(ExtrasRidSpecificOutputKeepMetadata)' == '' and '$(ExtrasDisableRidSpecificOutputMetadataReleaseOptimization)' == 'false'">TargetFramework;Rid</ExtrasRidSpecificOutputKeepMetadata>
<_ExtrasRidSpecificOutputKeepDuplicates Condition="'$(_ExtrasRidSpecificOutputKeepDuplicates)' == '' and '$(ExtrasDisableRidSpecificOutputMetadataReleaseOptimization)' == 'false'">false</_ExtrasRidSpecificOutputKeepDuplicates>
<_ExtrasRidSpecificOutputKeepDuplicates Condition="'$(_ExtrasRidSpecificOutputKeepDuplicates)' == '' and '$(ExtrasDisableRidSpecificOutputMetadataReleaseOptimization)' != 'false'">true</_ExtrasRidSpecificOutputKeepDuplicates>
</PropertyGroup>

<MSBuild
Expand Down Expand Up @@ -163,15 +167,8 @@
<_TargetPathsToSymbolsWithRid Remove="@(_TargetPathsToSymbolsWithRid)" Condition="'%(Rid)' == ''" />
<_BuildOutputInPackage Remove="@(_BuildOutputInPackageWithRid)" />
<_TargetPathsToSymbols Remove="@(_TargetPathsToSymbolsWithRid)" />
</ItemGroup>

<ItemGroup Condition="'$(ExtrasDisableRidSpecificOutputMetadataReleaseOptimization)' == 'false'">
<RidSpecificOutput Include="@(_BuildOutputInPackageWithRid->'%(FinalOutputPath)')" KeepDuplicates="false" KeepMetadata="$(ExtrasRidSpecificOutputKeepMetadata)" />
<RidSpecificOutput Include="@(_TargetPathsToSymbolsWithRid->'%(FinalOutputPath)')" KeepDuplicates="false" KeepMetadata="$(ExtrasRidSpecificOutputKeepMetadata)" />
</ItemGroup>
<ItemGroup Condition="'$(ExtrasDisableRidSpecificOutputMetadataReleaseOptimization)' != 'false'">
<RidSpecificOutput Include="@(_BuildOutputInPackageWithRid->'%(FinalOutputPath)')" />
<RidSpecificOutput Include="@(_TargetPathsToSymbolsWithRid->'%(FinalOutputPath)')" />
<RidSpecificOutput Include="@(_BuildOutputInPackageWithRid->'%(FinalOutputPath)')" KeepDuplicates="$(_ExtrasRidSpecificOutputKeepDuplicates)" KeepMetadata="$(ExtrasRidSpecificOutputKeepMetadata)" />
<RidSpecificOutput Include="@(_TargetPathsToSymbolsWithRid->'%(FinalOutputPath)')" KeepDuplicates="$(_ExtrasRidSpecificOutputKeepDuplicates)" KeepMetadata="$(ExtrasRidSpecificOutputKeepMetadata)" />
</ItemGroup>

</Target>
Expand All @@ -193,23 +190,21 @@

</Target>


<Target Name="_SdkIncludeDefaultProjectBuildOutputInPackImpl" Condition="'$(ExtrasIncludeDefaultProjectBuildOutputInPack)' != 'false'">

<PropertyGroup>
<ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization Condition="'$(ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization)' == ''">false</ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization>

<ExtrasNoneRidSpecificOutputKeepMetadata Condition="'$(ExtrasNoneRidSpecificOutputKeepMetadata)' == '' and '$(ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization)' != 'false'"></ExtrasNoneRidSpecificOutputKeepMetadata>
<!-- Ideally should be empty, but that disables KeepMetadata property -->
<ExtrasNoneRidSpecificOutputKeepMetadata Condition="'$(ExtrasNoneRidSpecificOutputKeepMetadata)' == '' and '$(ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization)' == 'false'">Pack</ExtrasNoneRidSpecificOutputKeepMetadata>
<ExtrasNoneRidSpecificOutputKeepMetadata Condition="'$(ExtrasNoneRidSpecificOutputKeepMetadata)' == '' and '$(ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization)' != 'false'"></ExtrasNoneRidSpecificOutputKeepMetadata>
</PropertyGroup>

<!-- Include the runtimes files -->
<ItemGroup Condition="'$(ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization)' == 'false'">
<ItemGroup>
<None Include="@(RidSpecificOutput->'%(Identity)')" PackagePath="runtimes/%(Rid)/lib/%(TargetFramework)" Pack="true" KeepMetadata="$(ExtrasNoneRidSpecificOutputKeepMetadata)" />
</ItemGroup>
<ItemGroup Condition="'$(ExtrasDisableNoneRidSpecificOutputKeepMetadataOptimization)' != 'false'">
<None Include="@(RidSpecificOutput)" PackagePath="runtimes/%(Rid)/lib/%(TargetFramework)" Pack="true" />
</ItemGroup>

</Target>

Expand All @@ -222,6 +217,7 @@

</Target>


<Target Name="_SdkGetDebugSymbolsWithTfm" DependsOnTargets="_GetDebugSymbolsWithTfm" Returns="@(_TargetPathsToSymbolsWithTfm)">

<ItemGroup Condition="'$(RuntimeIdentifier)' != ''">
Expand Down
8 changes: 8 additions & 0 deletions Tests/ClasslibPackNonRidSpecificCustom/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ClasslibPackRidSpecificCustom
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ExtrasIncludeDefaultProjectBuildOutputInPackTarget>IncludeDefaultProjectBuildOutputInPack</ExtrasIncludeDefaultProjectBuildOutputInPackTarget>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.targets" />

<Target Name="GenerateNuspec" DependsOnTargets="ClasslibPackNonRidSpecificGenerateNuspec" />

<Target Name="Test" DependsOnTargets="Pack">
<Error Text="GenerateNuspec must be called" Condition="'$(GenerateNuspecCalled)' != 'true'"/>
</Target>

</Project>
8 changes: 8 additions & 0 deletions Tests/ClasslibPackNonRidSpecificDefault/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ClasslibPackRidSpecificDefault
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.targets" />

<Target Name="GenerateNuspec" DependsOnTargets="ClasslibPackNonRidSpecificGenerateNuspec" />

<Target Name="Test" DependsOnTargets="Pack">
<Error Text="GenerateNuspec must be called" Condition="'$(GenerateNuspecCalled)' != 'true'"/>
</Target>

</Project>
8 changes: 8 additions & 0 deletions Tests/ClasslibPackNonRidSpecificSkip/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ClasslibPackRidSpecificSkip
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ExtrasIncludeDefaultProjectBuildOutputInPack>false</ExtrasIncludeDefaultProjectBuildOutputInPack>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.targets" />

<Target Name="GenerateNuspec" DependsOnTargets="ClasslibPackNonRidSpecificGenerateNuspec" />

<Target Name="Test" DependsOnTargets="Pack">
<Error Text="GenerateNuspec must be called" Condition="'$(GenerateNuspecCalled)' != 'true'"/>
</Target>

</Project>
8 changes: 8 additions & 0 deletions Tests/ClasslibPackRidSpecificCustom/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ClasslibPackRidSpecificCustom
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RuntimeIdentifiers>win;unix</RuntimeIdentifiers>
<ExtrasBuildEachRuntimeIdentifier>true</ExtrasBuildEachRuntimeIdentifier>
<ExtrasIncludeDefaultProjectBuildOutputInPackTarget>IncludeDefaultProjectBuildOutputInPack</ExtrasIncludeDefaultProjectBuildOutputInPackTarget>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.targets" />

<Target Name="GenerateNuspec" DependsOnTargets="$(GenerateNuspecDependsOn);_CalculateInputsOutputsForPack;_GetProjectReferenceVersions;_InitializeNuspecRepositoryInformationProperties" Condition="$(IsPackable) == 'true'"
Inputs="@(NuGetPackInput)" Outputs="@(NuGetPackOutput)">

<PropertyGroup>
<GenerateNuspecCalled>true</GenerateNuspecCalled>
</PropertyGroup>

<ItemGroup>
<TestNuGetPackInputOutputAssembly Include="@(NuGetPackInput->WithMetadataValue('BuildAction', 'None')->WithMetadataValue('Pack', 'true')->HasMetadata('PackagePath')->WithMetadataValue('Filename', '$(MSBuildProjectName)')->WithMetadataValue('Extension', '.dll'))" />
<TestNuGetPackInputOutputSymbols Include="@(NuGetPackInput->WithMetadataValue('BuildAction', 'None')->WithMetadataValue('Pack', 'true')->HasMetadata('PackagePath')->WithMetadataValue('Filename', '$(MSBuildProjectName)')->WithMetadataValue('Extension', '.pdb'))" />
<TestPackageFilesOutputAssembly Include="@(_PackageFiles->WithMetadataValue('BuildAction', 'None')->WithMetadataValue('Pack', 'true')->HasMetadata('PackagePath')->WithMetadataValue('Filename', '$(MSBuildProjectName)')->WithMetadataValue('Extension', '.dll'))" />
<TestPackageFilesOutputSymbols Include="@(_PackageFiles->WithMetadataValue('BuildAction', 'None')->WithMetadataValue('Pack', 'true')->HasMetadata('PackagePath')->WithMetadataValue('Filename', '$(MSBuildProjectName)')->WithMetadataValue('Extension', '.pdb'))" />
</ItemGroup>

<Error Text="NuGetPackInput must contain the output DLLs" Condition="'@(TestNuGetPackInputOutputAssembly->Count())' != '2'" />
<Error Text="NuGetPackInput must contain output PDBs" Condition="'@(TestNuGetPackInputOutputSymbols->Count())' != '2'" />
<Error Text="NuGetPackInput must contain output DLL for win RID" Condition="'@(TestNuGetPackInputOutputAssembly->WithMetadataValue('PackagePath', 'tools/netstandard2.0/win')->Count())' != '1'" />
<Error Text="NuGetPackInput must contain output PDB for win RID" Condition="'@(TestNuGetPackInputOutputSymbols->WithMetadataValue('PackagePath', 'tools/netstandard2.0/win')->Count())' != '1'" />
<Error Text="NuGetPackInput must contain output DLL for unix RID" Condition="'@(TestNuGetPackInputOutputAssembly->WithMetadataValue('PackagePath', 'tools/netstandard2.0/unix')->Count())' != '1'" />
<Error Text="NuGetPackInput must contain output PDB for unix RID" Condition="'@(TestNuGetPackInputOutputSymbols->WithMetadataValue('PackagePath', 'tools/netstandard2.0/unix')->Count())' != '1'" />
<Error Text="BuildOutputInPackage must be empty" Condition="'@(_BuildOutputInPackage->Count())' != '0'" />
<Error Text="TargetPathsToSymbols must be empty" Condition="'@(_TargetPathsToSymbols->Count())' != '0'" />
<Error Text="_PackageFiles must contain exactly 2×2 items" Condition="'@(_PackageFiles->Count())' != '4'" />
<Error Text="_PackageFiles must contain the output DLLs" Condition="'@(TestPackageFilesOutputAssembly->Count())' != '2'" />
<Error Text="_PackageFiles must contain output PDBs" Condition="'@(TestPackageFilesOutputSymbols->Count())' != '2'" />
<Error Text="_PackageFiles must contain output DLL for win RID" Condition="'@(TestPackageFilesOutputAssembly->WithMetadataValue('PackagePath', 'tools/netstandard2.0/win')->Count())' != '1'" />
<Error Text="_PackageFiles must contain output PDB for win RID" Condition="'@(TestPackageFilesOutputSymbols->WithMetadataValue('PackagePath', 'tools/netstandard2.0/win')->Count())' != '1'" />
<Error Text="_PackageFiles must contain output DLL for unix RID" Condition="'@(TestPackageFilesOutputAssembly->WithMetadataValue('PackagePath', 'tools/netstandard2.0/unix')->Count())' != '1'" />
<Error Text="_PackageFiles must contain output PDB for unix RID" Condition="'@(TestPackageFilesOutputSymbols->WithMetadataValue('PackagePath', 'tools/netstandard2.0/unix')->Count())' != '1'" />

</Target>

<Target Name="Test" DependsOnTargets="Pack">
<Error Text="GenerateNuspec must be called" Condition="'$(GenerateNuspecCalled)' != 'true'"/>
</Target>

</Project>
8 changes: 8 additions & 0 deletions Tests/ClasslibPackRidSpecificDefault/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ClasslibPackRidSpecificDefault
{
public class Class1
{
}
}
Loading

0 comments on commit 2a0ed07

Please sign in to comment.