2016-07-01 18:02:26 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
2016-06-30 21:17:47 +00:00
|
|
|
<Import Project="compile/Microsoft.DotNet.Cli.LzmaArchive.targets" />
|
2016-07-26 04:29:59 +00:00
|
|
|
<Import Project="crossgen/Microsoft.DotNet.Cli.Crossgen.targets" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<PropertyGroup>
|
|
|
|
<BinaryToCorehostifyRelDir>runtimes/any/native</BinaryToCorehostifyRelDir>
|
2016-08-09 21:49:13 +00:00
|
|
|
<CoreSDKDir>$(RepoRoot)/resources/MSBuildImports</CoreSDKDir>
|
2016-08-09 20:22:22 +00:00
|
|
|
</PropertyGroup>
|
|
|
|
|
2016-07-26 04:29:59 +00:00
|
|
|
<ItemGroup>
|
|
|
|
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
|
2016-08-09 20:22:22 +00:00
|
|
|
<FilesToMove Include="$(BinaryToCorehostifyRelDir)/csc.exe;$(BinaryToCorehostifyRelDir)/MSBuild.exe;" />
|
|
|
|
<BundledTools Include="csc;MSBuild;NuGet.CommandLine.XPlat;dotnet" />
|
|
|
|
<CoreSDKContent Include="$(CoreSDKDir)/**/*" />
|
2016-07-26 04:29:59 +00:00
|
|
|
</ItemGroup>
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-07-01 00:34:11 +00:00
|
|
|
<Target Name="Compile" DependsOnTargets="Prepare;
|
2016-06-30 17:39:39 +00:00
|
|
|
SetupStage;
|
|
|
|
CompileStage;
|
|
|
|
BuildProjectsForNuGetPackages;
|
2016-07-01 00:34:11 +00:00
|
|
|
GenerateNuGetPackagesArchive" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-07-26 04:29:59 +00:00
|
|
|
<Target Name="SetupStage"
|
|
|
|
DependsOnTargets="Prepare">
|
2016-06-30 21:17:47 +00:00
|
|
|
<PropertyGroup>
|
|
|
|
<SrcDirectory>$(RepoRoot)/src</SrcDirectory>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2016-06-30 17:39:39 +00:00
|
|
|
<ItemGroup>
|
2016-06-30 21:17:47 +00:00
|
|
|
<CompileStageInputs Include="$(SrcDirectory)/**/*.cs" Exclude="$(SrcDirectory)/**/obj/**/*.cs" />
|
|
|
|
<CompileStageInputs Include="$(SrcDirectory)/**/project.json;$(SrcDirectory)/**/project.lock.json" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<Stage Include="Stage1">
|
|
|
|
<Inputs>@(CompileStageInputs)</Inputs>
|
|
|
|
<StageDirectory>$(Stage1Directory)</StageDirectory>
|
|
|
|
<StageSymbolsDirectory>$(Stage1SymbolsDirectory)</StageSymbolsDirectory>
|
2016-07-26 04:29:59 +00:00
|
|
|
<DotnetDir>$(Stage0Directory)</DotnetDir>
|
2016-06-30 17:39:39 +00:00
|
|
|
</Stage>
|
|
|
|
<Stage Include="Stage2">
|
|
|
|
<Inputs>@(CompileStageInputs)</Inputs>
|
|
|
|
<StageDirectory>$(Stage2Directory)</StageDirectory>
|
|
|
|
<StageSymbolsDirectory>$(Stage2SymbolsDirectory)</StageSymbolsDirectory>
|
2016-07-26 04:29:59 +00:00
|
|
|
<DotnetDir>$(Stage1Directory)</DotnetDir>
|
|
|
|
</Stage>
|
|
|
|
</ItemGroup>
|
|
|
|
</Target>
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<Target Name="CompileStage"
|
2016-07-26 04:29:59 +00:00
|
|
|
DependsOnTargets="SetupStage;
|
|
|
|
InitCrossgenProps;"
|
2016-06-30 21:17:47 +00:00
|
|
|
Inputs="%(Stage.Inputs)"
|
|
|
|
Outputs="%(StageDirectory)/sdk/$(SdkVersion)/dotnet.dll">
|
2016-07-05 03:36:30 +00:00
|
|
|
<PropertyGroup>
|
2016-06-30 17:39:39 +00:00
|
|
|
<DynamicLibPrefix Condition=" '$(OSName)' == 'win' "></DynamicLibPrefix>
|
|
|
|
<DynamicLibPrefix Condition=" '$(OSName)' != 'win' ">lib</DynamicLibPrefix>
|
|
|
|
|
|
|
|
<DynamicLibSuffix Condition=" '$(OSName)' == 'win' ">.dll</DynamicLibSuffix>
|
|
|
|
<DynamicLibSuffix Condition=" '$(OSName)' == 'osx' ">.dylib</DynamicLibSuffix>
|
|
|
|
<DynamicLibSuffix Condition=" '$(DynamicLibSuffix)' == '' ">.so</DynamicLibSuffix>
|
|
|
|
|
2016-07-05 03:36:30 +00:00
|
|
|
<DotnetHostBaseName>dotnet$(ExeExtension)</DotnetHostBaseName>
|
2016-06-30 17:39:39 +00:00
|
|
|
<DotnetHostFxrBaseName>$(DynamicLibPrefix)hostfxr$(DynamicLibSuffix)</DotnetHostFxrBaseName>
|
|
|
|
<HostPolicyBaseName>$(DynamicLibPrefix)hostpolicy$(DynamicLibSuffix)</HostPolicyBaseName>
|
|
|
|
|
|
|
|
<StageDirectory>%(Stage.StageDirectory)</StageDirectory>
|
|
|
|
<StageSymbolsDirectory>%(Stage.StageSymbolsDirectory)</StageSymbolsDirectory>
|
2016-07-26 04:29:59 +00:00
|
|
|
<SdkOutputDirectory>$(StageDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
|
2016-06-30 17:39:39 +00:00
|
|
|
<BinaryToCorehostifyOutDir>$(SdkOutputDirectory)/$(BinaryToCorehostifyRelDir)</BinaryToCorehostifyOutDir>
|
|
|
|
<MSBuildTargetsDirectory>$(SdkOutputDirectory)/runtimes/any/native</MSBuildTargetsDirectory>
|
2016-07-26 04:29:59 +00:00
|
|
|
|
2016-07-01 00:34:11 +00:00
|
|
|
<SharedFrameworkNameVersionPath>$(StageDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
|
2016-06-30 17:39:39 +00:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
2016-07-26 04:29:59 +00:00
|
|
|
<BinObj Remove="*" />
|
2016-06-30 17:39:39 +00:00
|
|
|
<BinObj Include="$(SrcDirectory)/**/bin/**/*" />
|
|
|
|
<BinObj Include="$(SrcDirectory)/**/obj/**/*" />
|
2016-07-26 04:29:59 +00:00
|
|
|
|
|
|
|
<SharedFramework Remove="*" />
|
2016-07-01 18:02:26 +00:00
|
|
|
<SharedFramework Include="$(SharedFrameworkPublishDirectory)/**/*" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 21:49:13 +00:00
|
|
|
<AssetsToRemoveFromDeps Remove="*" />
|
|
|
|
<AssetsToRemoveFromDeps Include="csc" />
|
|
|
|
<AssetsToRemoveFromDeps Include="vbc" />
|
|
|
|
<AssetsToRemoveFromDeps Include="MSBuild" />
|
2016-06-30 17:39:39 +00:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Delete Files="@(BinObj)" />
|
|
|
|
|
|
|
|
<RemoveDir Directories="$(StageDirectory)" />
|
|
|
|
<MakeDir Directories="$(StageDirectory)"/>
|
|
|
|
|
|
|
|
<!-- CopySharedFramework -->
|
|
|
|
<Copy SourceFiles="@(SharedFramework)"
|
2016-08-09 20:22:22 +00:00
|
|
|
DestinationFiles="@(SharedFramework->'$(StageDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
2016-07-26 04:29:59 +00:00
|
|
|
|
2016-06-30 17:39:39 +00:00
|
|
|
<!-- Publish DotNet -->
|
2016-07-26 04:29:59 +00:00
|
|
|
<DotNetPublish ToolPath="%(Stage.DotnetDir)"
|
|
|
|
NativeSubdirectory="True"
|
|
|
|
Output="$(SdkOutputDirectory)"
|
|
|
|
Configuration="$(Configuration)"
|
|
|
|
VersionSuffix="$(CommitCount)"
|
2016-08-09 20:22:22 +00:00
|
|
|
ProjectPath="$(SrcDirectory)/redist" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<!-- Corehostify Binaries -->
|
2016-07-26 04:29:59 +00:00
|
|
|
<ItemGroup Condition=" '$(OSName)' != 'win' ">
|
|
|
|
<SdkOutputChmodTargets Remove="*" />
|
|
|
|
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.exe;
|
|
|
|
$(SdkOutputDirectory)/**/*.dll" >
|
|
|
|
<!-- Managed assemblies do not need execute -->
|
|
|
|
<Mode>u=rw,g=r,o=r</Mode>
|
|
|
|
</SdkOutputChmodTargets>
|
|
|
|
|
|
|
|
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.dylib;
|
|
|
|
$(SdkOutputDirectory)/**/*.so" >
|
|
|
|
<!-- Generally, dylibs and sos have 'x' -->
|
|
|
|
<Mode>u=rwx,g=rx,o=rx</Mode>
|
|
|
|
</SdkOutputChmodTargets>
|
|
|
|
|
|
|
|
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*"
|
|
|
|
Exclude="$(SdkOutputDirectory)/**/*.*" >
|
|
|
|
<!-- Executables need x -->
|
|
|
|
<Mode>u=rwx,g=rx,o=rx</Mode>
|
|
|
|
</SdkOutputChmodTargets>
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Chmod Condition=" '$(OSName)' != 'win' "
|
|
|
|
File="%(SdkOutputChModTargets.FullPath)"
|
|
|
|
Mode="%(SdkOutputChModTargets.Mode)" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
|
|
|
|
SectionName="runtimeTargets"
|
2016-08-09 21:49:13 +00:00
|
|
|
AssetPath="$(BinaryToCorehostifyRelDir)/%(AssetsToRemoveFromDeps.Identity).exe" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<Copy SourceFiles="$(SdkOutputDirectory)/%(FilesToMove.Identity)"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/%(FilesToMove.Filename).dll" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-10 14:21:43 +00:00
|
|
|
<!-- MSBuild needs csc.exe to be in the SdkOutputDirectory, or else it can't invoke it -->
|
|
|
|
<Move SourceFiles="$(BinaryToCorehostifyOutDir)/csc.exe"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/csc.exe" />
|
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<Copy SourceFiles="$(SdkOutputDirectory)/redist.deps.json"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<Copy SourceFiles="$(SdkOutputDirectory)/redist.runtimeconfig.json"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).runtimeconfig.json" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-07-26 04:29:59 +00:00
|
|
|
<ChangeEntryPointLibraryName
|
2016-08-09 20:22:22 +00:00
|
|
|
DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json"
|
|
|
|
NewName="%(BundledTools.Identity).deps.json" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<!-- cleanup project output we don't need -->
|
|
|
|
<Delete Files="$(SdkOutputDirectory)/redist%(PublishOutputExtensions.Identity)" />
|
|
|
|
<Delete Files="$(SdkOutputDirectory)/tool_msbuild%(PublishOutputExtensions.Identity)" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<!-- Copy Host to SDK Directory -->
|
|
|
|
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(DotnetHostBaseName)"
|
2016-07-05 03:36:30 +00:00
|
|
|
DestinationFiles="$(SdkOutputDirectory)/corehost$(ExeExtension)" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(DotnetHostFxrBaseName)"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/$(DotnetHostFxrBaseName)" />
|
|
|
|
|
|
|
|
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(HostPolicyBaseName)"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/$(HostPolicyBaseName)" />
|
|
|
|
|
2016-08-09 20:22:22 +00:00
|
|
|
<!-- copy core sdk -->
|
|
|
|
<Copy SourceFiles="@(CoreSDKContent)"
|
|
|
|
DestinationFolder="$(SdkOutputDirectory)/%(RecursiveDir)" />
|
|
|
|
|
2016-07-26 04:29:59 +00:00
|
|
|
<!-- Crossgen the Shared Framework -->
|
|
|
|
<ItemGroup>
|
|
|
|
<SdkFiles Remove="*" />
|
|
|
|
<SdkFiles Include="$(SdkOutputDirectory)/**/*" />
|
|
|
|
<SdkFilesWithPEMarker Remove="*" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<AddMetadataIsPE Items="@(SdkFiles)">
|
|
|
|
<Output TaskParameter="ResultItems" ItemName="SdkFilesWithPEMarker" />
|
|
|
|
</AddMetadataIsPE>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<CrossgenTargets Remove="*" />
|
|
|
|
<CrossgenTargets Include="%(SdkFilesWithPEMarker.FullPath)" Condition=" '%(SdkFilesWithPEMarker.IsPE)' == 'True' " />
|
|
|
|
|
|
|
|
<CompileStageSdkDirectories Remove="*" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<RemoveDuplicates Inputs="@(SdkFiles->'%(RootDir)%(Directory)')">
|
|
|
|
<Output TaskParameter="Filtered" ItemName="CompileStageSdkDirectories" />
|
|
|
|
</RemoveDuplicates>
|
|
|
|
|
|
|
|
<Crossgen Condition=" '$(DISABLE_CROSSGEN)' != '1' "
|
|
|
|
SourceAssembly="%(CrossgenTargets.FullPath)"
|
|
|
|
DestinationPath="%(CrossgenTargets.FullPath)"
|
|
|
|
JITPath="$(LibCLRJitPath)"
|
|
|
|
CrossgenPath="$(CrossgenPath)"
|
|
|
|
ReadyToRun="True"
|
|
|
|
PlatformAssemblyPaths="@(PlatformAssemblies);
|
|
|
|
$(SharedFrameworkNameVersionPath);
|
|
|
|
@(CompileStageSdkDirectories)" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<!-- Generate .version file -->
|
|
|
|
<WriteLinesToFile File="$(SdkOutputDirectory)/.version"
|
2016-06-30 21:17:47 +00:00
|
|
|
Lines="$(CommitHash);$(SdkVersion)"
|
2016-06-30 17:39:39 +00:00
|
|
|
Overwrite="true" />
|
|
|
|
|
2016-07-06 19:03:16 +00:00
|
|
|
<ItemGroup>
|
|
|
|
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.targets" />
|
|
|
|
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.Targets" />
|
|
|
|
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.props" />
|
|
|
|
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.overridetasks" />
|
|
|
|
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.tasks" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2016-06-30 17:39:39 +00:00
|
|
|
<Copy SourceFiles="@(MSBuildTargetsToCopy)"
|
2016-08-09 20:22:22 +00:00
|
|
|
DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
2016-08-09 21:49:13 +00:00
|
|
|
<!-- Temporary workaround for MSBuild placing their .props files in the old 14.1 directory -->
|
|
|
|
<Move SourceFiles="$(SdkOutputDirectory)/14.1/Microsoft.Common.props"
|
|
|
|
DestinationFolder="$(SdkOutputDirectory)/15.0" />
|
|
|
|
<RemoveDir Directories="$(SdkOutputDirectory)/14.1" />
|
|
|
|
|
2016-06-30 17:39:39 +00:00
|
|
|
<ItemGroup>
|
|
|
|
<FilesToClean Include="$(StageDirectory)/sdk/**/vbc.exe" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Delete Files="@(FilesToClean)" />
|
2016-06-29 21:10:55 +00:00
|
|
|
|
2016-06-30 17:39:39 +00:00
|
|
|
<ItemGroup>
|
2016-06-30 21:17:47 +00:00
|
|
|
<FilesToCopy Include="$(StageDirectory)/**/*" />
|
2016-06-30 17:39:39 +00:00
|
|
|
<PdbsToClean Include="$(StageDirectory)/sdk/**/*.pdb" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Copy SourceFiles="@(FilesToCopy)"
|
|
|
|
DestinationFiles="@(FilesToCopy->'$(StageSymbolsDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
|
|
|
|
|
|
|
<Delete Files="@(PdbsToClean)" />
|
2016-08-08 21:35:09 +00:00
|
|
|
|
|
|
|
<!-- workaround for https://github.com/Microsoft/msbuild/issues/872 -->
|
2016-08-09 07:28:41 +00:00
|
|
|
<Copy SourceFiles="$(MSBuildTargetsDirectory)/MSBuild.exe"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/MSBuild.exe" />
|
|
|
|
|
2016-08-08 21:35:09 +00:00
|
|
|
<Copy SourceFiles="$(RepoRoot)/resources/MSBuild.exe.config"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/MSBuild.exe.config" />
|
|
|
|
|
|
|
|
<Copy SourceFiles="$(RepoRoot)/resources/MSBuild.exe.config"
|
|
|
|
DestinationFiles="$(MSBuildTargetsDirectory)/MSBuild.exe.config" />
|
2016-06-30 17:39:39 +00:00
|
|
|
</Target>
|
2016-06-29 21:10:55 +00:00
|
|
|
</Project>
|