Remove buildtools imports from Directory.Build.* (dotnet/corefx#34001)
authorEric StJohn <ericstj@microsoft.com>
Mon, 28 Jan 2019 22:18:49 +0000 (14:18 -0800)
committerGitHub <noreply@github.com>
Mon, 28 Jan 2019 22:18:49 +0000 (14:18 -0800)
* Remove buildtools imports from Directory.Build.*

Remove buildtools imports and implement remaining functionality in CoreFx.

I was able to do most of what BuildTools was doing with 3 exceptions, which will be split into separate issues.
1. Test shared framework deps file: GenerateDepsJson.  We need to port this task to arcade or change how we test to not need it.
2. codeOptimization.targets -> should be moved to arcade, work is pending.
3. optionalTooling.targets -> move to a CSProj that is restored by the official build workflow.

* Address feedack, fix unix and UAP build issues

* Fix UWP, Tizen, and AllConfigurations build

* Remove buildtools dependency from package testing

* Remove a few more buildtools dependencies

* Eliminate RunningOnUnix property

* Remove NuGetTargetMoniker from shims.proj

* Remove ResourcesFolderPath

* Fix Microsoft.XmlSerializer.Generator.Tests

* Specify NuGetTargetMoniker for shims

* Remove a couple remaining ToolsDir uses

Commit migrated from https://github.com/dotnet/corefx/commit/49d249fa023e8575dba7e35febb4446e4fa13f98

19 files changed:
eng/BlockReflectionAttribute.cs [new file with mode: 0644]
eng/blockReflectionAttribute.targets [new file with mode: 0644]
eng/illink.targets
eng/referenceFromRuntime.targets
eng/references.targets [new file with mode: 0644]
eng/versioning.targets
src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets
src/libraries/Microsoft.XmlSerializer.Generator/tests/Microsoft.XmlSerializer.Generator.Tests.csproj
src/libraries/SharedFrameworkValidation/SharedFrameworkValidation.proj
src/libraries/build.proj
src/libraries/dir.traversal.targets
src/libraries/dirs.proj
src/libraries/external/runtime/runtime.depproj
src/libraries/packages.builds
src/libraries/pkg/test/packageTest.targets
src/libraries/pkg/test/testPackages.proj
src/libraries/shims/Directory.Build.props
src/libraries/shims/shims.proj
src/libraries/tests.builds

diff --git a/eng/BlockReflectionAttribute.cs b/eng/BlockReflectionAttribute.cs
new file mode 100644 (file)
index 0000000..5e9573e
--- /dev/null
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// Defining __BlockReflectionAttribute indicates that the .NET Native toolchain should remove metadata for all non-public APIs.
+// This reduces size and disables private reflection on those APIs. 
+// The attribute can also be applied to individual public APIs to similarly block them.
+
+using System;
+
+namespace System.Runtime.CompilerServices
+{
+    [AttributeUsage(AttributeTargets.All)]
+    internal class __BlockReflectionAttribute : Attribute { }
+}
diff --git a/eng/blockReflectionAttribute.targets b/eng/blockReflectionAttribute.targets
new file mode 100644 (file)
index 0000000..b42b030
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+  <!--
+      Defining __BlockReflectionAttribute indicates that the .NET Native toolchain should remove the metadata for all non-public APIs.
+      This reduces size and disables private reflection on those APIs.
+      The attribute can also be applied to individual public APIs to similarly block them.
+   -->
+  <PropertyGroup>
+    <BlockReflectionAttribute Condition="'$(BlockReflectionAttribute)' == '' and '$(UWPCompatible)' == 'true' and '$(IsTestProject)' != 'true'">true</BlockReflectionAttribute>
+    <BlockReflectionAttribute Condition="'$(MSBuildProjectExtension)' != '.csproj'">false</BlockReflectionAttribute>
+  </PropertyGroup>
+
+  <ItemGroup Condition="'$(BlockReflectionAttribute)'=='true'">
+    <Compile Include="$(MSBuildThisFileDirectory)/BlockReflectionAttribute.cs" />
+  </ItemGroup>
+</Project>
index 35c5cc9..3dd5e21 100644 (file)
@@ -10,8 +10,8 @@
 
   <!-- Inputs and outputs of ILLinkTrimAssembly -->
   <PropertyGroup>
-    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(RunningOnCore)' == 'true'">$(ToolsDir)ILLink/netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
-    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(RunningOnCore)' != 'true'">$(ToolsDir)ILLink/net46/ILLink.Tasks.dll</ILLinkTasksPath>
+    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' == 'core'">$(ToolsDir)ILLink/netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
+    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' != 'core'">$(ToolsDir)ILLink/net46/ILLink.Tasks.dll</ILLinkTasksPath>
     <ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
     <ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
     <ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
@@ -63,7 +63,7 @@
        rewriting the assembly to an "output assembly"
   -->
   <UsingTask TaskName="ILLink" AssemblyFile="$(ILLinkTasksPath)" />
-  <Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'" DependsOnTargets="EnsureBuildToolsRuntime">
+  <Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'">
     <PropertyGroup>
       <ILLinkArgs>$(ILLinkArgs)-r $(TargetName)</ILLinkArgs>
       <!-- default action for core assemblies -->
index cc68e43..5a87f36 100644 (file)
@@ -11,7 +11,7 @@
   </Target>
 
   <Target Name="AddRuntimeProjectReference"
-          BeforeTargets="AddProjectReferencesDynamically"
+          BeforeTargets="AddReferencesDynamically"
           Condition="'$(IsTestProject)'!='true' AND '@(ReferenceFromRuntime)' != ''">
     <Error Condition="('$(IsReferenceAssembly)' != 'true' OR '$(AllowReferenceFromRuntime)' == 'true') AND '$(RuntimeProjectFile)' == ''" Text="RuntimeProjectFile must be specified when using ReferenceFromRuntime from source projects." />
     <Error Condition="'$(IsReferenceAssembly)' == 'true' AND '$(AllowReferenceFromRuntime)' != 'true'" Text="ReferenceFromRuntime may not be used from reference assemblies." />
diff --git a/eng/references.targets b/eng/references.targets
new file mode 100644 (file)
index 0000000..7c9f43f
--- /dev/null
@@ -0,0 +1,38 @@
+<Project>
+  <PropertyGroup>
+    <ContractOutputPath>$(RefPath)</ContractOutputPath>
+    <FrameworkPathOverride>$(ContractOutputPath)</FrameworkPathOverride>
+    <AssemblySearchPaths>$(AssemblySearchPaths);$(ContractOutputPath);{RawFileName}</AssemblySearchPaths>
+    <!-- Disable RAR from transitively discovering dependencies for References -->
+    <_FindDependencies>false</_FindDependencies>
+    <!--
+      We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder
+      that exists to skip the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644).
+      Need to set these after the common targets import.
+      -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(IncludeDefaultReferences)' == ''">
+    <IncludeDefaultReferences Condition="'$(MSBuildProjectExtension)' == '.csproj'">true</IncludeDefaultReferences>
+    <IncludeDefaultReferences Condition="'$(MSBuildProjectExtension)' == '.vbproj'">true</IncludeDefaultReferences>
+  </PropertyGroup>
+  <Target Name="SetupDefaultReferences">
+    <ItemGroup Condition="'$(IncludeDefaultReferences)' =='true'">
+      <!-- netstandard is a default reference whenever building for NETStandard or building an implementation assembly -->
+      <DefaultReference Condition="($(NuGetTargetMoniker.StartsWith('.NETStandard')) OR '$(IsReferenceAssembly)' != 'true') AND Exists('$(RefPath)netstandard.dll')" Include="netstandard" />
+    </ItemGroup>
+  </Target>
+  <Target Name="UpdateReferenceItems" DependsOnTargets="SetupDefaultReferences" BeforeTargets="AddReferencesDynamically">
+    <ItemGroup>
+      <Reference Include="@(DefaultReference)" />
+    </ItemGroup>
+    <ItemGroup>
+      <!-- Simple name references will be resolved from the targeting pack folders and should never be copied to output -->
+      <Reference Condition="'%(Reference.Extension)' != '.dll'">
+        <Private>false</Private>
+      </Reference>
+    </ItemGroup>
+  </Target>
+  <Target Name="AddReferencesDynamically" BeforeTargets="BeforeResolveReferences;ResolveAssemblyReferences" />
+</Project>
\ No newline at end of file
index 409d447..8e1eb8c 100644 (file)
@@ -8,6 +8,19 @@
     <AssemblyInfoFile Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(IntermediateOutputPath)_AssemblyInfo.vb</AssemblyInfoFile>
   </PropertyGroup>
 
