Imported Upstream version 5.0.0.78

Former-commit-id: 1a2c1dd1445940afa663f5da05294270f9574676
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2017-04-26 10:05:10 +00:00
parent 270395db27
commit 5c980d35e6
47 changed files with 696 additions and 245 deletions

View File

@ -216,7 +216,11 @@ namespace Mono.Cecil.Cil {
// PDB Age
buffer.WriteUInt32 (1);
// PDB Path
buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (writer.BaseStream.GetFileName ()));
var filename = writer.BaseStream.GetFileName ();
if (!string.IsNullOrEmpty (filename))
filename = Path.GetFileName (filename);
buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (filename));
buffer.WriteByte (0);
header = new byte [buffer.length];

View File

@ -174,6 +174,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,
@ -201,6 +231,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,

View File

@ -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>

View File

@ -0,0 +1,150 @@
{
"locked": false,
"version": 2,
"targets": {
".NETFramework,Version=v4.5": {
"Newtonsoft.Json/8.0.3": {
"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/8.0.3": {
"sha512": "KGsYQdS2zLH+H8x2cZaSI7e+YZ4SFIbyy1YJQYl6GYBWjf5o4H1A68nxyq+WTyVSOJQ4GqS/DiPE+UseUizgMg==",
"type": "package",
"path": "newtonsoft.json/8.0.3",
"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.8.0.3.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\\": {}
}
}

View File

@ -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": []
}
}
}
}

View File

@ -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>

View File

@ -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) };

View File

@ -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": [ ]
}
}

View File

@ -10,45 +10,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()
{

View File

@ -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);
}
}
}
}

View File

@ -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>

View File

@ -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));
}
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -80,4 +80,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View File

@ -12,10 +12,59 @@ 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>
@ -28,7 +77,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 +90,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 +171,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 +182,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 +225,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 +264,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 +272,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>

View File

@ -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,6 @@ namespace Microsoft.NuGet.Build.Tasks
public string Id { get; }
public string Version { get; }
public bool IsProject { get; }
/// <summary>
/// The JSON object from the "targets" section in the project.lock.json for this package.

View File

@ -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);
@ -142,15 +139,6 @@ namespace Microsoft.NuGet.Build.Tasks
get; set;
}
/// <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>
@ -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);
@ -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,16 +851,83 @@ namespace Microsoft.NuGet.Build.Tasks
private void GetReferencedPackages(JObject lockFile)
{
var projectFileDependencyGroups = (JObject)lockFile["projectFileDependencyGroups"];
var projectFileDependencies = (JArray)projectFileDependencyGroups[""];
var targets = (JObject)lockFile["targets"];
foreach (var packageDependency in projectFileDependencies.Select(v => (string)v))
string targetMoniker = null;
foreach (var preferredTargetMoniker in TargetMonikers)
{
int firstSpace = packageDependency.IndexOf(' ');
var preferredTargetMonikerWithOptionalRuntimeIdentifier = GetTargetMonikerWithOptionalRuntimeIdentifier(preferredTargetMoniker, needsRuntimeIdentifier: false);
var target = (JObject)targets[preferredTargetMonikerWithOptionalRuntimeIdentifier];
if (firstSpace > -1)
if (target != null)
{
_referencedPackages.Add(new TaskItem(packageDependency.Substring(0, firstSpace)));
targetMoniker = preferredTargetMonikerWithOptionalRuntimeIdentifier;
break;
}
}
var projectFileDependencyGroups = (JObject)lockFile["projectFileDependencyGroups"];
var allPackageNames = GetAllPackageNames(lockFile);
if (targetMoniker != null)
{
var targetSpecificDependencies = (JArray)projectFileDependencyGroups[targetMoniker];
if (targetSpecificDependencies != null)
{
AddReferencedPackages(targetSpecificDependencies, allPackageNames);
}
}
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 (allPackageNames.Contains(packageName))
{
_referencedPackages.Add(new TaskItem(packageName));
}
}
}
@ -916,10 +953,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 +966,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);
}
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));

