Remove redundant references and fixup MSBuild target test
This commit is contained in:
Родитель
0e6cf70fcc
Коммит
a91f16ee10
|
@ -30,20 +30,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Threading.Tasks">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -22,16 +22,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks" />
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="3.13.5" />
|
||||
<PackageReference Include="Microsoft.Azure.KeyVault" Version="2.0.6" />
|
||||
|
|
|
@ -25,10 +25,4 @@
|
|||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -26,12 +26,6 @@
|
|||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
||||
<PackageReference Include="System.Threading.Thread" Version="4.4.0-*" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -22,15 +22,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -22,15 +22,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
||||
|
|
|
@ -29,17 +29,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -22,21 +22,15 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
||||
<PackageReference Include="System.Xml.XmlDocument" Version="4.4.0-*" />
|
||||
<PackageReference Include="System.Xml.XmlSerializer" Version="4.4.0-*" />
|
||||
|
|
|
@ -25,20 +25,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Threading.Tasks">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -32,9 +32,4 @@
|
|||
<PackageReference Include="Microsoft.NETCore.App" Version="1.2.0-*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -32,9 +32,4 @@
|
|||
<PackageReference Include="Microsoft.NETCore.App" Version="1.2.0-*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -22,14 +22,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -21,14 +21,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -27,23 +27,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Security">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -25,17 +25,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -25,17 +25,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -23,9 +23,4 @@
|
|||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -22,14 +22,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -27,15 +27,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
|
|
|
@ -42,10 +42,12 @@ namespace Microsoft.Extensions.Configuration.UserSecrets
|
|||
}
|
||||
var target = Path.Combine(_solutionRoot.FullName, "src", "Microsoft.Extensions.Configuration.UserSecrets", "build", "netstandard1.0", "Microsoft.Extensions.Configuration.UserSecrets.targets");
|
||||
Directory.CreateDirectory(Path.Combine(_tempDir, "obj"));
|
||||
var libName = "Microsoft.Extensions.Configuration.UserSecrets.dll";
|
||||
File.Copy(Path.Combine(AppContext.BaseDirectory, libName), Path.Combine(_tempDir, libName));
|
||||
File.Copy(target, Path.Combine(_tempDir, "obj", "test.csproj.usersecretstest.targets")); // imitates how NuGet will import this target
|
||||
var testProj = Path.Combine(_tempDir, "test.csproj");
|
||||
// should represent a 'dotnet new' project
|
||||
File.WriteAllText(testProj, @"
|
||||
File.WriteAllText(testProj, $@"
|
||||
<Project Sdk=""Microsoft.NET.Sdk"" ToolsVersion=""15.0"">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
@ -55,6 +57,7 @@ namespace Microsoft.Extensions.Configuration.UserSecrets
|
|||
<ItemGroup>
|
||||
<Compile Include=""Program.cs""/>
|
||||
<PackageReference Include=""Microsoft.NETCore.App"" Version=""1.0.1"" />
|
||||
<Reference Include=""$(MSBuildThisFileDirectory){libName}"" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
");
|
||||
|
@ -82,16 +85,18 @@ namespace Microsoft.Extensions.Configuration.UserSecrets
|
|||
UseShellExecute = false,
|
||||
WorkingDirectory = _tempDir
|
||||
};
|
||||
Process.Start(buildInfo).WaitForExit();
|
||||
// build will fail because the test proj doesn't reference UserSecrets.dll
|
||||
// but that's okay. We just want to verify the target generates code correctly
|
||||
var build = Process.Start(buildInfo);
|
||||
build.WaitForExit();
|
||||
Assert.Equal(0, build.ExitCode);
|
||||
|
||||
Assert.True(File.Exists(assemblyInfoFile));
|
||||
var contents = File.ReadAllText(assemblyInfoFile);
|
||||
Assert.Contains("[assembly: Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute(\"xyz123\")]", contents);
|
||||
var lastWrite = new FileInfo(assemblyInfoFile).LastWriteTimeUtc;
|
||||
|
||||
Process.Start(buildInfo).WaitForExit();
|
||||
var rebuild = Process.Start(buildInfo);
|
||||
rebuild.WaitForExit();
|
||||
Assert.Equal(0, rebuild.ExitCode);
|
||||
// asserts that the target doesn't re-generate assembly file. Important for incremental build.
|
||||
Assert.Equal(lastWrite, new FileInfo(assemblyInfoFile).LastWriteTimeUtc);
|
||||
}
|
||||
|
@ -100,7 +105,7 @@ namespace Microsoft.Extensions.Configuration.UserSecrets
|
|||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete(_tempDir, recursive: true);
|
||||
// Directory.Delete(_tempDir, recursive: true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -26,20 +26,12 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System.Runtime">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Security">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<FromP2P>true</FromP2P>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче