Remove InitTools and ToolsDir (dotnet/corefx#35677)
authorEric StJohn <ericstj@microsoft.com>
Fri, 1 Mar 2019 21:40:45 +0000 (13:40 -0800)
committerGitHub <noreply@github.com>
Fri, 1 Mar 2019 21:40:45 +0000 (13:40 -0800)
* Remove buildtools init-tools and various BuildTools specific properties

* Workaround NuGet restore GeneratePathProperty case-sensitivity

See https://github.com/NuGet/Home/issues/7843

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

17 files changed:
eng/Packaging.props
eng/VersionTools.targets [new file with mode: 0644]
eng/dependencies.props
eng/illink.targets
src/libraries/CoreFx.Private.TestUtilities/ref/CoreFx.Private.TestUtilities.csproj
src/libraries/CoreFx.Private.TestUtilities/src/CoreFx.Private.TestUtilities.csproj
src/libraries/Directory.Build.targets
src/libraries/Native/pkg/Directory.Build.props
src/libraries/System.Runtime.CompilerServices.Unsafe/pkg/System.Runtime.CompilerServices.Unsafe.pkgproj
src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj
src/libraries/build.proj
src/libraries/external/ILLink/ILLink.depproj
src/libraries/external/harvestPackages/harvestPackages.depproj
src/libraries/packages.builds
src/libraries/pkg/frameworkPackage.targets
src/libraries/pkg/test/testPackages.proj
src/libraries/tests.builds

index 0eb0350..bfd2e0e 100644 (file)
@@ -1,9 +1,9 @@
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <PackageDescriptionFile>$(ProjectDir)pkg/descriptions.json</PackageDescriptionFile>
-    <PackageLicenseFile>$(ProjectDir)LICENSE.TXT</PackageLicenseFile>
-    <PackageThirdPartyNoticesFile>$(ProjectDir)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
-    <RuntimeIdGraphDefinitionFile>$(ProjectDir)pkg/Microsoft.NETCore.Platforms/runtime.json</RuntimeIdGraphDefinitionFile>
+    <PackageDescriptionFile>$(RepoRoot)pkg/descriptions.json</PackageDescriptionFile>
+    <PackageLicenseFile>$(RepoRoot)LICENSE.TXT</PackageLicenseFile>
+    <PackageThirdPartyNoticesFile>$(RepoRoot)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
+    <RuntimeIdGraphDefinitionFile>$(RepoRoot)pkg/Microsoft.NETCore.Platforms/runtime.json</RuntimeIdGraphDefinitionFile>
     <ReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</ReleaseNotes>
     <ProjectUrl>https://github.com/dotnet/corefx</ProjectUrl>
     <LicenseUrl>https://github.com/dotnet/corefx/blob/master/LICENSE.TXT</LicenseUrl>
@@ -15,7 +15,7 @@
     <XmlDocPackage>Microsoft.Private.Intellisense</XmlDocPackage>
     <XmlDocPackageVersion>3.0.0-preview3-190214-0</XmlDocPackageVersion>
     <XmlDocFileRoot>$(PackagesDir)$(XmlDocPackage.ToLowerInvariant())/$(XmlDocPackageVersion)/xmldocs/netcoreapp</XmlDocFileRoot>
-    <XmlDocDir>$(BinDir)docs</XmlDocDir>
+    <XmlDocDir>$(ArtifactsBinDir)docs</XmlDocDir>
 
     <!-- By default the packaging targets will package desktop facades as ref,
          but we don't use this as we now build partial-reference-facades. -->
@@ -63,7 +63,7 @@
 
     <!-- Add a marker to help the designer optimize & share .NET Core packages -->
     <File Condition="'$(IncludeDesignerMarker)' != 'false'"
-          Include="$(ProjectDir)pkg/useSharedDesignerContext.txt">
+          Include="$(RepoRoot)pkg/useSharedDesignerContext.txt">
         <SkipPackageFileCheck>true</SkipPackageFileCheck>
     </File>
   </ItemGroup>
diff --git a/eng/VersionTools.targets b/eng/VersionTools.targets
new file mode 100644 (file)
index 0000000..05f393e
--- /dev/null
@@ -0,0 +1,16 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <!-- Properties required by VersionTools which we don't wish to make avaiable broadly -->
+    <BuildToolsTaskDir Condition="'$(MSBuildRuntimeType)' != 'core'">$(PkgMicrosoft_DotNet_BuildTools)\lib\net46\</BuildToolsTaskDir>
+    <BuildToolsTaskDir Condition="'$(MSBuildRuntimeType)' == 'core'">$(PkgMicrosoft_DotNet_BuildTools)\lib\</BuildToolsTaskDir>
+    <ProjectDir>$(RepoRoot)</ProjectDir>
+  </PropertyGroup>
+  <Import Project="$(PkgMicrosoft_DotNet_BuildTools)\lib\VersionTools.targets" Condition="Exists('$(PkgMicrosoft_DotNet_BuildTools)\lib\VersionTools.targets')" />
+  <PropertyGroup>
+    <BuildToolsTaskDir />
+    <ProjectDir />
+
+    <!-- point BuildInfoCacheDir to a writable location under artifacts -->
+    <BuildInfoCacheDir>$(ToolSetCommonDirectory)BuildInfoCache/</BuildInfoCacheDir>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
index f22b959..25f9a57 100644 (file)
@@ -49,7 +49,7 @@
 
   <!-- Package versions used as toolsets -->
   <PropertyGroup>
-    <BuildToolsPackage>microsoft.dotnet.buildtools</BuildToolsPackage>
+    <BuildToolsPackage>Microsoft.DotNet.BuildTools</BuildToolsPackage>
     <BuildToolsPackageVersion>3.0.0-preview1-03715-01</BuildToolsPackageVersion>
   </PropertyGroup>
 
index 3dd5e21..cc9d02d 100644 (file)
@@ -10,8 +10,8 @@
 
   <!-- Inputs and outputs of ILLinkTrimAssembly -->
   <PropertyGroup>
-    <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>
+    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' == 'core'">$(ILLinkDir)netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
+    <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' != 'core'">$(ILLinkDir)net46/ILLink.Tasks.dll</ILLinkTasksPath>
     <ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
     <ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
     <ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
   --> 
   <ItemGroup Condition="'$(BinPlaceILLinkTrimAssembly)' == 'true'">
     <BinPlaceConfiguration Include="$(BuildConfiguration)">
-      <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/trimmed</RuntimePath>
+      <RuntimePath>$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildConfiguration)/trimmed</RuntimePath>
       <ItemName>TrimmedItem</ItemName>
     </BinPlaceConfiguration>
     <BinPlaceConfiguration Include="$(BuildConfiguration)">
