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

Bump AssemblyVersion for nestandard.dll to 2.1.0.0 #1047

Merged
merged 17 commits into from Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 13 additions & 6 deletions Directory.Build.props
Expand Up @@ -11,6 +11,17 @@
<ToolSetCommonDirectory>$(MSBuildThisFileDirectory)artifacts\toolset\Common\</ToolSetCommonDirectory>
</PropertyGroup>

<!-- Need to set ProjectAssetsFile to something so it doesn't get set to the Tools.proj assets file when we import the generated props -->
<PropertyGroup>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">unused</ProjectAssetsFile>
</PropertyGroup>

<Import Project="$(ToolSetCommonDirectory)Tools.proj.nuget.g.props" Condition="Exists('$(ToolSetCommonDirectory)Tools.proj.nuget.g.props')" />

<PropertyGroup>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == 'unused'"></ProjectAssetsFile>
</PropertyGroup>

<!-- Common repo directories -->
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>
Expand All @@ -31,13 +42,9 @@
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>

<!-- Need to set ProjectAssetsFile to something so it doesn't get set to the Tools.proj assets file when we import the generated props -->
<PropertyGroup>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">unused</ProjectAssetsFile>
</PropertyGroup>
<Import Project="$(ToolSetCommonDirectory)Tools.proj.nuget.g.props" Condition="Exists('$(ToolSetCommonDirectory)Tools.proj.nuget.g.props')" />
<!-- Set maximum version for NetStandard to 2.1, since we're now producing 2.1 out of this repo -->
<PropertyGroup>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == 'unused'"></ProjectAssetsFile>
<NETStandardMaximumVersion>2.1</NETStandardMaximumVersion>
</PropertyGroup>

<!-- workaround https://github.com/dotnet/sdk/issues/2288
Expand Down
2 changes: 1 addition & 1 deletion build.proj
Expand Up @@ -16,7 +16,7 @@
<BuildDependsOn Condition="'$(SignPackages)'=='true'">$(BuildDependsOn);SignPackages</BuildDependsOn>
</PropertyGroup>

<Target Name="Restore"/>
<Target Name="Restore" />

<Target Name="BuildManaged">
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions eng/Tools.props
Expand Up @@ -11,6 +11,9 @@

<!-- Need to keep in sync with CodeAnalysis.targets file. -->
<AnalyzerPropsFile>$(ArtifactsToolsetDir)Common\Tools.Analyzers.props</AnalyzerPropsFile>

<!-- Restore specific version of NetStandard.library -->
<NetStandardImplicitPackageVersion>$(NetStandardLibraryPackageVersion)</NetStandardImplicitPackageVersion>
Copy link
Member

