Skip to content

Commit 4649985

Browse files
committed
Replace checked in .nuspec file with generated one
All the redundancy between the .nuspec file and the .csproj file (both express and implied) is now removed. With it, I fix a few bugs: 1. The generated nuspec file includes the developmentDependency tag that was in the project file but not the checked in file. 1. The package now applies to *all* projects regardless of their target framework (well, so long as they're .netstandard1.0 compatible) instead of all projects rejecting this package unless they targeted .NET Core 2.0 or higher. I also moved the .targets file into a folder structure within the project that resembles where it will appear in the package. This makes it more obvious that it belongs to the package when looking at the source code, and makes it easier to maintain the build/ folder in the package going forward because all files in it are included. Fixes #431
1 parent 02708bb commit 4649985

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ bld/
2424
[Bb]in/
2525
[Oo]bj/
2626
[Ll]og/
27-
[Bb]uild/
2827

2928
# Visual Studio 2015 cache/options directory
3029
.vs/

src/coverlet.collector/coverlet.collector.targets renamed to src/coverlet.collector/build/netstandard1.0/coverlet.collector.targets

File renamed without changes.

src/coverlet.collector/coverlet.collector.csproj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
<RepositoryType>git</RepositoryType>
1616
<RepositoryUrl>https://github.com/tonerdo/coverlet</RepositoryUrl>
1717
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
18-
<NuspecFile>coverlet.collector.nuspec</NuspecFile>
18+
<IncludeBuildOutput>false</IncludeBuildOutput>
19+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
20+
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
1921
</PropertyGroup>
2022

2123
<ItemGroup>
2224
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="16.1.0" />
2325
</ItemGroup>
2426

2527
<ItemGroup>
26-
<Content Include="coverlet.collector.targets" />
28+
<None Update="build\**" Pack="true" PackagePath="" />
2729
</ItemGroup>
2830

2931
<ItemGroup>
@@ -61,12 +63,11 @@
6163
<ItemGroup>
6264
<ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" PrivateAssets="All" />
6365
</ItemGroup>
64-
65-
<Target Name="SetNuspecPackageVersion" DependsOnTargets="GetBuildVersion" BeforeTargets="GenerateNuspec">
66-
<PropertyGroup>
67-
<NuspecProperties>$(NuspecProperties);version=$(NuGetPackageVersion);configuration=$(Configuration)
68-
</NuspecProperties>
69-
</PropertyGroup>
70-
</Target>
7166

67+
<Target Name="PackBuildOutputs">
68+
<ItemGroup>
69+
<TfmSpecificPackageFile Include="$(TargetDir)\*.dll" PackagePath="build\netstandard1.0\" />
70+
<TfmSpecificPackageFile Include="$(TargetDir)\*.deps.json" PackagePath="build\netstandard1.0\" />
71+
</ItemGroup>
72+
</Target>
7273
</Project>

src/coverlet.collector/coverlet.collector.nuspec

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)