Move crossgen into src build phase

This adds a src.builds phase to the repo which builds binaries that will
later be signed.  In this phase are currently host binaries and cross-
gen'ed shared framework binaries.

A future commit will move managed binaries into this phase.
This commit is contained in:
Eric St. John 2017-05-01 13:40:52 -07:00
Родитель 1032303f33
Коммит 3d8498ab4d
16 изменённых файлов: 62 добавлений и 20 удалений

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<!-- required to build the projects in their specified order -->

Просмотреть файл

@ -141,7 +141,7 @@
"definitionType": "task"
},
"inputs": {
"solution": "$(PB_SourcesDirectory)/src/corehost/build.proj",
"solution": "$(PB_SourcesDirectory)/src/src.builds",
"platform": "$(PB_TargetArchitecture)",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "$(PB_CommonMSBuildArgs)",

Просмотреть файл

@ -246,7 +246,8 @@
<OSPlatformConfig>$(TargetRid).$(ConfigurationGroup)</OSPlatformConfig>
<BaseOutputPath Condition="'$(BaseOutputPath)'==''">$(BinDir)</BaseOutputPath>
<BaseOutputRootPath>$(BaseOutputPath)$(OSPlatformConfig)\</BaseOutputRootPath>
<BaseOutputRootPath>$(BaseOutputPath)$(OSPlatformConfig)\</BaseOutputRootPath>
<CrossGenRootPath>$(BaseOutputRootPath)\crossgen</CrossGenRootPath>
<OutputPath Condition="'$(OutputPath)'==''">$(BaseOutputPath)$(OSPlatformConfig)\$(MSBuildProjectName)\</OutputPath>
<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(BaseIntermediateOutputPath)$(OSPlatformConfig)\</IntermediateOutputRootPath>

Просмотреть файл

@ -7,13 +7,8 @@
<SerializeProjects>true</SerializeProjects>
</PropertyGroup>
<PropertyGroup>
<!-- To disable the restoration of packages, set RestoreDuringBuild=false or pass /p:RestoreDuringBuild=false.-->
<RestoreDuringBuild Condition="'$(RestoreDuringBuild)'==''">true</RestoreDuringBuild>
</PropertyGroup>
<ItemGroup>
<Project Include="$(MSBuildThisFileDirectory)corehost/build.proj" />
<Project Include="$(MSBuildThisFileDirectory)src.builds" />
<Project Include="$(MSBuildThisFileDirectory)pkg/dir.proj" />
<Project Include="$(MSBuildThisFileDirectory)managed/dir.proj" />
</ItemGroup>

Просмотреть файл

@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<!-- don't build project references from pkgprojs during the packages build phase,
they will be built during the source build phase -->
<AdditionalProperties>BuildPackageLibraryReferences=false</AdditionalProperties>
</PropertyGroup>
<ItemGroup>
<ProjectExclusions Include="$(MSBuildThisFileDirectory)\projects\*\Microsoft.NETCore.UniversalWindowsPlatform.builds" Condition="'$(OSEnvironment)' != 'Windows_NT' or '$(Platform)' == 'arm64'" />
<Project Include="$(MSBuildThisFileDirectory)\projects\*\*.builds" Exclude="@(ProjectExclusions)" />
<Project Include="$(MSBuildThisFileDirectory)\projects\*\*.builds" Exclude="@(ProjectExclusions)">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />

Просмотреть файл

@ -57,7 +57,7 @@
<!-- Redistributed package content from other nuget packages-->
<ItemGroup>
<ProjectReference Include="Microsoft.NETCore.App.depproj">
<ProjectReference Include="src\Microsoft.NETCore.App.depproj">
<AdditionalProperties Condition="'$(PackageTargetRuntime)' != ''">NuGetRuntimeIdentifier=$(PackageTargetRuntime)</AdditionalProperties>
</ProjectReference>
</ItemGroup>

Просмотреть файл

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="$(MSBuildProjectName).depproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

Просмотреть файл

@ -10,6 +10,7 @@
<NuGetTargetMoniker>.NETCoreApp,Version=v2.0</NuGetTargetMoniker>
<PackageTargetFramework>netcoreapp2.0</PackageTargetFramework>
<PrimaryPackage>Microsoft.Private.CoreFx.NETCoreApp</PrimaryPackage>
<CrossGenOutputPath>$(CrossGenRootPath)/$(MSBuildProjectName)/$(NuGetRuntimeIdentifier)</CrossGenOutputPath>
</PropertyGroup>
<ItemGroup>
<None Include="project.json" />
@ -144,7 +145,7 @@
<ItemGroup>
<_filesToCrossGen Include="@(FilesToPackage)"
Condition="'%(FilesToPackage.IsNative)' != 'true' AND '%(FileName)' != 'System.Private.CoreLib' AND '%(FileName)' != 'mscorlib' AND '%(Extension)' == '.dll'">
<CrossGenedPath>$(_crossGenIntermediatePath)/%(FileName)%(Extension)</CrossGenedPath>
<CrossGenedPath>$(CrossGenOutputPath)/%(TargetPath)/%(FileName)%(Extension)</CrossGenedPath>
</_filesToCrossGen>
<FilesToPackage Remove="@(_filesToCrossGen)" />
@ -183,12 +184,13 @@
</ItemGroup>
<MakeDir Directories="$(_crossGenIntermediatePath)" />
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName('%(_filesToCrossGen.CrossGenedPath)'))" />
<WriteLinesToFile File="$(_crossGenResponseFile)" Lines="@(_crossGenArgs)" Overwrite="true" />
<Exec Command="$(_crossGenPath) @$(_crossGenResponseFile)" WorkingDirectory="$(_clrDirectory)" EnvironmentVariables="COMPlus_PartialNGen=0" />
</Target>
<Target Name="GetFilesToPackage" DependsOnTargets="ResolveNuGetPackages;GetFilesFromPackages;CrossGen" Returns="@(FilesToPackage)" />
<Target Name="GetFilesToPackage" DependsOnTargets="ResolveNuGetPackages;GetFilesFromPackages;PrepareForCrossGen" Returns="@(FilesToPackage)" />
<Target Name="GetDependenciesToPackage" Condition="'@(DependenciesToPackage)' != ''" DependsOnTargets="ResolveNuGetPackages" Returns="@(_DependenciesToPackageWithVersion)">
<!-- hack because current nuget task doesn't return version for ReferencedNuGetPackages,
@ -216,7 +218,7 @@
<Message Importance="low" Text="%(_DependenciesToPackageWithVersion.Identity) : %(_DependenciesToPackageWithVersion.Version) : %(_DependenciesToPackageWithVersion.TargetFramework)" />
</Target>
<!-- only calculate paths from this project, don't copy -->
<!-- Run crossgen -->
<Target Name="Build" DependsOnTargets="CrossGen;GetFilesToPackage" />
<!-- remove when fixing https://github.com/dotnet/buildtools/issues/1273 -->