@ericstj ericstj Jan 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you need to set this? I would have expected that we would have disabled all the implicit package references in this repository (so it doesn't end up referencing what we are actually building).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK packages all implicitly reference NetStandard.Library/Microsoft.NETCore.App, if I don't set this we'll restore the default version & I won't have the path to find that package in my package cache. If I set it here, this project will restore the version that I want so I know where to find it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider DisableImplicitFrameworkReferences?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I see we already use that in some projects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I figured it was easier to use the implicit reference & just give it a specific version to restore, rather than disabling the reference to NetStandard.Library then adding a manual reference to it.

Copy link
Member

@ericstj ericstj Jan 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, are you sure we'll restore one of those projects that references it? The other places where we're working around missing assets file make me think we may not be. If that's the case maybe we can just add an explicit reference somewhere that we're sure will be restored.

</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="$(MicrosoftDotNetApiCompatPackageVersion)" />
Expand Down
3 changes: 3 additions & 0 deletions eng/Version.Details.xml
Expand Up @@ -22,5 +22,8 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>52d4b539dd1ab771015bdf33ed4221afcaaabf3d</Sha>
</Dependency>
<PinnedDependency Name="NETStandard.Library" Version="2.0.3">
<Uri>https://github.com/dotnet/standard</Uri>
</PinnedDependency>
</ToolsetDependencies>
</Dependencies>
8 changes: 8 additions & 0 deletions eng/Versions.props
Expand Up @@ -20,10 +20,18 @@
<XmlDocPackage>Microsoft.Private.Intellisense</XmlDocPackage>
<XmlDocPackageVersion>2.0.0-preview3-26209-0</XmlDocPackageVersion>
</PropertyGroup>

<PropertyGroup>
<NetStandardLibraryPackage>netstandard.library</NetStandardLibraryPackage>
</PropertyGroup>

<PropertyGroup>
<MicrosoftDotNetApiCompatPackageVersion>1.0.0-beta.19061.6</MicrosoftDotNetApiCompatPackageVersion>
<MicrosoftDotNetBuildTasksPackagingPackageVersion>1.0.0-beta.19061.6</MicrosoftDotNetBuildTasksPackagingPackageVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>1.0.0-beta.19061.6</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19061.6</MicrosoftDotNetGenAPIPackageVersion>

<!-- This is the LKG stable version of NetStandard.Library from myget.org. Please don't edit this version -->
<NetStandardLibraryPackageVersion>2.0.3</NetStandardLibraryPackageVersion>
</PropertyGroup>
</Project>
6 changes: 5 additions & 1 deletion src/netstandard/pkg/NETStandard.Library.pkgproj
Expand Up @@ -10,7 +10,7 @@
<SkipValidatePackage>true</SkipValidatePackage>
<TargetsFileName>NETStandard.Library.targets</TargetsFileName>
<VersionTargetsTemplate>targets\netstandard\$(TargetsFileName)</VersionTargetsTemplate>
<NETStandardVersion>netstandard2.0</NETStandardVersion>
<NETStandardVersion>netstandard2.1</NETStandardVersion>
<VersionTargetsSource>$(IntermediateOutputPath)$(NETStandardVersion)\$(TargetsFileName)</VersionTargetsSource>
</PropertyGroup>

Expand All @@ -32,6 +32,10 @@
<File Include="$(PlaceHolderFile)">
<TargetPath>lib/netstandard1.0</TargetPath>
</File>

<File Include="$(PackagesDir)$(NetStandardLibraryPackage)/$(NetStandardLibraryPackageVersion)/build/netstandard2.0/**">
ericstj marked this conversation as resolved.
Show resolved Hide resolved
<TargetPath>build/netstandard2.0/%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
</File>
</ItemGroup>

<Target Name="StampTargets" BeforeTargets="GenerateNuSpec">
Expand Down
2 changes: 1 addition & 1 deletion src/netstandard/pkg/shims/netfx/Directory.Build.props
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShimRelOutputPath>netfx</ShimRelOutputPath>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<!-- Treat this as a reference assembly because it needs to packaged in the ref folder -->
<IsReferenceAssembly>true</IsReferenceAssembly>
</PropertyGroup>
Expand Down
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShimRelOutputPath>netstandard</ShimRelOutputPath>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<!-- Treat this as a reference assembly because it needs to packaged in the ref folder -->
<IsReferenceAssembly>true</IsReferenceAssembly>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/netstandard/ref/netstandard.csproj
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<IsCoreAssembly>true</IsCoreAssembly>
<!-- disable obsolete warnings/errors -->
<NoWarn>$(NoWarn);0618;0619;0809</NoWarn>
Expand Down
4 changes: 3 additions & 1 deletion src/netstandard/src/netstandard.csproj
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<TargetFrameworks>net461;xamarin.ios;xamarin.watchos;xamarin.tvos;xamarin.mac;monoandroid</TargetFrameworks>
<!-- custom target framework settings to satisfy SDK and msbuild. -->
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' != 'net461'">$(TargetFramework)</TargetFrameworkIdentifier>
<TargetFrameworkVersion Condition="'$(TargetFramework)' != 'net461'">0.0</TargetFrameworkVersion>
<!-- Use fallback until we have a compatibility mapping for netstandard2.1. -->
<AssetTargetFallback>netstandard2.1</AssetTargetFallback>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<DisableStandardFrameworkResolution>true</DisableStandardFrameworkResolution>
<ContractProject>..\ref\netstandard.csproj</ContractProject>
Expand Down
6 changes: 3 additions & 3 deletions src/platforms/Directory.Build.props
Expand Up @@ -8,10 +8,10 @@
<LangVersion>7.2</LangVersion>

<!-- custom target framework settings to satisfy SDK and msbuild. -->
<TargetFrameworkVersion Condition="'$(TargetFramework)' != 'net461'">0.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' != 'net461'">$(TargetFramework)</TargetFrameworkIdentifier>
<TargetFrameworkVersion Condition="!$(TargetFramework.StartsWith('net4')) and !$(TargetFramework.StartsWith('netstandard'))">0.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier Condition="!$(TargetFramework.StartsWith('net4')) and !$(TargetFramework.StartsWith('netstandard'))">$(TargetFramework)</TargetFrameworkIdentifier>
<DisableStandardFrameworkResolution>true</DisableStandardFrameworkResolution>
<ImplicitlyExpandNETStandardFacades>false</ImplicitlyExpandNETStandardFacades>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
</Project>
</Project>
10 changes: 9 additions & 1 deletion src/platforms/extensions/Directory.Build.props
@@ -1,8 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<!-- Disable code paths that require project.assets.json files to be present or to be computed. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you need these? They all look netcoreapp specific, I wouldn't expect them to be causing a problem for netstandard build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to disable the Target that tries to resolve stuff from project.assets.json, without it I get the following error:

E:\code\standard.dotnet\sdk\2.1.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(129,5): error NETSDK1004: Assets file 'E:\code\standard\artifacts\obj\System.CodeDom\project.assets.json' not found. Run a NuGet package restore to generate this file. [E:\code\standard\src\platforms\extensions\System.CodeDom.csproj]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that's annoying. It looks like SDK does indeed try to do this for netstandard projects. What changed that caused that to start breaking?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess just the retargeting to ns2.1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider a followup PR to centralize these properties.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol. One of my follow-up PRs would have been to bring back project restore so that we don't need these hacks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better 👍

<PropertyGroup>
<GenerateDependencyFile>false</GenerateDependencyFile>
<ComputeNETCoreBuildOutputFiles>false</ComputeNETCoreBuildOutputFiles>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<Import Condition="Exists('..\Directory.Build.props')" Project="..\Directory.Build.props" />

<Target Name="MarkProjectReferencesAsNotPrivate" BeforeTargets="AssignProjectConfiguration">
Expand Down