View File

@ -69,15 +69,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>

View File

@ -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>

View File

@ -901,12 +901,11 @@ namespace System.Net.Sockets
SocketAsyncResult ares;
if (!GetCheckedIPs (e, out addresses)) {
e.socket_async_result.EndPoint = e.RemoteEndPoint;
//NOTE: DualMode may cause Socket's RemoteEndpoint to differ in AddressFamily from the
// SocketAsyncEventArgs, but the SocketAsyncEventArgs itself is not changed
ares = (SocketAsyncResult) BeginConnect (e.RemoteEndPoint, ConnectAsyncCallback, e);
} else {
DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
e.socket_async_result.Addresses = addresses;
e.socket_async_result.Port = dep.Port;
DnsEndPoint dep = (DnsEndPoint)e.RemoteEndPoint;
ares = (SocketAsyncResult) BeginConnect (addresses, dep.Port, ConnectAsyncCallback, e);
}
@ -984,8 +983,8 @@ namespace System.Net.Sockets
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
return sockares;
}
end_point = RemapIPEndPoint (ep);
sockares.EndPoint = end_point = RemapIPEndPoint (ep);
}
int error = 0;

View File

@ -1 +1 @@
5473cf3916b998b25e4b8dcf2f55fb2b14a3f1e0
8cd738dc676c2d39164f5615b57fef3320819aed

View File

@ -62,6 +62,7 @@ namespace System.Reflection.Emit {
private FieldBuilder[] global_fields;
bool is_main;
private MonoResource[] resources;
private IntPtr unparented_classes;
#endregion
#pragma warning restore 169, 414

View File

@ -79,6 +79,7 @@ namespace System.Reflection.Emit
private GenericTypeParameterBuilder[] generic_params;
private RefEmitPermissionSet[] permissions;
private TypeInfo created;
private int state;
#endregion
#pragma warning restore 169

View File

@ -1 +1 @@
19be52d9a91b4b96f644a19d9b239df623d3ac66
c145c6770452545322a5dd359447663fa340d536

View File

@ -1 +1 @@
9730a8aa4510c1e02ddaf93e1b0858f961a19d27
066bc9062048be6b18ca61602d127caa45a9e448

View File

@ -1 +1 @@
7371a053c5c8987cffb8e4d67eee423567c42a84
7994e5dac7692b46aba8982a568232486c9ab689

View File

@ -1828,8 +1828,10 @@ mono_make_shadow_copy (const char *filename, MonoError *oerror)
sibling_source_len = strlen (sibling_source);
sibling_target = g_strconcat (shadow, ".config", NULL);
sibling_target_len = strlen (sibling_target);
copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".mdb", sibling_target, sibling_target_len, 7);
if (copy_result)
copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".pdb", sibling_target, sibling_target_len, 11);
if (copy_result)
copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".config", sibling_target, sibling_target_len, 7);

View File

