Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

[release/2.0.0] Use a file list rather than globbing NETStandard assemblies #510

Merged
merged 2 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions netstandard/pkg/NETStandard.Library.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />

<PropertyGroup>
<Version>2.0.1</Version>
<Version>2.0.2</Version>
<HarvestStablePackage>false</HarvestStablePackage>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<OmitDependencies>true</OmitDependencies>
<SkipValidatePackage>true</SkipValidatePackage>
<TargetsFileName>NETStandard.Library.targets</TargetsFileName>
<RootTargetsTemplate>targets\$(TargetsFileName)</RootTargetsTemplate>
<RootTargetsSource>$(IntermediateOutputPath)$(TargetsFileName)</RootTargetsSource>
<VersionTargetsTemplate>targets\netstandard\$(TargetsFileName)</VersionTargetsTemplate>
<NETStandardVersion>netstandard2.0</NETStandardVersion>
<VersionTargetsSource>$(IntermediateOutputPath)$(NETStandardVersion)\$(TargetsFileName)</VersionTargetsSource>
</PropertyGroup>

<Import Project="NETStandard.Library.dependencies.props" />

<ItemGroup>
<ProjectReference Include="..\ref\netstandard.csproj" />
<ProjectReference Include="shims\netstandard\dir.builds" />
<ProjectReference Include="shims\netfx\dir.builds" />

<File Include="$(RootTargetsSource)">
<TargetPath>build/$(Id).targets</TargetPath>
</File>

<File Include="targets\netstandard\$(TargetsFileName)">
<ProjectReference Include="shims\netstandard\dir.builds">
<Facade>true</Facade>
</ProjectReference>
<ProjectReference Include="shims\netfx\dir.builds">
<Facade>true</Facade>
</ProjectReference>

<File Include="$(VersionTargetsSource)">
<TargetPath>build/$(NETStandardVersion)/$(Id).targets</TargetPath>
</File>

Expand All @@ -34,11 +34,16 @@
</File>
</ItemGroup>

<Target Name="StampPackageVersionInTargets" BeforeTargets="GenerateNuSpec">
<MakeDir Directories="$(IntermediateOutputPath)" />
<Target Name="StampTargets" BeforeTargets="GenerateNuSpec">
<PropertyGroup>
<_FacadeFiles Condition="'%(File.Facade)' == 'true' AND '%(File.Extension)' == '.dll'" >@(File->'%24(MSBuildThisFileDirectory)\ref\%(FileName)%(Extension)')</_FacadeFiles>
</PropertyGroup>
<Error Condition="'$(_FacadeFiles)' == ''" Text="Could not determine facade file names to write to targets" />

<MakeDir Directories="$(IntermediateOutputPath)$(NETStandardVersion)" />

<WriteLinesToFile File="$(RootTargetsSource)"
Lines="$([System.IO.File]::ReadAllText('$(RootTargetsTemplate)').Replace('#VERSION#', '$(PackageVersion)'))"
<WriteLinesToFile File="$(VersionTargetsSource)"
Lines="$([System.IO.File]::ReadAllText('$(VersionTargetsTemplate)').Replace('#VERSION#', '$(PackageVersion)').Replace('#NETSTANDARDFACADES#', '$(_FacadeFiles)'))"
Overwrite="true" />
</Target>

Expand Down
23 changes: 0 additions & 23 deletions netstandard/pkg/targets/NETStandard.Library.targets

This file was deleted.

29 changes: 23 additions & 6 deletions netstandard/pkg/targets/netstandard/NETStandard.Library.targets
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NETStandardLibraryPackageVersion>#VERSION#</NETStandardLibraryPackageVersion>
</PropertyGroup>

<!-- Only add references if we're actually targeting .NETStandard.
If the project is targeting some other TFM that is compatible with NETStandard we expect
that framework to provide all references for NETStandard, mscorlib, System.* in their own
targeting pack / SDK. -->
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
<_NetStandardLibraryRefPath>$(MSBuildThisFileDirectory)\ref\</_NetStandardLibraryRefPath>
</PropertyGroup>

<!-- import the TFM-agnostic targets -->
<Import Project="..\$(MSBuildThisFile)"/>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
<Reference Include="$(MSBuildThisFileDirectory)\ref\netstandard.dll">
<!-- Private = false to make these reference only -->
<Private>false</Private>
<!-- hide these from Assemblies view in Solution Explorer, they will be shown under packages -->
<Visible>false</Visible>
<NuGetPackageId>NETStandard.Library</NuGetPackageId>
<NuGetPackageVersion>$(NETStandardLibraryPackageVersion)</NuGetPackageVersion>
</Reference>
<Reference Include="#NETSTANDARDFACADES#">
<Facade>true</Facade>
<!-- Private = false to make these reference only -->
<Private>false</Private>
<!-- hide these from Assemblies view in Solution Explorer, they will be shown under packages -->
<Visible>false</Visible>
<NuGetPackageId>NETStandard.Library</NuGetPackageId>
<NuGetPackageVersion>$(NETStandardLibraryPackageVersion)</NuGetPackageVersion>
</Reference>
</ItemGroup>
</Project>