+  <!-- Assembly metadata indicating that an assembly is a framework (as opposed to user) assembly:
+       Test projects need to not have this because of the way "IsFrameworkAssembly" APIs work to check this. -->
+  <ItemGroup Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' AND '$(IsTestProject)' != 'true'" >
+    <AssemblyMetadata Include=".NETFrameworkAssembly">
+      <Value></Value>
+    </AssemblyMetadata>
+    <AssemblyMetadata Include="Serviceable">
+      <Value>True</Value>
+    </AssemblyMetadata>
+    <AssemblyMetadata Include="PreferInbox">
+      <Value>True</Value>
+    </AssemblyMetadata>
+  </ItemGroup>
 
   <Target Name="DecideIfWeNeedToIncludeDllSafeSearchPathAttribute"
     Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' AND '$(IsTestProject)' != 'true'">
index 2e3013e..d6774f2 100644 (file)
@@ -10,7 +10,7 @@
 
   <!-- MSBuild for .NET Core doesn't support XslTransform at this time -->
   <Target Name="CompileAsn" BeforeTargets="CoreCompile"
-    Condition="'$(RunningOnCore)' != 'true'"
+    Condition="'$(MSBuildRuntimeType)' != 'core'"
     Inputs="@(AsnXml);$(MSBuildThisFileDirectory)asn.xslt"
     Outputs="%(Identity).cs">
 