@ -1150,6 +1150,7 @@ static const IgnoredAssembly ignored_assemblies [] = {
IGNORED_ASSEMBLY (0x27726A90, SYS_NET_HTTP, "269B562C-CC15-4736-B1B1-68D4A43CAA98", "4.1.0 net46"),
IGNORED_ASSEMBLY (0x10CADA75, SYS_NET_HTTP, "EA2EC6DC-51DD-479C-BFC2-E713FB9E7E47", "4.1.1 net46"),
IGNORED_ASSEMBLY (0x8437178B, SYS_NET_HTTP, "C0E04D9C-70CF-48A6-A179-FBFD8CE69FD0", "4.3.0 net46"),
IGNORED_ASSEMBLY (0xFAFDA422, SYS_NET_HTTP, "817F01C3-4011-477D-890A-98232B85553D", "4.3.1 net46"),
IGNORED_ASSEMBLY (0x4A15555E, SYS_REF_DISP_PROXY, "E40AFEB4-CABE-4124-8412-B46AB79C92FD", "4.0.0 net46"),
IGNORED_ASSEMBLY (0xD20D9783, SYS_REF_DISP_PROXY, "2A69F0AD-B86B-40F2-8E4C-5B671E47479F", "4.0.1 netstandard1.3"),
IGNORED_ASSEMBLY (0xA33A7E68, SYS_REF_DISP_PROXY, "D4E8D2DB-BD65-4168-99EA-D2C1BDEBF9CC", "4.3.0 netstandard1.3"),

View File

@ -1182,11 +1182,18 @@ typedef struct {
MonoArray *global_fields;
gboolean is_main;
MonoArray *resources;
GHashTable *unparented_classes;
} MonoReflectionModuleBuilder;
/* Safely acess System.Reflection.Emit.ModuleBuidler from native code */
TYPED_HANDLE_DECL (MonoReflectionModuleBuilder);
typedef enum {
MonoTypeBuilderNew = 0,
MonoTypeBuilderEntered = 1,
MonoTypeBuilderFinished = 2
} MonoTypeBuilderState;
typedef struct {
MonoReflectionType type;
MonoString *name;
@ -1212,6 +1219,7 @@ typedef struct {
MonoArray *generic_params;
MonoArray *permissions;
MonoReflectionType *created;
gint32 state;
} MonoReflectionTypeBuilder;
/* Safely access System.Reflection.Emit.TypeBuilder from native code */

View File

@ -1 +1 @@
fbde1f1cc0fd3e00e6281d61ab0b514512a03609
276dd704cf9028688997bee53c1446b26dacbe41

View File

@ -878,7 +878,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in
version.h: Makefile
echo "#define FULL_VERSION \"Stable 5.0.0.61/4242008\"" > version.h
echo "#define FULL_VERSION \"Stable 5.0.0.78/ba317ed\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -878,7 +878,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in
version.h: Makefile
echo "#define FULL_VERSION \"Stable 5.0.0.61/4242008\"" > version.h
echo "#define FULL_VERSION \"Stable 5.0.0.78/ba317ed\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -1 +1 @@
434fe4e634a1bfba7eb1b7d400bb980490f1e895
43f05751d1510288b0377dca9681ef0ce35220e4

View File

@ -340,7 +340,9 @@ typedef struct MonoCompileArch {
#define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
#define MONO_ARCH_HAVE_CONTEXT_SET_INT_REG 1
#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
#ifndef TARGET_IOS
#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT 1
#endif
#define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
#define MONO_ARCH_GSHAREDVT_SUPPORTED 1
#define MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE 1

View File

@ -158,7 +158,9 @@ typedef struct {
#define MONO_ARCH_HAVE_OPCODE_NEEDS_EMULATION 1
#define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1
#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
#ifndef TARGET_IOS
#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT 1
#endif
#ifdef TARGET_IOS

View File

@ -1 +1 @@
#define FULL_VERSION "Stable 5.0.0.61/4242008"
#define FULL_VERSION "Stable 5.0.0.78/ba317ed"

Binary file not shown.

View File

@ -1 +1 @@
760fdff9f33684cc748d1e946bb6c13a689618e8
e24d53b5deb30e0255f8f5d1457e99298016ed65

Binary file not shown.

View File

@ -1 +1 @@
1a6e2559d7a80797c4b973e659acc65b68c848ef
9ad00c7bcea194d143236d71d8eca42f1d5bde49

Binary file not shown.

View File

@ -1 +1 @@
5d060c5c9574e03c012c0535098ff6fda7f95bf8
8622211a0047f49ef23940df6e000e29f029a615

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mono 5.0.0\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2017-04-19 15:43+0000\n"
"POT-Creation-Date: 2017-04-26 09:54+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
b85343d1642203f49c23501b87fd68392a48afa0
255e57977118fef3187ede3a0ff62dd3a09ca217