-      <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/reports</RuntimePath>
+      <RuntimePath>$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildConfiguration)/reports</RuntimePath>
       <ItemName>TrimmingReport</ItemName>
     </BinPlaceConfiguration>
     <BinPlaceConfiguration Include="$(BuildConfiguration)">
-      <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/pretrimmed</RuntimePath>
+      <RuntimePath>$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildConfiguration)/pretrimmed</RuntimePath>
       <ItemName>PreTrimmedItem</ItemName>
     </BinPlaceConfiguration>
   </ItemGroup>
index 27adb76..01f758e 100644 (file)
@@ -3,7 +3,7 @@
     <ProjectGuid>{E2E59C98-998F-9965-991D-99411166AF6F}</ProjectGuid>
     <ShouldWriteSigningRequired>false</ShouldWriteSigningRequired>
     <AllowReferenceFromRuntime>true</AllowReferenceFromRuntime>
-    <RuntimeProjectFile>$(ProjectDir)\external\test-runtime\XUnit.Runtime.depproj</RuntimeProjectFile>
+    <RuntimeProjectFile>$(RepoRoot)\external\test-runtime\XUnit.Runtime.depproj</RuntimeProjectFile>
     <Configurations>netstandard-Debug;netstandard-Release</Configurations>
   </PropertyGroup>
   <ItemGroup>
index 5ff18ad..156d4e9 100644 (file)
@@ -2,7 +2,7 @@
   <PropertyGroup>
     <AssemblyName>CoreFx.Private.TestUtilities</AssemblyName>
     <ProjectGuid>{EBDB0247-CA43-4226-B7A1-8FEF21061D09}</ProjectGuid>
-    <RuntimeProjectFile>$(ProjectDir)\external\test-runtime\XUnit.Runtime.depproj</RuntimeProjectFile>
+    <RuntimeProjectFile>$(RepoRoot)\external\test-runtime\XUnit.Runtime.depproj</RuntimeProjectFile>
     <ClsCompliant>false</ClsCompliant>
     <ShouldWriteSigningRequired>false</ShouldWriteSigningRequired>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
index 90b4379..52981ad 100644 (file)
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project InitialTargets="AddSkipGetTargetFrameworkToProjectReferences">
   <PropertyGroup>
-    <ErrorIfBuildToolsRestoredFromIndividualProject Condition="!Exists('$(ToolsDir)')">true</ErrorIfBuildToolsRestoredFromIndividualProject>
-
     <!-- Reset these properties back to blank, since they are defaulted by Microsoft.NET.Sdk -->
     <FileAlignment Condition="'$(FileAlignment)' == '512'"></FileAlignment>
     <ErrorReport Condition="'$(ErrorReport)' == 'prompt'"></ErrorReport>