@@ -21,7 +21,7 @@
       XmlInputPaths="@(AsnXml)"
       OutputPaths="@(AsnXml -> '$(IntermediateOutputPath)asnxml\%(filename).cs')" />
 
-    <Exec Condition="'$(RunningOnUnix)' != 'true'"
+    <Exec Condition="'$(OS)'=='Windows_NT'"
       IgnoreExitCode="true"
       StandardOutputImportance="Low"
       Command="$(SystemRoot)\System32\fc.exe /a @(AsnXml -> '$(IntermediateOutputPath)asnxml\%(filename).cs') @(AsnXml -> '%(Identity).cs')">
@@ -29,7 +29,7 @@
     </Exec>
 
     <!-- TODO: Call diff on Unix -->
-    <ItemGroup Condition="'$(RunningOnUnix)' == 'true'">
+    <ItemGroup Condition="'$(OS)'!='Windows_NT'">
       <_AsnXmlDiffCode Include="1" />
     </ItemGroup>
 
index 7b90390..ea1f038 100644 (file)
@@ -16,9 +16,9 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(TargetGroup)' != 'netcoreapp'">
     <!-- We're building some non-netcoreapp target, run on the Tools CLI.
-         Reuse the same runtimeconfig used by CSC. -->
-    <GeneratorRuntimeConfig>$(ToolsDir)csc.runtimeconfig.json</GeneratorRuntimeConfig>
-    <GeneratorCliPath>$(ToolsDir)dotnetcli/</GeneratorCliPath>
+         Reuse the same runtimeconfig used by MSBuild. -->
+    <GeneratorRuntimeConfig>$(MSBuildToolsPath)\msbuild.runtimeconfig.json</GeneratorRuntimeConfig>
+    <GeneratorCliPath>$(DotNetRoot)</GeneratorCliPath>
   </PropertyGroup>
   <ItemGroup Condition=" '$(SkipTestsOnPlatform)' != 'true' ">
     <Compile Include=".\SGenTests.cs" />
index 7465b69..7a50642 100644 (file)
@@ -8,21 +8,21 @@
     <_LKGSharedFrameworkVersion>1.1.2</_LKGSharedFrameworkVersion>
     <SharedFrameworkExtractPath>$(RefRootPath)sharedFrameworkZip/shared/Microsoft.NETCore.App/$(MicrosoftNETCoreAppPackageVersion)</SharedFrameworkExtractPath>
     <LKGSharedFrameworkExtractPath>$(RefRootPath)sharedFrameworkZip.LKG/shared/Microsoft.NETCore.App/$(_LKGSharedFrameworkVersion)</LKGSharedFrameworkExtractPath>
