diff options
author | Ankit Jain <radical@gmail.com> | 2017-11-09 16:52:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 16:52:19 +0300 |
commit | b2c30bc81b2a7733a4eeb252a55f6b4d50cfc3a1 (patch) | |
tree | 22ee28a6760ecfb0f113a0bee1312e403d5190be | |
parent | b58ba4282377bcefd48abdc2d62ce6330e079abe (diff) | |
parent | acf9bd4f85bbf26a9aa9bb1bea21f84e358a4d6b (diff) |
Merge pull request #5 from radical/update-upstream
Merge upstream/dev
13 files changed, 241 insertions, 21 deletions
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs index f0345cb..e75ea94 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Json { @@ -152,7 +152,7 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json { /// "version": 2, /// "targets": { /// ".NETFramework,Version=v4.5": { - /// "Newtonsoft.Json/8.0.3": { + /// "Newtonsoft.Json/9.0.1": { /// "type": "package", /// "compile": { /// "lib/net45/Newtonsoft.Json.dll": {} @@ -164,7 +164,7 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json { /// } /// }, /// "libraries": { - /// "Newtonsoft.Json/8.0.3": { + /// "Newtonsoft.Json/9.0.1": { /// "sha512": "KGsYQdS2zLH+H8x2cZaSI7e+YZ4SFIbyy1YJQYl6GYBWjf5o4H1A68nxyq+WTyVSOJQ4GqS/DiPE+UseUizgMg==", /// "type": " [rest of string was truncated]";. /// </summary> @@ -180,7 +180,7 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json { /// "version": 2, /// "targets": { /// ".NETFramework,Version=v4.5": { - /// "Newtonsoft.Json/8.0.3": { + /// "Newtonsoft.Json/9.0.1": { /// "type": "package", /// "compile": { /// "lib/net45/Newtonsoft.Json.dll": {} @@ -207,6 +207,36 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json { /// <summary> /// Looks up a localized string similar to { /// "locked": false, + /// "version": 2, + /// "targets": { + /// ".NETFramework,Version=v4.5": { + /// "Newtonsoft.Json/9.0.1": { + /// "type": "package", + /// "compile": { + /// "lib/net45/Newtonsoft.Json.dll": {} + /// }, + /// "runtime": { + /// "lib/net45/Newtonsoft.Json.dll": {} + /// } + /// } + /// }, + /// ".NETFramework,Version=v4.6": { + /// "FluentAssertions/3.4.1": { + /// "frameworkAssemblies": [ + /// "System.Xml", + /// "System.Xml.Linq" + /// ], + /// [rest of string was truncated]";. + /// </summary> + internal static string MultipleProjectFileDependencyGroups_CaseMismatch { + get { + return ResourceManager.GetString("MultipleProjectFileDependencyGroups_CaseMismatch", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to { + /// "locked": false, /// "version": 1, /// "targets": { /// ".NETCore,Version=v5.0": { diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx index a59102f..993a1fe 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx @@ -148,4 +148,7 @@ <data name="ProjectDependency" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>ProjectDependency.assets.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> </data> + <data name="MultipleProjectFileDependencyGroups_CaseMismatch" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>multipleprojectfiledependencygroups_casemismatch.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> + </data> </root>
\ No newline at end of file diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json index b523b70..b529b16 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json @@ -18,7 +18,7 @@ "Newtonsoft.Json/9.0.1": { "sha512": "KGsYQdS2zLH+H8x2cZaSI7e+YZ4SFIbyy1YJQYl6GYBWjf5o4H1A68nxyq+WTyVSOJQ4GqS/DiPE+UseUizgMg==", "type": "package", - "path": "newtonsoft.json/current", + "path": "newtonsoft.json/9.0.1", "files": [ "lib/net20/Newtonsoft.Json.dll", "lib/net20/Newtonsoft.Json.xml", diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json index 1c1f2df..a14ad6d 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json @@ -34,7 +34,7 @@ "Newtonsoft.Json/9.0.1": { "sha512": "KGsYQdS2zLH+H8x2cZaSI7e+YZ4SFIbyy1YJQYl6GYBWjf5o4H1A68nxyq+WTyVSOJQ4GqS/DiPE+UseUizgMg==", "type": "package", - "path": "newtonsoft.json/current", + "path": "newtonsoft.json/9.0.1", "files": [ "lib/net20/Newtonsoft.Json.dll", "lib/net20/Newtonsoft.Json.xml", diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups_CaseMismatch.json b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups_CaseMismatch.json new file mode 100644 index 0000000..11c6892 --- /dev/null +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups_CaseMismatch.json @@ -0,0 +1,150 @@ +{ + "locked": false, + "version": 2, + "targets": { + ".NETFramework,Version=v4.5": { + "Newtonsoft.Json/9.0.1": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": {} + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": {} + } + } + }, + ".NETFramework,Version=v4.6": { + "FluentAssertions/3.4.1": { + "frameworkAssemblies": [ + "System.Xml", + "System.Xml.Linq" + ], + "compile": { + "lib/net45/FluentAssertions.Core.dll": {}, + "lib/net45/FluentAssertions.dll": {} + }, + "runtime": { + "lib/net45/FluentAssertions.Core.dll": {}, + "lib/net45/FluentAssertions.dll": {} + } + } + } + }, + "libraries": { + "Newtonsoft.Json/9.0.1": { + "sha512": "KGsYQdS2zLH+H8x2cZaSI7e+YZ4SFIbyy1YJQYl6GYBWjf5o4H1A68nxyq+WTyVSOJQ4GqS/DiPE+UseUizgMg==", + "type": "package", + "path": "newtonsoft.json/9.0.1", + "files": [ + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.xml", + "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll", + "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.xml", + "newtonsoft.json.9.0.1.nupkg.sha512", + "newtonsoft.json.nuspec", + "tools/install.ps1" + ] + }, + "FluentAssertions/3.4.1": { + "sha512": "GTyLzP7d57D3HLVOSFrTSVwod3rZNQRMC2DR13u1hNNyhsskLrbI4SW5XXqyEv8WP7v8IqWx9hdlDiwLY0G8YA==", + "type": "Package", + "files": [ + "_rels/.rels", + "FluentAssertions.nuspec", + "lib/net40/FluentAssertions.Core.dll", + "lib/net40/FluentAssertions.Core.pdb", + "lib/net40/FluentAssertions.Core.xml", + "lib/net40/FluentAssertions.dll", + "lib/net40/FluentAssertions.pdb", + "lib/net40/FluentAssertions.xml", + "lib/net45/FluentAssertions.Core.dll", + "lib/net45/FluentAssertions.Core.pdb", + "lib/net45/FluentAssertions.Core.xml", + "lib/net45/FluentAssertions.dll", + "lib/net45/FluentAssertions.pdb", + "lib/net45/FluentAssertions.xml", + "lib/portable-monotouch+monoandroid+xamarin.ios/FluentAssertions.Core.dll", + "lib/portable-monotouch+monoandroid+xamarin.ios/FluentAssertions.Core.pdb", + "lib/portable-monotouch+monoandroid+xamarin.ios/FluentAssertions.Core.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/FluentAssertions.Core.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/FluentAssertions.Core.pdb", + "lib/portable-net40+sl5+win8+wp8+wpa81/FluentAssertions.Core.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/FluentAssertions.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/FluentAssertions.pdb", + "lib/portable-net40+sl5+win8+wp8+wpa81/FluentAssertions.XML", + "lib/portable-win81+wpa81/FluentAssertions.Core.dll", + "lib/portable-win81+wpa81/FluentAssertions.Core.pdb", + "lib/portable-win81+wpa81/FluentAssertions.Core.xml", + "lib/portable-win81+wpa81/FluentAssertions.dll", + "lib/portable-win81+wpa81/FluentAssertions.pdb", + "lib/portable-win81+wpa81/FluentAssertions.xml", + "lib/sl5/FluentAssertions.Core.dll", + "lib/sl5/FluentAssertions.Core.pdb", + "lib/sl5/FluentAssertions.Core.xml", + "lib/sl5/FluentAssertions.dll", + "lib/sl5/FluentAssertions.pdb", + "lib/sl5/FluentAssertions.xml", + "lib/sl5/Microsoft.CSharp.dll", + "lib/sl5/Microsoft.CSharp.xml", + "lib/sl5/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll", + "lib/sl5/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.xml", + "lib/sl5/System.Xml.Linq.dll", + "lib/sl5/System.Xml.Linq.xml", + "lib/sl5/de/Microsoft.CSharp.resources.dll", + "lib/sl5/de/System.Xml.Linq.resources.dll", + "lib/sl5/es/Microsoft.CSharp.resources.dll", + "lib/sl5/es/System.Xml.Linq.resources.dll", + "lib/sl5/fr/Microsoft.CSharp.resources.dll", + "lib/sl5/fr/System.Xml.Linq.resources.dll", + "lib/sl5/it/Microsoft.CSharp.resources.dll", + "lib/sl5/it/System.Xml.Linq.resources.dll", + "lib/sl5/ja/Microsoft.CSharp.resources.dll", + "lib/sl5/ja/System.Xml.Linq.resources.dll", + "lib/sl5/ko/Microsoft.CSharp.resources.dll", + "lib/sl5/ko/System.Xml.Linq.resources.dll", + "lib/sl5/ru/Microsoft.CSharp.resources.dll", + "lib/sl5/ru/System.Xml.Linq.resources.dll", + "lib/sl5/zh-Hans/Microsoft.CSharp.resources.dll", + "lib/sl5/zh-Hans/System.Xml.Linq.resources.dll", + "lib/sl5/zh-Hant/Microsoft.CSharp.resources.dll", + "lib/sl5/zh-Hant/System.Xml.Linq.resources.dll", + "lib/win8/FluentAssertions.Core.dll", + "lib/win8/FluentAssertions.Core.pdb", + "lib/win8/FluentAssertions.Core.xml", + "lib/win8/FluentAssertions.dll", + "lib/win8/FluentAssertions.pdb", + "lib/win8/FluentAssertions.XML", + "lib/wp8/FluentAssertions.Core.dll", + "lib/wp8/FluentAssertions.Core.pdb", + "lib/wp8/FluentAssertions.Core.xml", + "lib/wp8/FluentAssertions.dll", + "lib/wp8/FluentAssertions.pdb", + "lib/wp8/FluentAssertions.xml", + "package/services/metadata/core-properties/c21a09dd42de4a6295af89109b879195.psmdcp", + "[Content_Types].xml" + ] + } + }, + "projectFileDependencyGroups": { + "": [], + ".NETFramework,Version=v4.5": [ + "newtonsoft.json >= 8.0.1" + ], + ".NETFramework,Version=v4.6": [ + "fluentassertions >= 3.4.1" + ] + }, + "tools": {}, + "projectFileToolGroups": {}, + "packageFolders": { + "C:\\PackageFolder\\": {} + } +}
\ No newline at end of file diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Microsoft.NuGet.Build.Tasks.Tests.csproj b/src/Microsoft.NuGet.Build.Tasks.Tests/Microsoft.NuGet.Build.Tasks.Tests.csproj index ccf4463..342af76 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/Microsoft.NuGet.Build.Tasks.Tests.csproj +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Microsoft.NuGet.Build.Tasks.Tests.csproj @@ -34,8 +34,6 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <Reference Include="Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="Microsoft.CSharp" /> @@ -78,6 +76,7 @@ <None Include="Json\analyzers.json" /> <None Include="Json\FluentAssertions.lock.json" /> <None Include="Json\FluentAssertionsAndWin10.lock.json" /> + <None Include="Json\MultipleProjectFileDependencyGroups_CaseMismatch.json" /> <None Include="Json\MultipleProjectFileDependencyGroups.json" /> <None Include="Json\nativeWinMD.json" /> <None Include="Json\LockFileWithWithSpecifiedPackageFolders.json" /> diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs index 145e469..90b6142 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs @@ -18,7 +18,7 @@ namespace Microsoft.NuGet.Build.Tasks.Tests runtimeIdentifier: null, createTemporaryFolderForPackages: false); - Assert.Equal(@"C:\PackageFolder\newtonsoft.json\8.0.3\lib\net45\Newtonsoft.Json.dll", result.References.Single().ItemSpec); + Assert.Equal(@"C:\PackageFolder\newtonsoft.json\9.0.1\lib\net45\Newtonsoft.Json.dll", result.References.Single().ItemSpec); } } } diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs index 994fdb4..3b690ab 100644 --- a/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs +++ b/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs @@ -414,6 +414,33 @@ namespace Microsoft.NuGet.Build.Tasks.Tests Assert.Contains("FluentAssertions", packageNames); } + // Regression test for https://devdiv.visualstudio.com/DevDiv/_workitems?id=500532&_a=edit + [Fact] + public static void MultipleProjectFileDependencyGroups_MismatchedCases() + { + var resultFor45 = NuGetTestHelpers.ResolvePackagesWithJsonFileContents( + Json.Json.MultipleProjectFileDependencyGroups_CaseMismatch, + targetMoniker: ".NETFramework,Version=v4.5", + runtimeIdentifier: "win", + allowFallbackOnTargetSelection: true); + + var packageNames = resultFor45.ReferencedPackages.Select(t => t.ItemSpec); + + Assert.Equal("Newtonsoft.Json", packageNames.Single(), ignoreCase: true); + + var resultFor46 = NuGetTestHelpers.ResolvePackagesWithJsonFileContents( + Json.Json.MultipleProjectFileDependencyGroups, + targetMoniker: ".NETFramework,Version=v4.6", + runtimeIdentifier: "win", + allowFallbackOnTargetSelection: true); + + AssertHelpers.AssertCountOf(1, resultFor46.ReferencedPackages); + + packageNames = resultFor46.ReferencedPackages.Select(t => t.ItemSpec); + + Assert.Equal("FluentAssertions", packageNames.Single(), ignoreCase: true); + } + [Fact] public static void ProjectsNotIncludedInReferences() { diff --git a/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets index 3d99ea8..71b4547 100644 --- a/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets +++ b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets @@ -14,10 +14,4 @@ Copyright (c) .NET Foundation. All rights reserved. <NuGetTargets Condition="'$(NuGetTargets)'==''">$(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.targets</NuGetTargets> </PropertyGroup> <Import Condition="Exists('$(NuGetTargets)') and '$(SkipImportNuGetBuildTargets)' != 'true'" Project="$(NuGetTargets)" /> - - <!-- Import NuGet.targets for Restore --> - <PropertyGroup> - <NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'==''">$(MSBuildExtensionsPath)\NuGet.targets</NuGetRestoreTargets> - </PropertyGroup> - <Import Condition="Exists('$(NuGetRestoreTargets)')" Project="$(NuGetRestoreTargets)" /> </Project> diff --git a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj index 3d8611b..2628d82 100644 --- a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj +++ b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj @@ -34,8 +34,6 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <Reference Include="Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="Microsoft.CSharp" /> diff --git a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets index 666a298..e0f7b8b 100644 --- a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets +++ b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets @@ -231,6 +231,8 @@ Copyright (c) .NET Foundation. All rights reserved. </CreateItem> </Target> + <Target Name="CollectReferencedNuGetPackages" Returns="@(ReferencedNuGetPackages)"/> + <Target Name="RuntimeImplementationProjectOutputGroup" Returns="@(RuntimeImplementationProjectOutputGroupOutput)" Condition="'$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')"> @@ -262,6 +264,7 @@ Copyright (c) .NET Foundation. All rights reserved. --> <PropertyGroup> <NuGetTargetFrameworkMonikerToInject Condition="'$(NuGetTargetFrameworkMonikerToInject)' == ''">.NETCore,Version=v5.0</NuGetTargetFrameworkMonikerToInject> + <NuGetTargetMonikerToInject Condition="$(DotNetNativeVersion.StartsWith('2.0')) and '$(NuGetTargetMonikerToInject)' == ''">UAP,Version=v10.0.15138</NuGetTargetMonikerToInject> <NuGetTargetMonikerToInject Condition="'$(NuGetTargetMonikerToInject)' == ''">.NETCore,Version=v5.0</NuGetTargetMonikerToInject> <_ComputeNetCoreFrameworkInjectionParametersBeforeTargets Condition="'$(AppxPackage)' == 'true' and '$(TargetPlatformIdentifier)' == 'UAP'">BeforeGenerateProjectPriFile</_ComputeNetCoreFrameworkInjectionParametersBeforeTargets> </PropertyGroup> @@ -271,6 +274,8 @@ Copyright (c) .NET Foundation. All rights reserved. <_PackagingOutputsIncludesFramework Condition="'%(PackagingOutputs.FileName)%(PackagingOutputs.Extension)' == 'System.Runtime.dll'">true</_PackagingOutputsIncludesFramework> <_AppContainsManagedCodeForInjection Condition="'%(PackagingOutputs.Identity)' == '$(_TargetPlatformSdkDir)UnionMetadata\Windows.winmd'">true</_AppContainsManagedCodeForInjection> <_AppContainsManagedCodeForInjection Condition="'%(PackagingOutputs.Identity)' == '$(WindowsSDK_UnionMetadataPath)\Windows.winmd'">true</_AppContainsManagedCodeForInjection> + <!-- In some scenarios (e.g. JavaScript UWP apps) the WindowsSDK_UnionMetadataPath may not be set. Check the target for completeness. --> + <_AppContainsManagedCodeForInjection Condition="'%(PackagingOutputs.TargetPath)' == '$(WinMetadataDir)\Windows.winmd'">true</_AppContainsManagedCodeForInjection> </PropertyGroup> <PropertyGroup> @@ -292,7 +297,14 @@ Copyright (c) .NET Foundation. All rights reserved. </GetReferenceAssemblyPaths> <PropertyGroup> + <FrameworkInjectionLockFile Condition="'$(FrameworkInjectionLockFile)' == '' and $(DotNetNativeVersion.StartsWith('1.7'))">@(_NuGetInjectionSourceDirectories->'%(Identity)\RS2.project.lock.json')</FrameworkInjectionLockFile> + <FrameworkInjectionLockFile Condition="'$(FrameworkInjectionLockFile)' == '' and $(DotNetNativeVersion.StartsWith('2.0'))">@(_NuGetInjectionSourceDirectories->'%(Identity)\RS3.project.lock.json')</FrameworkInjectionLockFile> <FrameworkInjectionLockFile Condition="'$(FrameworkInjectionLockFile)' == ''">@(_NuGetInjectionSourceDirectories->'%(Identity)\project.lock.json')</FrameworkInjectionLockFile> + + <!-- If the file doesn't exist try to fall back to 5.2.2 file --> + <NuGetTargetMonikerToInject Condition="!Exists('$(FrameworkInjectionLockFile)')">.NETCore,Version=v5.0</NuGetTargetMonikerToInject> + <FrameworkInjectionLockFile Condition="!Exists('$(FrameworkInjectionLockFile)')">@(_NuGetInjectionSourceDirectories->'%(Identity)\project.lock.json')</FrameworkInjectionLockFile> + <FrameworkInjectionPackagesDirectory Condition="'$(FrameworkInjectionPackagesDirectory)' == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\NuGet\Repository', 'NETCoreSDK', null, RegistryView.Registry32, RegistryView.Default))</FrameworkInjectionPackagesDirectory> </PropertyGroup> diff --git a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs index beceac3..97bddf3 100644 --- a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs +++ b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs @@ -892,7 +892,7 @@ namespace Microsoft.NuGet.Build.Tasks /// </summary> private static SortedSet<string> GetAllPackageNames(JObject lockFile) { - var allPackageNames = new SortedSet<string>(); + var allPackageNames = new SortedSet<string>(StringComparer.OrdinalIgnoreCase); var libraries = (JObject)lockFile["libraries"]; foreach (var library in libraries) { diff --git a/src/Microsoft.NuGet.Build.Tasks/project.json b/src/Microsoft.NuGet.Build.Tasks/project.json index c992ffa..133fa6a 100644 --- a/src/Microsoft.NuGet.Build.Tasks/project.json +++ b/src/Microsoft.NuGet.Build.Tasks/project.json @@ -1,5 +1,12 @@ { - "dependencies": { "Newtonsoft.Json": "6.0.4" }, - "frameworks": { "net45": { } }, - "runtimes": { "win": { } } + "dependencies": { + "Microsoft.Build.Utilities.Core": "14.3.0", + "Newtonsoft.Json": "6.0.4" + }, + "frameworks": { + "net45": {} + }, + "runtimes": { + "win": {} + } }
\ No newline at end of file |