index 8c670f0..3e623ec 100644 (file)
@@ -4,13 +4,13 @@
   <PropertyGroup>
     <!-- common properties that point to output of native build.  Can be overriden in case of 
          a coordinating build that produces all packages from OS-specific native builds -->
-    <LinuxNativePath Condition="'$(LinuxNativePath)' == ''">$(BinDir)Linux.$(PackagePlatform).$(ConfigurationGroup)\native\</LinuxNativePath>
-    <WinNativeAOTPath Condition="'$(WinNativeAOTPath)' == ''">$(BinDir)Windows_NT.$(PackagePlatform).$(ConfigurationGroup)\native_aot\</WinNativeAOTPath>
-    <WinNativePath Condition="'$(WinNativePath)' == ''">$(BinDir)Windows_NT.$(PackagePlatform).$(ConfigurationGroup)\native\</WinNativePath>
+    <LinuxNativePath Condition="'$(LinuxNativePath)' == ''">$(ArtifactsBinDir)Linux.$(PackagePlatform).$(ConfigurationGroup)\native\</LinuxNativePath>
+    <WinNativeAOTPath Condition="'$(WinNativeAOTPath)' == ''">$(ArtifactsBinDir)Windows_NT.$(PackagePlatform).$(ConfigurationGroup)\native_aot\</WinNativeAOTPath>
+    <WinNativePath Condition="'$(WinNativePath)' == ''">$(ArtifactsBinDir)Windows_NT.$(PackagePlatform).$(ConfigurationGroup)\native\</WinNativePath>
     <RHELNativePath Condition="'$(RHELNativePath)' == ''">$(LinuxNativePath)</RHELNativePath>
     <DebianNativePath Condition="'$(DebianNativePath)' == ''">$(LinuxNativePath)</DebianNativePath>
     <Fedora24NativePath Condition="'$(Fedora24NativePath)' == ''">$(LinuxNativePath)</Fedora24NativePath>
-    <OSXNativePath Condition="'$(OSXNativePath)' == ''">$(BinDir)OSX.$(PackagePlatform).$(ConfigurationGroup)\native\</OSXNativePath>
+    <OSXNativePath Condition="'$(OSXNativePath)' == ''">$(ArtifactsBinDir)OSX.$(PackagePlatform).$(ConfigurationGroup)\native\</OSXNativePath>
     <OpenSuse132NativePath Condition="'$(OpenSuse132NativePath)' == ''">$(LinuxNativePath)</OpenSuse132NativePath>
     <OpenSuse421NativePath Condition="'$(OpenSuse421NativePath)' == ''">$(LinuxNativePath)</OpenSuse421NativePath>
     <Ubuntu1404NativePath Condition="'$(Ubuntu1404NativePath)' == ''">$(LinuxNativePath)</Ubuntu1404NativePath>
index 096fcad..4d3f85a 100644 (file)
@@ -2,7 +2,7 @@
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
   <ItemGroup>
-    <PackageIndex Include="$(ProjectDir)\pkg\baseline\packageBaseline.1.1.json" />
+    <PackageIndex Include="$(RepoRoot)\pkg\baseline\packageBaseline.1.1.json" />
     <ProjectReference Include="..\ref\System.Runtime.CompilerServices.Unsafe.csproj">
       <SupportedFramework>net45;netcoreapp1.0;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
index f022b24..000e9d6 100644 (file)
@@ -11,7 +11,6 @@
   <ItemGroup>
     <Compile Include="System.Runtime.CompilerServices.Unsafe.il" />
     <Reference Include="System.Runtime" />
-    <PackageReference Include="$(MicrosoftNetCoreIldasmPackageName)" Version="$(MicrosoftNETCoreILAsmPackageVersion)" PrivateAssets="all" />
   </ItemGroup>
 
   <Target Name="AddResourcesFileToIlasm" 
index 3d2f713..5d73223 100644 (file)
@@ -18,7 +18,7 @@
   </PropertyGroup>
 
   <!-- remove once we no longer use maestro v1 updating -->
-  <Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
+  <Import Project="$(RepositoryEngineeringDir)VersionTools.targets" />
 
   <Import Project="Directory.Build.targets" />
 
index 2039f95..f74937b 100644 (file)
@@ -2,7 +2,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFramework>netcoreapp1.1</TargetFramework>
-    <OutputPath>$(ToolsDir)ILLink</OutputPath>
+    <OutputPath>$(ILLinkDir)</OutputPath>
     <EnableBinPlacing>false</EnableBinPlacing>
     <ILLinkTasksPackageId>illink.tasks</ILLinkTasksPackageId>
     <ILLinkTasksPackageVersion>0.1.5-preview-1461378</ILLinkTasksPackageVersion>