-    <_RunTestsScriptName Condition="'$(RunningOnUnix)' != 'true'">CloneAndRunTests.cmd</_RunTestsScriptName>
-    <_RunTestsScriptName Condition="'$(RunningOnUnix)' == 'true'">CloneAndRunTests.sh</_RunTestsScriptName>
+    <_RunTestsScriptName Condition="'$(OS)' == 'Windows_NT'">CloneAndRunTests.cmd</_RunTestsScriptName>
+    <_RunTestsScriptName Condition="'$(OS)' != 'Windows_NT'">CloneAndRunTests.sh</_RunTestsScriptName>
   </PropertyGroup>
 
   <Target Name="CreateScriptToDownloadSharedFrameworkZip">
 
-    <ItemGroup Condition="'$(RunningOnUnix)' != 'true'">
+    <ItemGroup Condition="'$(OS)' == 'Windows_NT'">
       <_DownloadSharedFrameworkScriptLines Include="Invoke-WebRequest %22https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1%22 -OutFile $(ToolsDir.Replace('/', '\'))bootstrap.ps1" />
       <_DownloadSharedFrameworkScriptLines Include="%26 %22$(ToolsDir.Replace('/', '\'))bootstrap.ps1%22 -Channel %22master%22 -SharedRuntime -Version %22$(MicrosoftNETCoreAppPackageVersion)%22 -InstallDir %22$(RefRootPath.Replace('/', '\'))sharedFrameworkZip%22 | Out-File %22$(BinDir.Replace('/', '\'))bootstrap.log%22" />
       <_DownloadSharedFrameworkScriptLines Include="%26 %22$(ToolsDir.Replace('/', '\'))bootstrap.ps1%22 -Channel %22rel-1.1.0%22 -InstallDir %22$(RefRootPath.Replace('/', '\'))sharedFrameworkZip.LKG%22 | Out-File %22$(BinDir.Replace('/', '\'))bootstrap.LKG.log%22" />
     </ItemGroup>
 
     <PropertyGroup>
-      <_ScriptName Condition="'$(RunningOnUnix)' != 'true'">$(BinDir)DownloadSharedFramework.ps1</_ScriptName>
-      <_ScriptName Condition="'$(RunningOnUnix)' == 'true'">$(BinDir)DownloadSharedFramework.sh</_ScriptName>
+      <_ScriptName Condition="'$(OS)' == 'Windows_NT'">$(BinDir)DownloadSharedFramework.ps1</_ScriptName>
+      <_ScriptName Condition="'$(OS)' != 'Windows_NT'">$(BinDir)DownloadSharedFramework.sh</_ScriptName>
     </PropertyGroup>
 
     <ItemGroup Condition="'$(RunningOnUnix)' == 'true'">
     </PropertyGroup>
 
     <!-- Windows script -->
-    <ItemGroup Condition="'$(RunningOnUnix)'!='true'">
+    <ItemGroup Condition="'$(OS)'=='Windows_NT'">
       <_CloneRepoLines Include="@echo off" />
       <_CloneRepoLines Include="pushd $(CoreFxCopyLocation.Replace('/', '\'))" />
       <_CloneRepoLines Include="git clone $(_RepoURL)" />
     </ItemGroup>
 
     <!-- Unix script -->
-    <ItemGroup Condition="'$(RunningOnUnix)'=='true'">
+    <ItemGroup Condition="'$(OS)'!='Windows_NT'">
       <_CloneRepoLines Include="#!/usr/bin/env bash" />
       <_CloneRepoLines Include="__scriptpath=%24(cd %22%24(dirname %22%240%22)%22%3B pwd -P)" />
       <_CloneRepoLines Include="cd $(CorefxCopyLocation.Replace('\', '/'))" />
index f357550..2492e34 100644 (file)
@@ -23,6 +23,7 @@
     <ProjectProperties>Configuration=$(BuildConfiguration)</ProjectProperties>
   </PropertyGroup>
 
+  <!-- remove once we no longer use maestro v1 updating -->
   <Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
 
   <Import Project="Directory.Build.targets" />
@@ -75,8 +76,6 @@
     <MSBuild Projects="@(_PackProjects)" Properties="$(ProjectProperties)" />
   </Target>
 
