Updating the version of msbuild to 15.1.0-preview-000516-03 (#5266)

* Updating the version of msbuild to 15.1.0-preview-000516-03

* Remove test that assumes props/targets imports

The test ItAddsRefBetweenImports validated that the MSBuild XML model contained new project references between the props and targets imports. While useful be fore the SDK attribute, the test no longer adds value since the SDK is added implicitly, guaranteeing it wraps the remaining project contents.

* Move MSBuild to 15.1.0-preview-000509-03

This is the last msbuild version prior to the change of MSBuild's dependencies to include .NET 1.1 components.

* Move MSBuild invocations to use dirs.props/dirs.tasks

* Put back the test targets. We'll unify later.

* Remove dirs.props props from templates msbuild invocation
This commit is contained in:
Livar 2017-01-11 01:49:22 -08:00 committed by Piotr Puszkiewicz
parent ad6fab0a15
commit 4b82852d56
7 changed files with 15 additions and 64 deletions

View file

@ -1,9 +1,6 @@
<Project ToolsVersion="15.0" DefaultTargets="CopyTemplateToOutput"> <Project ToolsVersion="15.0" DefaultTargets="CopyTemplateToOutput">
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 --> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<!-- renaming the property because the original property is a global property and therefore <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
cannot be redefined at runtime. -->
<Import Project="Microsoft.DotNet.Cli.tasks" />
<Target Name="CopyTemplateToOutput" <Target Name="CopyTemplateToOutput"
DependsOnTargets="PrepareBundledTemplateProps; DependsOnTargets="PrepareBundledTemplateProps;

View file

@ -270,8 +270,6 @@
<ItemGroup> <ItemGroup>
<TemplatesToBundle Include="build/Microsoft.DotNet.Cli.BundledTemplates.proj"> <TemplatesToBundle Include="build/Microsoft.DotNet.Cli.BundledTemplates.proj">
<Properties> <Properties>
CLIBuildDll=$(CLIBuildDll);
NuGetPackagesDir=$(NuGetPackagesDir);
TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates; TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates;
TemplatePackageName=%(BundledTemplate.Identity); TemplatePackageName=%(BundledTemplate.Identity);
TemplatePackageVersion=%(BundledTemplate.Version); TemplatePackageVersion=%(BundledTemplate.Version);

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<CLI_MSBuild_Version>15.1.0-preview-000503-01</CLI_MSBuild_Version> <CLI_MSBuild_Version>15.1.0-preview-000509-03</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.0.0-rc3-61212-03</CLI_Roslyn_Version> <CLI_Roslyn_Version>2.0.0-rc3-61212-03</CLI_Roslyn_Version>
<CLI_NETSDK_Version>1.0.0-alpha-20170111-1</CLI_NETSDK_Version> <CLI_NETSDK_Version>1.0.0-alpha-20170111-1</CLI_NETSDK_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170106-1-203</CLI_WEBSDK_Version> <CLI_WEBSDK_Version>1.0.0-alpha-20170106-1-203</CLI_WEBSDK_Version>

View file

@ -36,7 +36,7 @@
<ItemGroup> <ItemGroup>
<ProjectsToTest Include="build/test/RunTest.proj"> <ProjectsToTest Include="build/test/RunTest.proj">
<Properties> <Properties>
CLIBuildDll=$(CLIBuildDll); CLIBuildDll=$(CLIBuildDll);
Configuration=$(Configuration); Configuration=$(Configuration);
EnvironmentVariables=$(RunTestEnvironmentVariables); EnvironmentVariables=$(RunTestEnvironmentVariables);
TestProject=%(TestProjects.ProjectPath); TestProject=%(TestProjects.ProjectPath);

View file

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTarget="RunTest" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTarget="RunTest" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 --> <!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
<!-- renaming the property because the original property is a global property and therefore <!-- renaming the property because the original property is a global property and therefore
cannot be redefined at runtime. --> cannot be redefined at runtime. -->
<PropertyGroup> <PropertyGroup>
<CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath> <CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath>
</PropertyGroup> </PropertyGroup>
<UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDllPath)" /> <UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDllPath)" />
<Target Name="RunTest"> <Target Name="RunTest">
<DotNetTest EnvironmentVariables="$(EnvironmentVariables)" <DotNetTest EnvironmentVariables="$(EnvironmentVariables)"
ToolPath="$(ToolPath)" ToolPath="$(ToolPath)"

View file

@ -132,5 +132,6 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \
-e CHECKSUM_STORAGE_KEY \ -e CHECKSUM_STORAGE_KEY \
-e CHECKSUM_STORAGE_ACCOUNT \ -e CHECKSUM_STORAGE_ACCOUNT \
-e CHECKSUM_STORAGE_CONTAINER \ -e CHECKSUM_STORAGE_CONTAINER \
-e CLIBUILD_SKIP_TESTS \
$DOTNET_BUILD_CONTAINER_TAG \ $DOTNET_BUILD_CONTAINER_TAG \
$BUILD_COMMAND "$@" $BUILD_COMMAND "$@"

View file

@ -536,51 +536,6 @@ Reference `DotnetAddP2PProjects\ValidRef\ValidRef.csproj` added to the project."
csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1);
} }
[Fact]
public void ItAddsRefBetweenImports()
{
var lib = NewLibWithFrameworks();
var setup = Setup();
var cmd = new AddReferenceCommand()
.WithWorkingDirectory(lib.Path)
.WithProject(lib.CsProjName)
.Execute($"\"{setup.ValidRefCsprojPath}\"");
cmd.Should().Pass();
cmd.StdOut.Should().Be("Reference `DotnetAddP2PProjects\\ValidRef\\ValidRef.csproj` added to the project.");
cmd.StdErr.Should().BeEmpty();
int state = 0;
foreach (var el in lib.CsProj().AllChildren)
{
var import = el as ProjectImportElement;
var projRef = el as ProjectItemElement;
switch (state)
{
case 0:
if (import != null && import.Project.EndsWith(".props"))
{
state++;
}
break;
case 1:
if (projRef != null && projRef.ItemType == "ProjectReference" && projRef.Include.Contains(setup.ValidRefCsprojName))
{
state++;
}
break;
case 2:
if (import != null && import.Project.EndsWith(".targets"))
{
state++;
}
break;
}
}
state.Should().Be(3);
}
[Fact] [Fact]
public void WhenPassedReferenceDoesNotExistItShowsAnError() public void WhenPassedReferenceDoesNotExistItShowsAnError()
{ {