index 455f247..0195f57 100644 (file)
@@ -6,7 +6,7 @@
 
   <Import Project="harvestPackages.props" />
 
-  <Import Project="$(ProjectDir)pkg/baseline/baseline.props" />
+  <Import Project="$(RepoRoot)pkg/baseline/baseline.props" />
 
   <!--
     Custom target to update the stable versions. Ideally we would just run this target as part of the build but
index 6a47fe5..829c89f 100644 (file)
@@ -2,10 +2,6 @@
 <Project>
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
 
-  <PropertyGroup>
-    <PackageReportDir Condition="'$(PackageReportDir)' == ''">$(BinDir)pkg/reports/</PackageReportDir>
-  </PropertyGroup>
-
   <ItemGroup>
     <Project Include="$(MSBuildThisFileDirectory)..\pkg\*\*.builds" Condition="'$(SkipManagedPackageBuild)' != 'true'">
       <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
 
   </Target>
 
-  <UsingTask TaskName="GenerateNetStandardSupportTable" AssemblyFile="$(PackagingTaskDir)Microsoft.DotNet.Build.Tasks.Packaging.dll" />
-  <Target Name="GenerateNETStandardDocs">
-    <Error Condition="'$(WcfPackageReportDir)' == ''"
-           Text="WcfPackageReportDir must be specified to point to the package report directory of the WCF repo.  EG: /p:WcfPackageReportDir=c:\src\wcf\bin\pkg\reports\" />
-    <ItemGroup>
-      <Reports Include="$(PackageReportDir)*.json" />
-      <Reports Include="$(WcfPackageReportDir)*.json" />
-    </ItemGroup>
-
-    <GenerateNetStandardSupportTable Reports="@(Reports)" DocFilePath="$(ProjectDir)Documentation\architecture\net-platform-standard.md" InsertIntoFile="True" />
-  </Target>
-
   <!-- Generate a version text file we include in our packages -->
   <Target Name="GenerateVersionFileForPackages"
           BeforeTargets="BuildAllProjects"
index ca4025f..97771e2 100644 (file)
@@ -67,7 +67,7 @@
 
   <Target Name="IncludeFiles">
     <PropertyGroup>
-      <_projectDirLength>$(ProjectDir.Length)</_projectDirLength>
+      <_repoRootLength>$(RepoRoot.Length)</_repoRootLength>
     </PropertyGroup>
 
     <ItemGroup>
@@ -90,7 +90,7 @@
       <!-- Set targetpath for sources to be under src so that it is excluded from the lib package -->
       <File Condition="'%(File.IsSourceCodeFile)' == 'true'">
         <TargetPath>src</TargetPath>
-        <TargetPath Condition="$([System.String]::Copy('%(FullPath)').StartsWith('$(ProjectDir)'))">src/$([System.String]::Copy('%(FullPath)').Substring($(_projectDirLength)).Replace('\', '/'))</TargetPath>
+        <TargetPath Condition="$([System.String]::Copy('%(FullPath)').StartsWith('$(RepoRoot)'))">src/$([System.String]::Copy('%(FullPath)').Substring($(_repoRootLength)).Replace('\', '/'))</TargetPath>
       </File>
     </ItemGroup>
   </Target>
index 998694f..067ddea 100644 (file)
   </ItemGroup>
 
   <PropertyGroup>
-    <TestDir>$(BinDir)testPkg/</TestDir>
+    <TestDir>$(ArtifactsBinDir)testPkg/</TestDir>
     <TestSupportDir>$(TestDir)support/</TestSupportDir>
     <TestProjectName>test.msbuild</TestProjectName>
     <TestProject>$(TestSupportDir)$(TestProjectName)</TestProject>
     <TestToolsDir>$(TestSupportDir)tools/</TestToolsDir>
     <TestProjectDir>$(TestDir)projects/</TestProjectDir>
-    <TestPackageDir>$(BinDir)testPackages</TestPackageDir>
+    <TestPackageDir>$(ArtifactsBinDir)testPackages</TestPackageDir>
     <TestDotNetPath>$(TestToolsDir)/dotnet</TestDotNetPath>
 
     <ProjectTemplate>project.csproj.template</ProjectTemplate>
index 6a160f5..9f30118 100644 (file)
@@ -40,7 +40,7 @@
   </ItemGroup>
 
   <ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
-    <Project Include="$(ProjectDir)pkg\test\testPackages.proj" />
+    <Project Include="$(RepoRoot)pkg\test\testPackages.proj" />
   </ItemGroup>
 
   <Target Name="BinPlaceXUnitRuntimeForNetstandardSuite"