-  <Import Project="$(ToolsDir)clean.targets" />
-
   <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
 
   <Target Name="Clean">
index 7c7e3c8..1b8c4b0 100644 (file)
     <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
   </Target>
 
-  <!-- Dumpling.targets needs to install dumpling.py before running tests. -->
-  <!-- Disabling dumpling for the time being since the script only runs on python 2: https://github.com/dotnet/core-eng/issues/4753 -->
-  <!-- <Import Project="$(ToolsDir)Dumpling.targets" Condition="Exists('$(ToolsDir)Dumpling.targets') AND ('$(EnableDumpling)' == 'true' OR '$(EnableCloudTest)' == 'true')" /> -->
-
   <Target Name="GetFilesToPackage"
           DependsOnTargets="FilterProjects"
           Returns="@(FilesToPackage)">
index f380fcd..976d975 100644 (file)
@@ -1,4 +1,4 @@
-<Project ToolsVersion="14.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project>
   <Import Project="Directory.Build.props" />
 
   <!-- required to build the projects in their specified order -->
     <Project Include="shims\manual\*.csproj" />
     <Project Include="shims\ApiCompat.proj" />
   </ItemGroup>
+  
+  <PropertyGroup>
+    <GenerateDepsJsonTaskDll>$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll</GenerateDepsJsonTaskDll>
+  </PropertyGroup>
 
-  <UsingTask TaskName="GenerateDepsJson" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
+  <UsingTask TaskName="GenerateDepsJson" AssemblyFile="$(GenerateDepsJsonTaskDll)"/>
   <!-- After we build all the source libraries we need to generate a deps.json file for the shared test framework -->
   <Target Name="GenerateTestSharedFrameworkDepsFile" AfterTargets="BuildAllProjects" Condition="'$(BinplaceTestSharedFramework)' == 'true'">
 
 
   <Import Project="..\dir.traversal.targets" />
 
-  <Import Project="$(ToolsDir)packages.targets" Condition="Exists('$(ToolsDir)packages.targets') and '$(ImportGetNuGetPackageVersions)' != 'false'" />
-  <Import Project="$(ToolsDir)UpdateBuildValues.targets" Condition="Exists('$(ToolsDir)UpdateBuildValues.targets')" />
-
-  <PropertyGroup Condition="Exists('$(ToolsDir)packages.targets') and '$(ImportGetNuGetPackageVersions)' != 'false'">
-    <TraversalBuildDependsOn>
-      $(TraversalBuildDependsOn);
-      BuildPackages;
-    </TraversalBuildDependsOn>
-  </PropertyGroup>
-
-  <PropertyGroup Condition="Exists('$(ToolsDir)toolruntime.targets')">
-    <TraversalBuildDependsOn>
-      EnsureBuildToolsRuntime;
-      $(TraversalBuildDependsOn)
-    </TraversalBuildDependsOn>
-  </PropertyGroup>
-
   <!-- Generate the shared library for running ILC tests for configuration Release-x64 -->
   <Target Name="GenerateSharedLibraryForILC" AfterTargets="BuildAllProjects" Condition="'$(EnableMultiFileILCTests)' == 'true'">
     <Message Importance="High" Text="Generating shared library for running ILC tests." Condition="Exists('$(InternalTestILCFolder)\ilc.exe')" />
index 8ee1737..8fcbdba 100644 (file)
@@ -85,7 +85,7 @@
           SkipUnchangedFiles="true"
           UseHardlinksIfPossible="$(UseHardlink)" />
 
-    <Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension)" Condition="'$(RunningOnUnix)' == 'true'"/>
+    <Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension)" Condition="'$(OS)' != 'Windows_NT'"/>
   </Target>
 
   <PropertyGroup>
       <SymbolPackagesToDownload Include="@(_CoreCLRSymbolPackagesToDownload)" Condition="!Exists('%(UnzipDestinationDir)')" />
     </ItemGroup>
   </Target>
