Skip to content

Commit

Permalink
Update nuspec logic
Browse files Browse the repository at this point in the history
  • Loading branch information
John Luo committed Aug 5, 2019
1 parent 9208cda commit cbbe6a8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<RootNamespace>Microsoft.Extensions.FileProviders</RootNamespace>
<Description>File provider for files in embedded resources for Microsoft.Extensions.FileProviders.</Description>
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
<NuspecFile>$(MSBuildProjectName).multitarget.nuspec</NuspecFile>
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">netcoreapp3.0</TargetFrameworks>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<NuspecFile Condition="'$(DotNetBuildFromSource)' == 'true'">$(MSBuildProjectName).netcoreapp3.0.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
<IsShipping>true</IsShipping>
</PropertyGroup>
Expand All @@ -24,21 +25,12 @@
<SignedPackageFile Include="Microsoft.Extensions.FileProviders.Embedded.Manifest.Task.dll" Certificate="$(AssemblySigningCertName)" />
</ItemGroup>

<Target Name="PopulateNuspec" BeforeTargets="InitializeStandardNuspecProperties" DependsOnTargets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup;DebugSymbolsProjectOutputGroup;">
<PropertyGroup>
<_OutputBinary>@(BuiltProjectOutputGroupOutput)</_OutputBinary>
<_OutputSymbol>@(DebugSymbolsProjectOutputGroupOutput)</_OutputSymbol>
<_OutputDocumentation>@(DocumentationProjectOutputGroupOutput)</_OutputDocumentation>
</PropertyGroup>
<ItemGroup>
<NuspecProperty Include="targetframework=$(TargetFramework)"/>
<NuspecProperty Include="AssemblyName=$(AssemblyName)"/>
<NuspecProperty Include="OutputBinary=$(_OutputBinary)"/>
<NuspecProperty Include="OutputSymbol=$(_OutputSymbol)"/>
<NuspecProperty Include="OutputDocumentation=$(_OutputDocumentation)"/>
<!-- Include the assembly and symbols from the tasks project -->
<NuspecProperty Include="TaskAssemblyNetStandard=$(ArtifactsDir)bin\$(AssemblyName).Manifest.Task\$(Configuration)\netstandard2.0\$(AssemblyName).Manifest.Task.dll"/>
<NuspecProperty Include="TaskSymbolNetStandard=$(ArtifactsDir)bin\$(AssemblyName).Manifest.Task\$(Configuration)\netstandard2.0\$(AssemblyName).Manifest.Task.pdb" Condition="'$(DebugType)'!='embedded'"/>
</ItemGroup>
</Target>
<ItemGroup>

<NuspecProperty Include="OutputBinary=$(OutputPath)**\$(AssemblyName).dll" />
<NuspecProperty Include="OutputSymbol=$(OutputPath)**\$(AssemblyName).pdb" />
<NuspecProperty Include="OutputDocumentation=$(OutputPath)**\$(AssemblyName).xml" />
<NuspecProperty Include="TaskAssemblyNetStandard=$(ArtifactsDir)bin\$(AssemblyName).Manifest.Task\$(Configuration)\netstandard2.0\$(AssemblyName).Manifest.Task.dll"/>
<NuspecProperty Include="TaskSymbolNetStandard=$(ArtifactsDir)bin\$(AssemblyName).Manifest.Task\$(Configuration)\netstandard2.0\$(AssemblyName).Manifest.Task.pdb" Condition="'$(DebugType)'!='embedded'"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
$CommonMetadataElements$
<dependencies>
<group targetFramework=".NETCoreApp3.0">
<dependency id="Microsoft.Extensions.FileProviders.Abstractions" version="$version$" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.Extensions.FileProviders.Abstractions" version="$version$" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>

<files>
<file src="$OutputBinary$" target="lib\" />
<file src="$OutputSymbol$" target="lib\" />
<file src="$OutputDocumentation$" target="lib\" />
<file src="build\**\*" target="build\" />
<file src="buildMultiTargeting\**\*" target="buildMultiTargeting\" />
<file src="$TaskAssemblyNetStandard$" target="tasks\netstandard2.0\$AssemblyName$.Manifest.Task.dll" />
<file src="$TaskSymbolNetStandard$" target="tasks\netstandard2.0\$AssemblyName$.Manifest.Task.pdb" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<metadata>
$CommonMetadataElements$
<dependencies>
<group targetFramework=".NETStandard2.0">
<group targetFramework=".NETCoreApp3.0">
<dependency id="Microsoft.Extensions.FileProviders.Abstractions" version="$version$" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>

<files>
<file src="$OutputBinary$" target="lib\$targetframework$\" />
<file src="$OutputSymbol$" target="lib\$targetframework$\" />
<file src="$OutputDocumentation$" target="lib\$targetframework$\" />
<file src="$OutputBinary$" target="lib\netcoreapp3.0\" />
<file src="$OutputSymbol$" target="lib\netcoreapp3.0\" />
<file src="$OutputDocumentation$" target="lib\netcoreapp3.0\" />
<file src="build\**\*" target="build\" />
<file src="buildMultiTargeting\**\*" target="buildMultiTargeting\" />
<file src="$TaskAssemblyNetStandard$" target="tasks\netstandard2.0\$AssemblyName$.Manifest.Task.dll" />
Expand Down

0 comments on commit cbbe6a8

Please sign in to comment.