Просмотреть файл

@ -44,7 +44,7 @@
<!-- Redistributed package content from other nuget packages-->
<ItemGroup>
<ProjectReference Include="Microsoft.NETCore.UniversalWindowsPlatform.depproj">
<ProjectReference Include="src\Microsoft.NETCore.UniversalWindowsPlatform.depproj">
<AdditionalProperties Condition="'$(PackageTargetRuntime)' != ''">NuGetRuntimeIdentifier=$(PackageTargetRuntime)</AdditionalProperties>
</ProjectReference>
</ItemGroup>

Просмотреть файл

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="Microsoft.NETCore.UniversalWindowsPlatform.depproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<!-- we intentionally don't want to produce output -->
<OutputPath>unused</OutputPath>

Просмотреть файл

@ -83,15 +83,20 @@
<Platform>$(Platform)</Platform>
</BuildRID>
</ItemGroup>
<PropertyGroup>
<_projectExtension Condition="Exists('$(MSBuildProjectName).pkgproj')">.pkgproj</_projectExtension>
<_projectExtension Condition="'$(_projectExtension)' == '' AND Exists('$(MSBuildProjectName).depproj')">.depproj</_projectExtension>
</PropertyGroup>
<ItemGroup Condition="'$(HasRuntimePackages)' != 'false'">
<_project Include="@(BuildRID)">
<Platform Condition="'%(Platform)' == ''">x64</Platform>
<PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
<AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
<AdditionalProperties>PackageTargetRuntime=%(Identity);NuGetRuntimeIdentifier=%(Identity);Platform=%(Platform)</AdditionalProperties>
</_project>
<Project Include="@(_project->'$(MSBuildProjectName).pkgproj')" />
<Project Include="@(_project->'$(MSBuildProjectName)$(_projectExtension)')" />
</ItemGroup>
<ItemGroup Condition="'$(PackageTargetRuntime)' == '' and '$(HasRuntimePackages)' != 'false'">

11
src/src.builds Normal file
Просмотреть файл

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="$(MSBuildThisFileDirectory)corehost/build.proj" />
<Project Include="$(MSBuildThisFileDirectory)pkg/**/src/*.builds" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<UsingTask TaskName="GetHostInformation" AssemblyFile="$(LocalBuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.Local.dll" />
@ -13,7 +13,7 @@
</BuildTestTargets>
</PropertyGroup>
<Target Name="BuildAndTest" DependsOnTargets="$(BuildTestTargets)" />
<Target Name="Build" DependsOnTargets="$(BuildTestTargets)" />
<Target Name="DetermineTestOutputDirectory">
<GetHostInformation>