+  
+  <Target Name="DownloadAndUnzipSymbolPackage"
+          Condition="'@(SymbolPackagesToDownload)' != ''">
+      <DownloadFile SourceUrl="%(SymbolPackagesToDownload.Url)"
+                    DestinationFolder="$(SymbolPackagesDir)"
+                    DestinationFileName="%(SymbolPackagesToDownload.DestinationFile)"
+                    ContinueOnError="WarnAndContinue" />
+      <Unzip SourceFiles="$(SymbolPackagesDir)\%(SymbolPackagesToDownload.DestinationFile)"
+             DestinationFolder="%(SymbolPackagesToDownload.UnzipDestinationDir)"
+             OverwriteReadOnlyFiles="true"
+             Condition="Exists('$(SymbolPackagesDir)\%(SymbolPackagesToDownload.DestinationFile)')" />
+  </Target>
+          
 
   <Target Name="BinPlaceCoreCLRSymbols"
           AfterTargets="AfterResolveReferences"
           DependsOnTargets="CalculateCoreCLRSymbolPackageProperties;DownloadAndUnzipSymbolPackage"
           Condition="'$(CoreCLROverridePath)' == '' AND '$(DownloadCoreCLRSymbols)' != 'false'">
-
-      <Warning Text="Failed to download CoreCLR symbols" Condition="'@(SymbolPackagesDownloaded)' == '' AND '@(SymbolPackagesToDownload)' != ''" />
-
       <ItemGroup>
         <_CoreCLRSymbolFiles Include="%(_CoreCLRSymbolPackagesToDownload.UnzipDestinationDir)/runtimes/$(RuntimeIdentifier)/native/*.pdb" />
         <_CoreCLRSymbolFiles Include="%(_CoreCLRSymbolPackagesToDownload.UnzipDestinationDir)/runtimes/$(RuntimeIdentifier)/native/*.dbg" />
index 5836781..c43fd26 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project>
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
 
   <PropertyGroup>
index 96e646a..df40c5b 100644 (file)
@@ -14,7 +14,7 @@
     </RestoreSources>
   </PropertyGroup>
 
-  <Import Project="tools\Packaging.common.targets" />
+  <Import Project="tools\build\Packaging.common.targets" />
   <Import Project="tools\dependencies.props" />
   <Import Project="tools\eng\versions.props" />
   <Import Project="frameworkSettings\$(_targetFrameworkIdentifier)\*.targets" />
index 35558f8..3e7011e 100644 (file)
     <TestSupportFiles Include="$(RepositoryEngineeringDir)versions.props">
       <DestinationFolder>$(TestToolsDir)eng/</DestinationFolder>
     </TestSupportFiles>
-    <TestSupportFiles Include="$(ToolsDir)Packaging.common.targets">
-      <DestinationFolder>$(TestToolsDir)</DestinationFolder>
-    </TestSupportFiles>
-    <TestSupportFiles Include="$(ToolsDir)Microsoft.DotNet.Build.Tasks.Packaging.dll">
-      <DestinationFolder>$(TestToolsDir)</DestinationFolder>
-    </TestSupportFiles>
-    <TestSupportFiles Include="$(ToolsDir)Newtonsoft.Json.dll">
-      <DestinationFolder>$(TestToolsDir)</DestinationFolder>
-    </TestSupportFiles>
-    <TestSupportFiles Include="$(ToolsDir)NuGet.*.dll">
-      <DestinationFolder>$(TestToolsDir)</DestinationFolder>
+    <TestSupportFiles Include="$(PackagingTaskDir)..\..\**\*.*">
+      <DestinationFolder>$(TestToolsDir)%(RecursiveDir)</DestinationFolder>
     </TestSupportFiles>
     <TestSupportFiles Include="props\Directory.Build.props">
       <DestinationFolder>$(TestDir)</DestinationFolder>
       <TestRestoreCommand>$(TestRestoreCommand) restore</TestRestoreCommand>
       <TestRestoreCommand>$(TestRestoreCommand) --packages "$(TestPackageDir)"</TestRestoreCommand>
       <TestRestoreCommand>$(TestRestoreCommand) /p:LocalPackagesPath=$(PackageOutputPath)</TestRestoreCommand>
+      <TestRestoreCommand>$(TestRestoreCommand) /nr:false</TestRestoreCommand>
       <TestRestoreCommand  Condition="'$(TestPackages)' != ''">$(TestRestoreCommand) /p:TestPackages=$(TestPackages)</TestRestoreCommand>
     </PropertyGroup>
 
       <TestBuildCommand>$(TestDotNetPath)</TestBuildCommand>
       <TestBuildCommand>$(TestBuildCommand) msbuild</TestBuildCommand>
       <TestBuildCommand>$(TestBuildCommand) /t:Test</TestBuildCommand>
