Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/NuGet.BuildTasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Jain <radical@gmail.com>2017-09-08 22:39:29 +0300
committerGitHub <noreply@github.com>2017-09-08 22:39:29 +0300
commitb58ba4282377bcefd48abdc2d62ce6330e079abe (patch)
tree5f97e48a046e2ee1f1146e9f4ef9ff19a20ff0f7
parent04bdab55d8de9edcf628694cfd2001561e8f8e60 (diff)
parent104b1ce980bd6d69973a3d340392710548bac2f4 (diff)
Merge pull request #4 from radical/update-to-upstream
Update to upstream `dev`
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs59
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx6
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json8
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json150
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/Json/ProjectDependency.assets.json213
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/Microsoft.NuGet.Build.Tasks.Tests.csproj3
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/NuGetTestHelpers.cs2
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs2
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/LockFileWithXProjReference.json41
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/ProjectReferenceTests.cs39
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.Designer.cs28
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.resx3
-rw-r--r--src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs37
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets8
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props2
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.Solution.ImportAfter.targets18
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj2
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets107
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs5
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs173
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/Strings.Designer.cs9
-rw-r--r--src/Microsoft.NuGet.Build.Tasks/Strings.resx3
22 files changed, 681 insertions, 237 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 da6220a..f0345cb 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.Designer.cs
@@ -177,6 +177,36 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json {
/// <summary>
/// Looks up a localized string similar to {
/// &quot;locked&quot;: false,
+ /// &quot;version&quot;: 2,
+ /// &quot;targets&quot;: {
+ /// &quot;.NETFramework,Version=v4.5&quot;: {
+ /// &quot;Newtonsoft.Json/8.0.3&quot;: {
+ /// &quot;type&quot;: &quot;package&quot;,
+ /// &quot;compile&quot;: {
+ /// &quot;lib/net45/Newtonsoft.Json.dll&quot;: {}
+ /// },
+ /// &quot;runtime&quot;: {
+ /// &quot;lib/net45/Newtonsoft.Json.dll&quot;: {}
+ /// }
+ /// }
+ /// },
+ /// &quot;.NETFramework,Version=v4.6&quot;: {
+ /// &quot;FluentAssertions/3.4.1&quot;: {
+ /// &quot;frameworkAssemblies&quot;: [
+ /// &quot;System.Xml&quot;,
+ /// &quot;System.Xml.Linq&quot;
+ /// ],
+ /// [rest of string was truncated]&quot;;.
+ /// </summary>
+ internal static string MultipleProjectFileDependencyGroups {
+ get {
+ return ResourceManager.GetString("MultipleProjectFileDependencyGroups", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to {
+ /// &quot;locked&quot;: false,
/// &quot;version&quot;: 1,
/// &quot;targets&quot;: {
/// &quot;.NETCore,Version=v5.0&quot;: {
@@ -203,6 +233,35 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.Json {
/// <summary>
/// Looks up a localized string similar to {
+ /// &quot;version&quot;: 2,
+ /// &quot;targets&quot;: {
+ /// &quot;.NETFramework,Version=v4.5.2&quot;: {
+ /// &quot;log4net/2.0.7&quot;: {
+ /// &quot;type&quot;: &quot;package&quot;,
+ /// &quot;compile&quot;: {
+ /// &quot;lib/net45-full/log4net.dll&quot;: {}
+ /// },
+ /// &quot;runtime&quot;: {
+ /// &quot;lib/net45-full/log4net.dll&quot;: {}
+ /// }
+ /// },
+ /// &quot;Newtonsoft.Json/9.0.1&quot;: {
+ /// &quot;type&quot;: &quot;package&quot;,
+ /// &quot;compile&quot;: {
+ /// &quot;lib/net45/Newtonsoft.Json.dll&quot;: {}
+ /// },
+ /// &quot;runtime&quot;: {
+ /// &quot;lib/net45/Newtonsoft.Json.dll&quot;: {}
+ /// [rest of string was truncated]&quot;;.
+ /// </summary>
+ internal static string ProjectDependency {
+ get {
+ return ResourceManager.GetString("ProjectDependency", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to {
/// &quot;locked&quot;: false,
/// &quot;version&quot;: -9996,
/// &quot;targets&quot;: {
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx
index f569b2c..a59102f 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/Json.resx
@@ -142,4 +142,10 @@
<data name="LockFileWithWithSpecifiedPackageFolders" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>lockfilewithwithspecifiedpackagefolders.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
+ <data name="MultipleProjectFileDependencyGroups" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>multipleprojectfiledependencygroups.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+ </data>
+ <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>
</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 6df6a2a..b523b70 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/LockFileWithWithSpecifiedPackageFolders.json
@@ -3,7 +3,7 @@
"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": {}
@@ -15,10 +15,10 @@
}
},
"libraries": {
- "Newtonsoft.Json/8.0.3": {
+ "Newtonsoft.Json/9.0.1": {
"sha512": "KGsYQdS2zLH+H8x2cZaSI7e+YZ4SFIbyy1YJQYl6GYBWjf5o4H1A68nxyq+WTyVSOJQ4GqS/DiPE+UseUizgMg==",
"type": "package",
- "path": "newtonsoft.json/8.0.3",
+ "path": "newtonsoft.json/current",
"files": [
"lib/net20/Newtonsoft.Json.dll",
"lib/net20/Newtonsoft.Json.xml",
@@ -32,7 +32,7 @@
"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.8.0.3.nupkg.sha512",
+ "newtonsoft.json.9.0.1.nupkg.sha512",
"newtonsoft.json.nuspec",
"tools/install.ps1"
]
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.json
new file mode 100644
index 0000000..1c1f2df
--- /dev/null
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/MultipleProjectFileDependencyGroups.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/current",
+ "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/Json/ProjectDependency.assets.json b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/ProjectDependency.assets.json
new file mode 100644
index 0000000..c718a5a
--- /dev/null
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/Json/ProjectDependency.assets.json
@@ -0,0 +1,213 @@
+{
+ "version": 2,
+ "targets": {
+ ".NETFramework,Version=v4.5.2": {
+ "log4net/2.0.7": {
+ "type": "package",
+ "compile": {
+ "lib/net45-full/log4net.dll": {}
+ },
+ "runtime": {
+ "lib/net45-full/log4net.dll": {}
+ }
+ },
+ "Newtonsoft.Json/9.0.1": {
+ "type": "package",
+ "compile": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ },
+ "runtime": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ }
+ },
+ "ClassLibrary1/1.0.0": {
+ "type": "project"
+ }
+ },
+ ".NETFramework,Version=v4.5.2/win": {
+ "log4net/2.0.7": {
+ "type": "package",
+ "compile": {
+ "lib/net45-full/log4net.dll": {}
+ },
+ "runtime": {
+ "lib/net45-full/log4net.dll": {}
+ }
+ },
+ "Newtonsoft.Json/9.0.1": {
+ "type": "package",
+ "compile": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ },
+ "runtime": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ }
+ },
+ "ClassLibrary1/1.0.0": {
+ "type": "project"
+ }
+ },
+ ".NETFramework,Version=v4.5.2/win-x64": {
+ "log4net/2.0.7": {
+ "type": "package",
+ "compile": {
+ "lib/net45-full/log4net.dll": {}
+ },
+ "runtime": {
+ "lib/net45-full/log4net.dll": {}
+ }
+ },
+ "Newtonsoft.Json/9.0.1": {
+ "type": "package",
+ "compile": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ },
+ "runtime": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ }
+ },
+ "ClassLibrary1/1.0.0": {
+ "type": "project"
+ }
+ },
+ ".NETFramework,Version=v4.5.2/win-x86": {
+ "log4net/2.0.7": {
+ "type": "package",
+ "compile": {
+ "lib/net45-full/log4net.dll": {}
+ },
+ "runtime": {
+ "lib/net45-full/log4net.dll": {}
+ }
+ },
+ "Newtonsoft.Json/9.0.1": {
+ "type": "package",
+ "compile": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ },
+ "runtime": {
+ "lib/net45/Newtonsoft.Json.dll": {}
+ }
+ },
+ "ClassLibrary1/1.0.0": {
+ "type": "project"
+ }
+ }
+ },
+ "libraries": {
+ "log4net/2.0.7": {
+ "sha512": "9zY5lPFy4ppjeaTKwHjXbHe6lhle64Bnwui3YDEnnlo4NzHcUE9/h4BqCn3PCCvYbpwO4+ceWdqk9J/lxrQ9dQ==",
+ "type": "package",
+ "path": "log4net/2.0.7",
+ "files": [
+ "lib/net20-full/log4net.dll",
+ "lib/net20-full/log4net.xml",
+ "lib/net35-client/log4net.dll",
+ "lib/net35-client/log4net.xml",
+ "lib/net35-full/log4net.dll",
+ "lib/net35-full/log4net.xml",
+ "lib/net40-client/log4net.dll",
+ "lib/net40-client/log4net.xml",
+ "lib/net40-full/log4net.dll",
+ "lib/net40-full/log4net.xml",
+ "lib/net45-full/log4net.dll",
+ "lib/net45-full/log4net.xml",
+ "lib/netstandard1.3/log4net.dll",
+ "log4net.2.0.7.nupkg.sha512",
+ "log4net.nuspec"
+ ]
+ },
+ "Newtonsoft.Json/9.0.1": {
+ "sha512": "U82mHQSKaIk+lpSVCbWYKNavmNH1i5xrExDEquU1i6I5pV6UMOqRnJRSlKO3cMPfcpp0RgDY+8jUXHdQ4IfXvw==",
+ "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/netstandard1.0/Newtonsoft.Json.dll",
+ "lib/netstandard1.0/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/Newtonsoft.Json.dll",
+ "lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.xml",
+ "newtonsoft.json.9.0.1.nupkg.sha512",
+ "newtonsoft.json.nuspec",
+ "tools/install.ps1"
+ ]
+ },
+ "ClassLibrary1/1.0.0": {
+ "type": "project",
+ "path": "../ClassLibrary1/ClassLibrary1.csproj",
+ "msbuildProject": "../ClassLibrary1/ClassLibrary1.csproj"
+ }
+ },
+ "projectFileDependencyGroups": {
+ ".NETFramework,Version=v4.5.2": [
+ "ClassLibrary1 >= 1.0.0",
+ "Newtonsoft.Json >= 9.0.1",
+ "log4net >= 2.0.7"
+ ]
+ },
+ "packageFolders": {
+ "C:\\Users\\tomescht\\.nuget\\packages\\": {}
+ },
+ "project": {
+ "version": "1.0.0",
+ "restore": {
+ "projectUniqueName": "C:\\Users\\tomescht\\Documents\\Visual Studio 2017\\Projects\\WpfApp1\\WpfApp1\\WpfApp1.csproj",
+ "projectName": "WpfApp1",
+ "projectPath": "C:\\Users\\tomescht\\Documents\\Visual Studio 2017\\Projects\\WpfApp1\\WpfApp1\\WpfApp1.csproj",
+ "outputPath": "C:\\Users\\tomescht\\Documents\\Visual Studio 2017\\Projects\\WpfApp1\\WpfApp1\\obj\\",
+ "projectStyle": "PackageReference",
+ "originalTargetFrameworks": [
+ "net452"
+ ],
+ "frameworks": {
+ "net452": {
+ "projectReferences": {
+ "C:\\Users\\tomescht\\Documents\\Visual Studio 2017\\Projects\\WpfApp1\\ClassLibrary1\\ClassLibrary1.csproj": {
+ "projectPath": "C:\\Users\\tomescht\\Documents\\Visual Studio 2017\\Projects\\WpfApp1\\ClassLibrary1\\ClassLibrary1.csproj"
+ }
+ }
+ }
+ }
+ },
+ "dependencies": {
+ "Newtonsoft.Json": {
+ "target": "Package",
+ "version": "9.0.1"
+ },
+ "log4net": {
+ "target": "Package",
+ "version": "[2.0.7, )"
+ }
+ },
+ "frameworks": {
+ "net452": {
+ "dependencies": {
+ "Newtonsoft.Json": {
+ "target": "Package",
+ "version": "9.0.1"
+ }
+ }
+ }
+ },
+ "runtimes": {
+ "win": {
+ "#import": []
+ },
+ "win-x64": {
+ "#import": []
+ },
+ "win-x86": {
+ "#import": []
+ }
+ }
+ }
+} \ 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 12878ba..ccf4463 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
@@ -78,14 +78,15 @@
<None Include="Json\analyzers.json" />
<None Include="Json\FluentAssertions.lock.json" />
<None Include="Json\FluentAssertionsAndWin10.lock.json" />
+ <None Include="Json\MultipleProjectFileDependencyGroups.json" />
<None Include="Json\nativeWinMD.json" />
<None Include="Json\LockFileWithWithSpecifiedPackageFolders.json" />
<None Include="Json\Win10.Edm.json" />
<None Include="Json\Win10.json" />
<None Include="Json\Win10.xunit.json" />
<None Include="project.json" />
+ <None Include="Json\ProjectDependency.assets.json" />
<None Include="ProjectReferences\LockFileMissingMSBuildProjectThatProvidesAssets.json" />
- <None Include="ProjectReferences\LockFileWithXProjReference.json" />
<None Include="ProjectReferences\LockFileWithCSProjReference.json" />
</ItemGroup>
<ItemGroup>
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/NuGetTestHelpers.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/NuGetTestHelpers.cs
index 690a64d..f31e9d0 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/NuGetTestHelpers.cs
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/NuGetTestHelpers.cs
@@ -26,7 +26,6 @@ namespace Microsoft.NuGet.Build.Tasks.Tests
TryGetRuntimeVersion tryGetRuntimeVersion = null,
bool includeFrameworkReferences = true,
string projectJsonFileContents = null,
- IEnumerable<ITaskItem> projectReferencesCreatingPackages = null,
bool createTemporaryFolderForPackages = true)
{
var rootDirectory = new TempRoot();
@@ -79,7 +78,6 @@ namespace Microsoft.NuGet.Build.Tasks.Tests
task.IncludeFrameworkReferences = includeFrameworkReferences;
task.NuGetPackagesDirectory = packagesDirectory?.Path;
task.RuntimeIdentifier = runtimeIdentifier;
- task.ProjectReferencesCreatingPackages = (projectReferencesCreatingPackages ?? Enumerable.Empty<ITaskItem>()).ToArray();
task.ProjectLockFile = projectLockJsonFile.Path;
task.ProjectLanguage = projectLanguage;
task.TargetMonikers = new ITaskItem[] { new TaskItem(targetMoniker) };
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/PackageFolderTests.cs
index d8ef819..145e469 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\8.0.3\lib\net45\Newtonsoft.Json.dll", result.References.Single().ItemSpec);
}
}
}
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/LockFileWithXProjReference.json b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/LockFileWithXProjReference.json
deleted file mode 100644
index c4970b6..0000000
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/LockFileWithXProjReference.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "locked": false,
- "version": 2,
- "targets": {
- ".NETFramework,Version=v4.5.2": {
- "XProjClassLib/1.0.0": {
- "type": "project",
- "framework": ".NETFramework,Version=v4.5.2",
- "compile": {
- "net452/XProjClassLib.dll": { }
- },
- "runtime": {
- "net452/XProjClassLib.dll": { }
- }
- }
- },
- ".NETFramework,Version=v4.5.2/win": {
- "XProjClassLib/1.0.0": {
- "type": "project",
- "framework": ".NETFramework,Version=v4.5.2",
- "compile": {
- "net452/XProjClassLib.dll": { }
- },
- "runtime": {
- "net452/XProjClassLib.dll": { }
- }
- }
- }
- },
- "libraries": {
- "XProjClassLib/1.0.0": {
- "type": "project",
- "path": "../XProjClassLib/project.json",
- "msbuildProject": "../XProjClassLib/XProjClassLib.xproj"
- }
- },
- "projectFileDependencyGroups": {
- "": [ ],
- ".NETFramework,Version=v4.5.2": [ ]
- }
-} \ No newline at end of file
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/ProjectReferenceTests.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/ProjectReferenceTests.cs
index 3460343..cb87fcc 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/ProjectReferenceTests.cs
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/ProjectReferenceTests.cs
@@ -11,45 +11,6 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.ProjectReferences
public class ProjectReferenceTests
{
[Fact]
- public void ProjectReferenceToXProjWithAssetsButNotWithAPathFails()
- {
- var exception = Assert.Throws<ExceptionFromResource>(
- () => NuGetTestHelpers.ResolvePackagesWithJsonFileContents(Resources.LockFileWithXProjReference, ".NETFramework,Version=v4.5.2", "win"));
-
- Assert.Equal(nameof(Strings.MissingProjectReference), exception.ResourceName);
- AssertHelpers.PathEndsWith(@"XProjClassLib\XProjClassLib.xproj", exception.MessageArgs[0]);
- }
-
- [Fact]
- public void ProjectReferenceToProjectWithNoMSBuildProjectFailsGracefully()
- {
- var exception = Assert.Throws<ExceptionFromResource>(
- () => NuGetTestHelpers.ResolvePackagesWithJsonFileContents(Resources.LockFileMissingMSBuildProjectThatProvidesAssets, ".NETFramework,Version=v4.5.2", "win"));
-
- Assert.Equal(nameof(Strings.MissingMSBuildPathInProjectPackage), exception.ResourceName);
- Assert.Equal(@"XProjClassLib", exception.MessageArgs[0]);
- }
-
- [Fact]
- public void ProjectReferenceToXProjWithAssetsAndPathSucceeds()
- {
- var referenceToXProj = new TaskItem(@"..\XProjClassLib\XProjClassLib.xproj");
- referenceToXProj.SetMetadata("OutputBasePath", "XProjOutputDirectory");
-
- var result = NuGetTestHelpers.ResolvePackagesWithJsonFileContents(
- Resources.LockFileWithXProjReference,
- ".NETFramework,Version=v4.5.2",
- "win",
- projectReferencesCreatingPackages: new[] { referenceToXProj });
-
- Assert.Empty(result.Analyzers);
- AssertHelpers.PathEndsWith(@"XProjOutputDirectory\net452\XProjClassLib.dll", result.CopyLocalItems.Single().ItemSpec);
- AssertHelpers.PathEndsWith(@"XProjOutputDirectory\net452\XProjClassLib.dll", result.References.Single().ItemSpec);
- Assert.All(result.References, r => Assert.Equal(ResolveNuGetPackageAssets.NuGetSourceType_Project, r.GetMetadata(ResolveNuGetPackageAssets.NuGetSourceType)));
- Assert.Empty(result.ReferencedPackages);
- }
-
- [Fact]
public void ProjectReferenceToCSProjWithoutAssetsAndNoPathSucceeds()
{
var result = NuGetTestHelpers.ResolvePackagesWithJsonFileContents(Resources.LockFileWithCSProjReference, ".NETFramework,Version=v4.5.2", "win");
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.Designer.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.Designer.cs
index a966927..1af74df 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.Designer.cs
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.Designer.cs
@@ -116,33 +116,5 @@ namespace Microsoft.NuGet.Build.Tasks.Tests.ProjectReferences {
return ResourceManager.GetString("LockFileWithCSProjReference", resourceCulture);
}
}
-
- /// <summary>
- /// Looks up a localized string similar to {
- /// &quot;locked&quot;: false,
- /// &quot;version&quot;: 2,
- /// &quot;targets&quot;: {
- /// &quot;.NETFramework,Version=v4.5.2&quot;: {
- /// &quot;XProjClassLib/1.0.0&quot;: {
- /// &quot;type&quot;: &quot;project&quot;,
- /// &quot;framework&quot;: &quot;.NETFramework,Version=v4.5.2&quot;,
- /// &quot;compile&quot;: {
- /// &quot;net452/XProjClassLib.dll&quot;: { }
- /// },
- /// &quot;runtime&quot;: {
- /// &quot;net452/XProjClassLib.dll&quot;: { }
- /// }
- /// }
- /// },
- /// &quot;.NETFramework,Version=v4.5.2/win&quot;: {
- /// &quot;XProjClassLib/1.0.0&quot;: {
- /// &quot;type&quot;: &quot;project&quot;,
- /// &quot;framework&quot;: &quot;.NETFram [rest of string was truncated]&quot;;.
- /// </summary>
- internal static string LockFileWithXProjReference {
- get {
- return ResourceManager.GetString("LockFileWithXProjReference", resourceCulture);
- }
- }
}
}
diff --git a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.resx b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.resx
index 945ce91..89629ca 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.resx
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/ProjectReferences/Resources.resx
@@ -124,7 +124,4 @@
<data name="LockFileWithCSProjReference" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>lockfilewithcsprojreference.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
- <data name="LockFileWithXProjReference" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>lockfilewithxprojreference.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/ReferenceResolutionTests.cs b/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs
index 4bdaaa7..994fdb4 100644
--- a/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs
+++ b/src/Microsoft.NuGet.Build.Tasks.Tests/ReferenceResolutionTests.cs
@@ -387,5 +387,42 @@ namespace Microsoft.NuGet.Build.Tasks.Tests
AssertHelpers.AssertConsistentTargetPaths(result.CopyLocalItems);
}
+
+ [Fact]
+ public static void MultipleProjectFileDependencyGroups()
+ {
+ var resultFor45 = NuGetTestHelpers.ResolvePackagesWithJsonFileContents(
+ Json.Json.MultipleProjectFileDependencyGroups,
+ targetMoniker: ".NETFramework,Version=v4.5",
+ runtimeIdentifier: "win",
+ allowFallbackOnTargetSelection: true);
+
+ var packageNames = resultFor45.ReferencedPackages.Select(t => t.ItemSpec);
+
+ Assert.Equal("Newtonsoft.Json", packageNames.Single());
+
+ 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.Contains("FluentAssertions", packageNames);
+ }
+
+ [Fact]
+ public static void ProjectsNotIncludedInReferences()
+ {
+ var result = NuGetTestHelpers.ResolvePackagesWithJsonFileContents(
+ Json.Json.ProjectDependency,
+ targetMoniker: ".NETFramework,Version=v4.5.2",
+ runtimeIdentifier: "win");
+
+ Assert.DoesNotContain("ClassLibrary1", result.ReferencedPackages.Select(t => t.ItemSpec));
+ }
}
}
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 72ce25d..3d99ea8 100644
--- a/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets
+++ b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets
@@ -13,5 +13,11 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<NuGetTargets Condition="'$(NuGetTargets)'==''">$(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.targets</NuGetTargets>
</PropertyGroup>
- <Import Condition="Exists('$(NuGetTargets)')" Project="$(NuGetTargets)" />
+ <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/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props
index a34517c..0dea8c0 100644
--- a/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props
+++ b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props
@@ -13,5 +13,5 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<NuGetProps Condition="'$(NuGetProps)'==''">$(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.props</NuGetProps>
</PropertyGroup>
- <Import Condition="Exists('$(NuGetProps)')" Project="$(NuGetProps)" />
+ <Import Condition="Exists('$(NuGetProps)') and '$(SkipImportNuGetProps)' != 'true'" Project="$(NuGetProps)" />
</Project>
diff --git a/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.Solution.ImportAfter.targets b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.Solution.ImportAfter.targets
new file mode 100644
index 0000000..a77592c
--- /dev/null
+++ b/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.Solution.ImportAfter.targets
@@ -0,0 +1,18 @@
+<!--
+***********************************************************************************************
+Microsoft.NuGet.Solution.ImportAfter.targets
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+Copyright (c) .NET Foundation. All rights reserved.
+***********************************************************************************************
+-->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- Import NuGet.targets for solution Restore -->
+ <PropertyGroup>
+ <NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'==''">$(MSBuildExtensionsPath)\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\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 8aba143..3d8611b 100644
--- a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj
+++ b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.Build.Tasks.csproj
@@ -80,4 +80,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project> \ No newline at end of file
diff --git a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets
index 42dbc16..666a298 100644
--- a/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets
+++ b/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets
@@ -12,15 +12,70 @@ Copyright (c) .NET Foundation. All rights reserved.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets" AssemblyFile="Microsoft.NuGet.Build.Tasks.dll" />
- <PropertyGroup Condition="'$(ProjectLockFile)' == ''">
- <_ProjectSpecificProjectJsonFile>$(MSBuildProjectName).project.json</_ProjectSpecificProjectJsonFile>
- <ProjectLockFile Condition="Exists('$(_ProjectSpecificProjectJsonFile)')">$(MSBuildProjectName).project.lock.json</ProjectLockFile>
- <ProjectLockFile Condition="!Exists('$(_ProjectSpecificProjectJsonFile)')">project.lock.json</ProjectLockFile>
+ <!--
+ Identify the project asset/lock file in following order:
+ 1. If ProjectAssetsFile exists, then simply use it since it means project uses PackageReference
+ 2. If ProjectLockFile already defined, then use it instead of constructing our own
+ 3. Construct our own project lock file for that first check for <ProjectName>.project.json file
+ 4. And lastly check for project.json file existence, and use project.lock.json file
+
+ If none of these conditions satisfy then these NuGet build targets will not be executed.
+ -->
+ <Choose>
+ <When Condition="'$(ProjectAssetsFile)' != ''">
+ <!-- The ProjectAssetsFile has been specified which means it uses PackageReference, so use that. -->
+ <PropertyGroup>
+ <ProjectLockFile>$(ProjectAssetsFile)</ProjectLockFile>
+ </PropertyGroup>
+ </When>
+
+ <When Condition="'$(RestoreProjectStyle)' == 'PackageReference'">
+ <!-- The RestoreProjectStyle property has been specified to PackageReference, so use that. -->
+ <PropertyGroup>
+ <ProjectLockFile>$(BaseIntermediateOutputPath)project.assets.json</ProjectLockFile>
+ </PropertyGroup>
+ </When>
+
+ <When Condition="'$(ProjectLockFile)' != ''">
+ <!-- The ProjectLockFile has been specified; don't compute it. -->
+ </When>
+
+ <When Condition="Exists('$(MSBuildProjectName).project.json')">
+ <!-- There's a MyProj.project.json file, so use MyProj.project.lock.json. -->
+ <PropertyGroup>
+ <ProjectLockFile>$(MSBuildProjectName).project.lock.json</ProjectLockFile>
+ </PropertyGroup>
+ </When>
+
+ <When Condition="Exists('project.json')">
+ <!-- There's a project.json file, so use project.lock.json. -->
+ <PropertyGroup>
+ <ProjectLockFile>project.lock.json</ProjectLockFile>
+ </PropertyGroup>
+ </When>
+
+ <Otherwise>
+ <!-- No assets or lock file provided at all, so fallback to project.assets.json file.-->
+ <PropertyGroup>
+ <ProjectLockFile>$(BaseIntermediateOutputPath)project.assets.json</ProjectLockFile>
+ </PropertyGroup>
+ </Otherwise>
+ </Choose>
+
+ <!-- Add to MSBuildAllProjects in order to better support incremental builds. -->
+ <PropertyGroup>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<ResolveNuGetPackages Condition="'$(ResolveNuGetPackages)' == '' and '$(MSBuildProjectExtension)' != '.xproj'">true</ResolveNuGetPackages>
+ <!--
+ if BaseNuGetRuntimeIdentifier is defined then simply use it as RuntimeIdentifier, otherwise
+ we'll set RuntimeIdentifiers to default value later on.
+ -->
+ <RuntimeIdentifier Condition="'$(BaseNuGetRuntimeIdentifier)' != ''">$(BaseNuGetRuntimeIdentifier)</RuntimeIdentifier>
+
<BaseNuGetRuntimeIdentifier Condition="'$(BaseNuGetRuntimeIdentifier)' == '' and '$(TargetPlatformIdentifier)' == 'UAP'">win10</BaseNuGetRuntimeIdentifier>
<BaseNuGetRuntimeIdentifier Condition="'$(BaseNuGetRuntimeIdentifier)' == ''">win</BaseNuGetRuntimeIdentifier>
@@ -28,7 +83,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<NuGetTargetMoniker Condition="'$(NuGetTargetMoniker)' == '' AND '$(UseTargetPlatformAsNuGetTargetMoniker)' == 'true'">$(TargetPlatformIdentifier),Version=v$([System.Version]::Parse('$(TargetPlatformMinVersion)').ToString(3))</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(NuGetTargetMoniker)' == '' AND '$(UseTargetPlatformAsNuGetTargetMoniker)' != 'true'">$(TargetFrameworkMoniker)</NuGetTargetMoniker>
- <CopyNuGetImplementations Condition="'$(CopyNuGetImplementations)' == '' and (('$(OutputType)' != 'library' and ('$(OutputType)' != 'winmdobj' or '$(AppxPackage)' == 'true')) or '$(TargetFrameworkIdentifier)' == '.NETFramework')">true</CopyNuGetImplementations>
+ <CopyNuGetImplementations Condition="'$(CopyNuGetImplementations)' == '' and (('$(OutputType)' != 'library' and '$(OutputType)' != 'winmdobj') or ('$(AppxPackage)' == 'true') or '$(TargetFrameworkIdentifier)' == '.NETFramework')">true</CopyNuGetImplementations>
<IncludeFrameworkReferencesFromNuGet Condition="'$(IncludeFrameworkReferencesFromNuGet)' == ''">true</IncludeFrameworkReferencesFromNuGet>
<_NuGetRuntimeIdentifierPlatformTargetSuffix Condition="'$(PlatformTarget)' != '' and '$(PlatformTarget)' != 'AnyCPU'">-$(PlatformTarget.ToLower())</_NuGetRuntimeIdentifierPlatformTargetSuffix>
@@ -41,6 +96,11 @@ Copyright (c) .NET Foundation. All rights reserved.
<NuGetRuntimeIdentifier Condition="'$(UseDotNetNativeToolchain)' == 'true'">$(_NuGetRuntimeIdentifierWithoutAot)-aot</NuGetRuntimeIdentifier>
</PropertyGroup>
+ <!-- If RuntimeIdentifiers weren't already specified for non-UAP projects, then generate it -->
+ <PropertyGroup Condition="'$(BaseNuGetRuntimeIdentifier)' == 'win' and '$(NuGetRuntimeIdentifier)' != '' and '$(RuntimeIdentifiers)' == '' and '$(RuntimeIdentifier)' == ''">
+ <RuntimeIdentifiers>win;win-x86;win-x64</RuntimeIdentifiers>
+ </PropertyGroup>
+
<ItemGroup>
<!-- If we are resolving from project.lock.json, we need to consider any edit to it as something that forces a rebuild -->
<CustomAdditionalCompileInputs Include="$(ProjectLockFile)" Condition="'$(ResolveNuGetPackages)' == 'true' and Exists('$(ProjectLockFile)')" />
@@ -117,25 +177,9 @@ Copyright (c) .NET Foundation. All rights reserved.
<ResolveNuGetPackageAssetsDependsOn Condition="'$(ImplicitlyExpandTargetFramework)' == 'true'">$(ResolveNuGetPackageAssetsDependsOn);ImplicitlyExpandTargetFramework</ResolveNuGetPackageAssetsDependsOn>
</PropertyGroup>
- <Target Name="ResolveNuGetPackageAssets" DependsOnTargets="$(ResolveNuGetPackageAssetsDependsOn)" Condition="'$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')">
- <!-- We need to figure out the output path of any dependent xproj projects -->
- <MSBuild
- Projects="@(_MSBuildProjectReferenceExistent)"
- Targets="GetTargetDir"
- BuildInParallel="$(BuildInParallel)"
- Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)"
- RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)"
- Condition="'%(_MSBuildProjectReferenceExistent.Extension)' == '.xproj'">
-
- <Output TaskParameter="TargetOutputs" ItemName="_XProjTargetDirs" />
- </MSBuild>
-
- <!-- The items in _XProjTargetDirs have the target directories as the main itemspecs and the originating project as metadata; reverse them -->
- <ItemGroup>
- <ProjectReferenceCreatingPackage Include="%(_XProjTargetDirs.OriginalItemSpec)">
- <OutputBasePath>%(_XProjTargetDirs.Identity)</OutputBasePath>
- </ProjectReferenceCreatingPackage>
- </ItemGroup>
+ <Target Name="ResolveNuGetPackageAssets"
+ DependsOnTargets="$(ResolveNuGetPackageAssetsDependsOn)"
+ Condition="'$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')">
<ResolveNuGetPackageAssets AllowFallbackOnTargetSelection="$(DesignTimeBuild)"
ContinueOnError="$(ContinueOnError)"
@@ -144,7 +188,6 @@ Copyright (c) .NET Foundation. All rights reserved.
RuntimeIdentifier="$(NuGetRuntimeIdentifier)"
ProjectLanguage="$(Language)"
ProjectLockFile="$(ProjectLockFile)"
- ProjectReferencesCreatingPackages="@(ProjectReferenceCreatingPackage)"
ContentPreprocessorValues="@(NuGetPreprocessorValue)"
ContentPreprocessorOutputDirectory="$(IntermediateOutputPath)\NuGet"
TargetMonikers="$(NuGetTargetMoniker);$(_NuGetTargetFallbackMoniker)">
@@ -188,7 +231,10 @@ Copyright (c) .NET Foundation. All rights reserved.
</CreateItem>
</Target>
- <Target Name="RuntimeImplementationProjectOutputGroup" Returns="@(RuntimeImplementationProjectOutputGroupOutput)" Condition="'$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')">
+ <Target Name="RuntimeImplementationProjectOutputGroup"
+ Returns="@(RuntimeImplementationProjectOutputGroupOutput)"
+ Condition="'$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')">
+
<!-- This output group must contain the implementation assemblies for the host (i.e. design time) environment, not the
target environment. Thus, we explicitly pass the RuntimeIdentifier that doesn't have the -aot suffix -->
<ResolveNuGetPackageAssets AllowFallbackOnTargetSelection="$(DesignTimeBuild)"
@@ -224,6 +270,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<_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>
</PropertyGroup>
<PropertyGroup>
@@ -231,11 +278,15 @@ Copyright (c) .NET Foundation. All rights reserved.
</PropertyGroup>
</Target>
- <Target Name="InjectNetCoreFrameworkBlockIfLockFileExists" AfterTargets="ComputeNetCoreFrameworkInjectionParameters" Condition="'$(_NetCoreFrameworkInjectionNeeded)' == 'true' and '$(ResolveNuGetPackages)' == 'true' and Exists('$(ProjectLockFile)')">
+ <Target Name="InjectNetCoreFrameworkBlockIfLockFileExists"
+ AfterTargets="ComputeNetCoreFrameworkInjectionParameters"
+ Condition="'$(_NetCoreFrameworkInjectionNeeded)' == 'true' and '$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')">
<Error Text="One of your dependencies requires the .NET Framework, but the .NET Framework could not be found in the NuGet packages installed in this project. Please install the appropriate .NET Framework packages required by your dependency." />
</Target>
- <Target Name="InjectNetCoreFramework" AfterTargets="ComputeNetCoreFrameworkInjectionParameters" Condition="'$(_NetCoreFrameworkInjectionNeeded)' == 'true' and ('$(ResolveNuGetPackages)' != 'true' or !Exists('$(ProjectLockFile)'))">
+ <Target Name="InjectNetCoreFramework"
+ AfterTargets="ComputeNetCoreFrameworkInjectionParameters"
+ Condition="'$(_NetCoreFrameworkInjectionNeeded)' == 'true' and ('$(ResolveNuGetPackages)' != 'true' or !Exists('$(ProjectLockFile)'))">
<GetReferenceAssemblyPaths TargetFrameworkMoniker="$(NuGetTargetFrameworkMonikerToInject)" Condition="'$(FrameworkInjectionLockFile)' == ''">
<Output TaskParameter="ReferenceAssemblyPaths" ItemName="_NuGetInjectionSourceDirectories" />
</GetReferenceAssemblyPaths>
diff --git a/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs b/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
index 4d46c12..703a648 100644
--- a/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
+++ b/src/Microsoft.NuGet.Build.Tasks/NuGetPackageObject.cs
@@ -23,11 +23,10 @@ namespace Microsoft.NuGet.Build.Tasks
/// </summary>
private readonly Lazy<string> _fullPackagePath;
- public NuGetPackageObject(string id, string version, bool isProject, Func<string> fullPackagePathGenerator, JObject targetObject, JObject libraryObject)
+ public NuGetPackageObject(string id, string version, Func<string> fullPackagePathGenerator, JObject targetObject, JObject libraryObject)
{
Id = id;
Version = version;
- IsProject = isProject;
_fullPackagePath = new Lazy<string>(fullPackagePathGenerator);
TargetObject = targetObject;
LibraryObject = libraryObject;
@@ -35,7 +34,7 @@ namespace Microsoft.NuGet.Build.Tasks
public string Id { get; }
public string Version { get; }
- public bool IsProject { get; }
+ public string RelativePackagePath => (string)LibraryObject["path"];
/// <summary>
/// The JSON object from the "targets" section in the project.lock.json for this package.
diff --git a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
index e2afbc8..beceac3 100644
--- a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
+++ b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs
@@ -23,7 +23,6 @@ namespace Microsoft.NuGet.Build.Tasks
internal const string NuGetPackageVersionMetadata = "NuGetPackageVersion";
internal const string NuGetIsFrameworkReference = "NuGetIsFrameworkReference";
internal const string NuGetSourceType = "NuGetSourceType";
- internal const string NuGetSourceType_Project = "Project";
internal const string NuGetSourceType_Package = "Package";
internal const string ReferenceImplementationMetadata = "Implementation";
@@ -46,8 +45,6 @@ namespace Microsoft.NuGet.Build.Tasks
private readonly List<string> _packageFolders = new List<string>();
- private readonly Dictionary<string, string> _projectReferencesToOutputBasePaths = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
-
#region UnitTestSupport
private readonly FileExists _fileExists = new FileExists(File.Exists);
private readonly TryGetRuntimeVersion _tryGetRuntimeVersion = new TryGetRuntimeVersion(TryGetRuntimeVersion);
@@ -143,15 +140,6 @@ namespace Microsoft.NuGet.Build.Tasks
}
/// <summary>
- /// A list of project references that are creating packages as listed in the lock file. The OutputPath metadata should
- /// set on each of these items, which is used by the task to construct full output paths to assets.
- /// </summary>
- public ITaskItem[] ProjectReferencesCreatingPackages
- {
- get; set;
- }
-
- /// <summary>
/// The base output directory where the temporary, preprocessed files should be written to.
/// </summary>
public string ContentPreprocessorOutputDirectory
@@ -238,7 +226,6 @@ namespace Microsoft.NuGet.Build.Tasks
PopulatePackageFolders(lockFile);
- PopulateProjectReferenceMaps();
GetReferences(lockFile);
GetCopyLocalItems(lockFile);
GetAnalyzers(lockFile);
@@ -281,23 +268,6 @@ namespace Microsoft.NuGet.Build.Tasks
}
}
- private void PopulateProjectReferenceMaps()
- {
- foreach (var projectReference in ProjectReferencesCreatingPackages ?? new ITaskItem[] { })
- {
- var fullPath = GetAbsolutePathFromProjectRelativePath(projectReference.ItemSpec);
- if (_projectReferencesToOutputBasePaths.ContainsKey(fullPath))
- {
- Log.LogWarningFromResources(nameof(Strings.DuplicateProjectReference), fullPath, nameof(ProjectReferencesCreatingPackages));
- }
- else
- {
- var outputPath = projectReference.GetMetadata("OutputBasePath");
- _projectReferencesToOutputBasePaths.Add(fullPath, outputPath);
- }
- }
- }
-
private void GetReferences(JObject lockFile)
{
var target = GetTargetOrAttemptFallback(lockFile, needsRuntimeIdentifier: false);
@@ -399,7 +369,7 @@ namespace Microsoft.NuGet.Build.Tasks
if (Path.GetExtension(file).Equals(".dll", StringComparison.OrdinalIgnoreCase))
{
string path;
- if (TryGetFile(package.Id, package.Version, file, out path))
+ if (TryGetFile(package.Id, package.Version, package.RelativePackagePath, file, out path))
{
var analyzer = new TaskItem(path);
@@ -471,16 +441,16 @@ namespace Microsoft.NuGet.Build.Tasks
}
}
- private bool TryGetFile(string packageName, string packageVersion, string file, out string path)
+ private bool TryGetFile(string packageName, string packageVersion, string packageRelativePath, string file, out string path)
{
if (IsFileValid(file, "C#", "VB"))
{
- path = GetPath(packageName, packageVersion, file);
+ path = GetPath(packageName, packageVersion, packageRelativePath, file);
return true;
}
else if (IsFileValid(file, "VB", "C#"))
{
- path = GetPath(packageName, packageVersion, file);
+ path = GetPath(packageName, packageVersion, packageRelativePath, file);
return true;
}
@@ -499,9 +469,9 @@ namespace Microsoft.NuGet.Build.Tasks
!file.Split('/').Any(x => x.Equals(unExpectedLanguage, StringComparison.OrdinalIgnoreCase)));
}
- private string GetPath(string packageName, string packageVersion, string file)
+ private string GetPath(string packageName, string packageVersion, string packageRelativePath, string file)
{
- return Path.Combine(GetNuGetPackagePath(packageName, packageVersion), file.Replace('/', Path.DirectorySeparatorChar));
+ return Path.Combine(GetNuGetPackagePath(packageName, packageVersion, packageRelativePath), file.Replace('/', Path.DirectorySeparatorChar));
}
/// <summary>
@@ -820,7 +790,7 @@ namespace Microsoft.NuGet.Build.Tasks
item.SetMetadata("Private", "false");
item.SetMetadata(NuGetIsFrameworkReference, "false");
- item.SetMetadata(NuGetSourceType, package.IsProject ? NuGetSourceType_Project : NuGetSourceType_Package);
+ item.SetMetadata(NuGetSourceType, NuGetSourceType_Package);
items.Add(item);
@@ -881,31 +851,104 @@ namespace Microsoft.NuGet.Build.Tasks
private void GetReferencedPackages(JObject lockFile)
{
+ var targets = (JObject)lockFile["targets"];
+
+ string targetMoniker = null;
+ foreach (var preferredTargetMoniker in TargetMonikers)
+ {
+ var preferredTargetMonikerWithOptionalRuntimeIdentifier = GetTargetMonikerWithOptionalRuntimeIdentifier(preferredTargetMoniker, needsRuntimeIdentifier: false);
+ var target = (JObject)targets[preferredTargetMonikerWithOptionalRuntimeIdentifier];
+
+ if (target != null)
+ {
+ targetMoniker = preferredTargetMonikerWithOptionalRuntimeIdentifier;
+ break;
+ }
+ }
+
var projectFileDependencyGroups = (JObject)lockFile["projectFileDependencyGroups"];
- var projectFileDependencies = (JArray)projectFileDependencyGroups[""];
+ var allPackageNames = GetAllPackageNames(lockFile);
+
+ if (targetMoniker != null)
+ {
+ var targetSpecificDependencies = (JArray)projectFileDependencyGroups[targetMoniker];
+ if (targetSpecificDependencies != null)
+ {
+ AddReferencedPackages(targetSpecificDependencies, allPackageNames);
+ }
+ }
- foreach (var packageDependency in projectFileDependencies.Select(v => (string)v))
+ var universalDependencies = (JArray)projectFileDependencyGroups[""];
+ if (universalDependencies != null)
{
+ AddReferencedPackages(universalDependencies, allPackageNames);
+ }
+ }
+
+ /// <summary>
+ /// Returns the set of all the package names (not including version numbers)
+ /// in the "libraries" section of the assets/lock file. Note that this includes
+ /// only proper packages; projects are specifically excluded.
+ /// </summary>
+ private static SortedSet<string> GetAllPackageNames(JObject lockFile)
+ {
+ var allPackageNames = new SortedSet<string>();
+ var libraries = (JObject)lockFile["libraries"];
+ foreach (var library in libraries)
+ {
+ var libraryObject = (JObject)library.Value;
+ string type = (string)libraryObject["type"];
+ if (type != null &&
+ type.Equals("project", StringComparison.OrdinalIgnoreCase))
+ {
+ continue;
+ }
+
+ string name, version;
+ SplitPackageName(library.Key, out name, out version);
+ allPackageNames.Add(name);
+ }
+
+ return allPackageNames;
+ }
+
+ /// <summary>
+ /// Given a set of dependencies, identities the packages and adds their names to <see cref="_referencedPackages"/>.
+ /// </summary>
+ private void AddReferencedPackages(JArray packageDependencies, SortedSet<string> allPackageNames)
+ {
+ foreach (var packageDependency in packageDependencies.Select(v => (string)v))
+ {
+ // Strip the version, if any, from the dependency.
int firstSpace = packageDependency.IndexOf(' ');
+ string packageName = firstSpace > -1
+ ? packageDependency.Substring(0, firstSpace)
+ : packageDependency;
- if (firstSpace > -1)
+ if (allPackageNames.Contains(packageName))
{
- _referencedPackages.Add(new TaskItem(packageDependency.Substring(0, firstSpace)));
+ _referencedPackages.Add(new TaskItem(packageName));
}
}
}
- private string GetNuGetPackagePath(string packageId, string packageVersion)
+ private string GetNuGetPackagePath(string packageId, string packageVersion, string packageRelativePath)
{
+ string relativePathToUse = String.IsNullOrEmpty(packageRelativePath)
+ ? Path.Combine(packageId, packageVersion)
+ : packageRelativePath.Replace('/', Path.DirectorySeparatorChar);
+
+ string hashFileName = $"{packageId.ToLowerInvariant()}.{packageVersion.ToLowerInvariant()}.nupkg.sha512";
+
foreach (var packagesFolder in _packageFolders)
{
- string packagePath = Path.Combine(packagesFolder, packageId, packageVersion);
+ string packageFullPath = Path.Combine(packagesFolder, relativePathToUse);
// The proper way to check if a package is available is to look for the hash file, since that's the last
// file written as a part of the restore process. If it's not there, it means something failed part way through.
- if (_fileExists(Path.Combine(packagePath, $"{packageId}.{packageVersion}.nupkg.sha512")))
+ if (_fileExists(Path.Combine(packageFullPath, hashFileName)))
{
- return packagePath;
+ return packageFullPath;
}
}
@@ -916,10 +959,8 @@ namespace Microsoft.NuGet.Build.Tasks
{
foreach (var package in target)
{
- var nameParts = package.Key.Split('/');
- var id = nameParts[0];
- var version = nameParts[1];
- bool isProject = false;
+ string id, version;
+ SplitPackageName(package.Key, out id, out version);
var libraryObject = (JObject)lockFile["libraries"][package.Key];
@@ -931,38 +972,26 @@ namespace Microsoft.NuGet.Build.Tasks
}
// If this is a project then we need to figure out it's relative output path
- if ((string)libraryObject["type"] == "project")
+ if ("project".Equals((string)libraryObject["type"], StringComparison.OrdinalIgnoreCase))
{
- isProject = true;
-
- fullPackagePathGenerator = () =>
- {
- var relativeMSBuildProjectPath = (string)libraryObject["msbuildProject"];
-
- if (string.IsNullOrEmpty(relativeMSBuildProjectPath))
- {
- throw new ExceptionFromResource(nameof(Strings.MissingMSBuildPathInProjectPackage), id);
- }
-
- var absoluteMSBuildProjectPath = GetAbsolutePathFromProjectRelativePath(relativeMSBuildProjectPath);
- string fullPackagePath;
- if (!_projectReferencesToOutputBasePaths.TryGetValue(absoluteMSBuildProjectPath, out fullPackagePath))
- {
- throw new ExceptionFromResource(nameof(Strings.MissingProjectReference), absoluteMSBuildProjectPath, nameof(ProjectReferencesCreatingPackages));
- }
-
- return fullPackagePath;
- };
+ continue;
}
else
{
- fullPackagePathGenerator = () => GetNuGetPackagePath(id, version);
+ fullPackagePathGenerator = () => GetNuGetPackagePath(id, version, (string)libraryObject["path"]);
}
- yield return new NuGetPackageObject(id, version, isProject, fullPackagePathGenerator, (JObject)package.Value, libraryObject);
+ yield return new NuGetPackageObject(id, version, fullPackagePathGenerator, (JObject)package.Value, libraryObject);
}
}
+ private static void SplitPackageName(string key, out string id, out string version)
+ {
+ var nameParts = key.Split('/');
+ id = nameParts[0];
+ version = nameParts[1];
+ }
+
private string GetAbsolutePathFromProjectRelativePath(string path)
{
return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Path.GetFullPath(ProjectLockFile)), path));
diff --git a/src/Microsoft.NuGet.Build.Tasks/Strings.Designer.cs b/src/Microsoft.NuGet.Build.Tasks/Strings.Designer.cs
index 6d71ed9..9b3de63 100644
--- a/src/Microsoft.NuGet.Build.Tasks/Strings.Designer.cs
+++ b/src/Microsoft.NuGet.Build.Tasks/Strings.Designer.cs
@@ -70,15 +70,6 @@ namespace Microsoft.NuGet.Build.Tasks {
}
/// <summary>
- /// Looks up a localized string similar to The project &apos;{0}&apos; was referenced more than once in the {1} property. Ignoring all but the first..
- /// </summary>
- internal static string DuplicateProjectReference {
- get {
- return ResourceManager.GetString("DuplicateProjectReference", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to Lock file {0} couldn&apos;t be found. Run a NuGet package restore to generate this file..
/// </summary>
internal static string LockFileNotFound {
diff --git a/src/Microsoft.NuGet.Build.Tasks/Strings.resx b/src/Microsoft.NuGet.Build.Tasks/Strings.resx
index 03a7fd1..16d5d64 100644
--- a/src/Microsoft.NuGet.Build.Tasks/Strings.resx
+++ b/src/Microsoft.NuGet.Build.Tasks/Strings.resx
@@ -120,9 +120,6 @@
<data name="DuplicatePreprocessorToken" xml:space="preserve">
<value>The preprocessor token '{0}' has been given more than one value. Choosing '{1}' as the value.</value>
</data>
- <data name="DuplicateProjectReference" xml:space="preserve">
- <value>The project '{0}' was referenced more than once in the {1} property. Ignoring all but the first.</value>
- </data>
<data name="LockFileNotFound" xml:space="preserve">
<value>Lock file {0} couldn't be found. Run a NuGet package restore to generate this file.</value>
</data>