Skip to content

Commit

Permalink
Create coverlet.msbuild.nupkg on build
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jan 16, 2019
1 parent a50c10a commit a646c2d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 30 deletions.
4 changes: 1 addition & 3 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<NuspecFile>$(MSBuildThisFileDirectory)coverlet.msbuild.nuspec</NuspecFile>
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
<OutputPath>$(MSBuildThisFileDirectory)build\$(Configuration)</OutputPath>
</PropertyGroup>
Expand All @@ -13,7 +12,7 @@
</Target>

<Target Name="PublishMSBuildTaskProject" AfterTargets="BuildAllProjects">
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o &quot;$(OutputPath)&quot;" />
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o &quot;$(OutputPath)\netcoreapp2.0&quot;" />
</Target>

<Target Name="CopyMSBuildScripts" AfterTargets="PublishMSBuildTaskProject">
Expand All @@ -29,7 +28,6 @@
</Target>

<Target Name="CreateNuGetPackage" AfterTargets="RunTests" Condition="$(Configuration) == 'Release'">
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o $(OutputPath) /p:NuspecFile=$(NuspecFile)" />
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.console\coverlet.console.csproj&quot; -c $(Configuration) -o $(OutputPath)" />
</Target>

Expand Down
24 changes: 0 additions & 24 deletions coverlet.msbuild.nuspec

This file was deleted.

47 changes: 46 additions & 1 deletion src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyVersion>2.4.0</AssemblyVersion>

<PackageId>coverlet.msbuild</PackageId>
<PackageVersion>2.5.0</PackageVersion>
<Title>coverlet.msbuild</Title>
<Authors>tonerdo</Authors>
<PackageLicenseUrl>https://github.com/tonerdo/coverlet/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>http://github.com/tonerdo/coverlet</PackageProjectUrl>
<PackageIconUrl>https://nuget.org/Content/gallery/img/default-package-icon.svg</PackageIconUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<DevelopmentDependency>true</DevelopmentDependency>
<Description>Coverlet is a cross platform code coverage library for .NET Core, with support for line, branch and method coverage.</Description>
<PackageTags>coverage testing unit-test lcov opencover quality</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ContentTargetFolders>build</ContentTargetFolders>

<!-- Build tasks should not be added to the lib folder. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSources>true</IncludeSources>

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +37,27 @@
<ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\coverlet.msbuild\coverlet.msbuild.props">
<Link>build\coverlet.msbuild.props</Link>
<Pack>true</Pack>
</None>
<Content Include="..\coverlet.msbuild\coverlet.msbuild.targets">
<Link>build\coverlet.msbuild.targets</Link>
</Content>
</ItemGroup>

<Target Name="PackBuildOutputs" DependsOnTargets="ResolveProjectReferences;SatelliteDllsProjectOutputGroup;DebugSymbolsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;ResolveAssemblyReferences">
<ItemGroup>
<TfmSpecificPackageFile Include="$(TargetPath)" PackagePath="build\$(TargetFramework)\" />
<TfmSpecificPackageFile Include="$(DepsFilePath)" PackagePath="build\$(TargetFramework)\" />
<TfmSpecificPackageFile Include="@(DebugSymbolsProjectOutputGroupOutput)" PackagePath="build\$(TargetFramework)\" />
<!--<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupDependency)" PackagePath="build\$(TargetFramework)\%(SatelliteDllsProjectOutputGroupDependency.DestinationSubDirectory)" />-->
<!--<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupOutput->'%(FinalOutputPath)')" PackagePath="build\$(TargetFramework)\%(SatelliteDllsProjectOutputGroupOutput.Culture)\" />-->
<TfmSpecificPackageFile Include="%(_ResolvedProjectReferencePaths.Identity)" PackagePath="build\$(TargetFramework)\" />

<TfmSpecificPackageFile Include="@(ReferenceCopyLocalPaths)" Exclude="@(_ResolvedProjectReferencePaths)" PackagePath="build\$(TargetFramework)\%(ReferenceCopyLocalPaths.DestinationSubPath)" />
</ItemGroup>
</Target>

</Project>
4 changes: 2 additions & 2 deletions src/coverlet.msbuild/coverlet.msbuild.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<UsingTask TaskName="Coverlet.MSbuild.Tasks.InstrumentationTask" AssemblyFile="$(MSBuildThisFileDirectory)coverlet.msbuild.tasks.dll"/>
<UsingTask TaskName="Coverlet.MSbuild.Tasks.CoverageResultTask" AssemblyFile="$(MSBuildThisFileDirectory)coverlet.msbuild.tasks.dll"/>
<UsingTask TaskName="Coverlet.MSbuild.Tasks.InstrumentationTask" AssemblyFile="$(MSBuildThisFileDirectory)netcoreapp2.0\coverlet.msbuild.tasks.dll"/>
<UsingTask TaskName="Coverlet.MSbuild.Tasks.CoverageResultTask" AssemblyFile="$(MSBuildThisFileDirectory)netcoreapp2.0\coverlet.msbuild.tasks.dll"/>

<Target Name="InstrumentModulesNoBuild" BeforeTargets="VSTest">
<Coverlet.MSbuild.Tasks.InstrumentationTask
Expand Down

0 comments on commit a646c2d

Please sign in to comment.