+      <TestBuildCommand>$(TestBuildCommand) /nr:false</TestBuildCommand>
       <TestBuildCommand  Condition="'$(TestPackages)' != ''">$(TestBuildCommand) /p:TestPackages=$(TestPackages)</TestBuildCommand>
     </PropertyGroup>
 
 
   <Target Name="Build" DependsOnTargets="BuildProjects;ArchiveHelixItems" />
 
+  <!-- define test to do nothing, for this project Build does all the testing -->
+  <Target Name="Test" />
+
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
 </Project>
index 15210d5..4561b7e 100644 (file)
@@ -16,6 +16,7 @@
   <PropertyGroup>
     <IsNETCoreApp>true</IsNETCoreApp>
     <IsUAP>true</IsUAP>
+    <NuGetTargetMoniker Condition="'$(NuGetTargetMoniker)' == ''">$(TargetFramework)</NuGetTargetMoniker>
   </PropertyGroup>
 
   <PropertyGroup>
index 10aac6c..c1846db 100644 (file)
@@ -1,17 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
-  <Import Project="Directory.Build.props" />
-
   <PropertyGroup>
     <PackageConfigurations>
-      netcoreapp2.0;
+      netcoreapp2.0
     </PackageConfigurations>
     <BuildConfigurations>
-      $(BuildConfigurations);
-      $(PackageConfigurations);
+      $(PackageConfigurations)
     </BuildConfigurations>
   </PropertyGroup>
 
+  <Import Project="Directory.Build.props" />
+
   <Target Name="GetGenFacadesInputs">
     <ItemGroup>
       <NetFxContracts Include="@(NetFxReference->'$(NetFxRefPath)%(Identity).dll')" Condition="'$(TargetGroup)' != 'netfx'">
index 70a9338..af0b67d 100644 (file)
@@ -26,8 +26,6 @@
     <SerializeProjects>true</SerializeProjects>
   </PropertyGroup>
 
-  <Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
-
   <Target Name="BinPlaceXUnitRuntimeForNetstandardSuite" Condition="'$(TargetGroup)' == 'netstandard'" BeforeTargets="BuildAllProjects">
     <!-- Ensure that we binplace all of the xunit assemblies on the netstandard runtime path in order to be able to build netstandard test suite -->
     <MSBuild Projects="$(MSBuildThisFileDirectory)../external/test-runtime/XUnit.Runtime.depproj"
@@ -51,8 +49,6 @@
     <Project Include="$(ProjectDir)pkg\test\testPackages.proj" />
   </ItemGroup>
 
-  <Import Project="$(ToolsDir)Build.Post.targets" Condition="Exists('$(ToolsDir)Build.Post.targets')" />
-
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
 
   <PropertyGroup Condition="'$(BuildingUAPVertical)' == 'true'">
       $(TraversalBuildDependsOn)
     </TraversalBuildDependsOn>
   </PropertyGroup>
-
-    <!-- TODO: Can we move this archive test build to BuildTools -->
-  <UsingTask TaskName="ZipFileCreateFromDependencyLists" Condition="'$(Platform)' == 'ARM64' and '$(ArchiveTests)' == 'true'" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
-  <Target Name="ArchiveTestBuild" Condition="'$(Platform)' == 'ARM64' and '$(ArchiveTests)' == 'true'" AfterTargets="Build" >
-    <ItemGroup>
-      <ExcludeFromArchive Include="nupkg$" />
-      <ExcludeFromArchive Include="Microsoft.DotNet.BuildTools" />
-      <ExcludeFromArchive Include="TestData" />
-      <TestDependencyListFile Include="$(BinDir)/TestDependencies/*.dependencylist.txt" />
-    </ItemGroup>
-
-    <ZipFileCreateFromDependencyLists
-      DependencyListFiles="@(TestDependencyListFile)"
-      DestinationArchive="$(TestWorkingDir)$(OSPlatformConfig)/archive/Packages.zip"
-      RelativePathBaseDirectory="$(PackagesDir)"
-      OverwriteDestination="true" />
-  </Target>
 </Project>