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-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<UsingTask TaskName="FixModeFlags" AssemblyFile="$(CLIBuildDll)" />
|
|
|
|
<UsingTask TaskName="ChangeEntryPointLibraryName" AssemblyFile="$(CLIBuildDll)" />
|
|
|
|
<UsingTask TaskName="RemoveAssetFromDepsPackages" AssemblyFile="$(CLIBuildDll)" />
|
|
|
|
<UsingTask TaskName="CleanPublishOutput" AssemblyFile="$(CLIBuildDll)" />
|
|
|
|
<UsingTask TaskName="CrossgenDirectory" AssemblyFile="$(CLIBuildDll)" />
|
|
|
|
|
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
|
|
|
|
|
|
|
<Target Name="SetupStage">
|
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-05 22:09:39 +00:00
|
|
|
<DotnetExe>$(DotnetStage0)</DotnetExe>
|
2016-06-30 17:39:39 +00:00
|
|
|
</Stage>
|
|
|
|
<Stage Include="Stage2">
|
|
|
|
<Inputs>@(CompileStageInputs)</Inputs>
|
|
|
|
<StageDirectory>$(Stage2Directory)</StageDirectory>
|
|
|
|
<StageSymbolsDirectory>$(Stage2SymbolsDirectory)</StageSymbolsDirectory>
|
|
|
|
<DotnetExe>$(DotnetStage1)</DotnetExe>
|
|
|
|
</Stage>
|
2016-06-30 21:17:47 +00:00
|
|
|
</ItemGroup>
|
2016-06-30 17:39:39 +00:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="CompileStage"
|
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-06-30 21:17:47 +00:00
|
|
|
<SdkOutputDirectory>$(StageDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
|
2016-06-30 17:39:39 +00:00
|
|
|
<BinaryToCorehostifyRelDir>runtimes/any/native</BinaryToCorehostifyRelDir>
|
|
|
|
<BinaryToCorehostifyOutDir>$(SdkOutputDirectory)/$(BinaryToCorehostifyRelDir)</BinaryToCorehostifyOutDir>
|
|
|
|
<MSBuildTargetsDirectory>$(SdkOutputDirectory)/runtimes/any/native</MSBuildTargetsDirectory>
|
2016-07-01 00:34:11 +00:00
|
|
|
|
|
|
|
<SharedFrameworkNameVersionPath>$(StageDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
|
2016-06-30 17:39:39 +00:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<BinObj Include="$(SrcDirectory)/**/bin/**/*" />
|
|
|
|
<BinObj Include="$(SrcDirectory)/**/obj/**/*" />
|
|
|
|
<FilesToRemoveFromStageDirectory Include="$(StageDirectory)/**/*" />
|
|
|
|
|
2016-07-01 18:02:26 +00:00
|
|
|
<SharedFramework Include="$(SharedFrameworkPublishDirectory)/**/*" />
|
2016-06-30 17:39:39 +00:00
|
|
|
|
|
|
|
<BinariesToRemove Include="csc" />
|
|
|
|
<BinariesToRemove Include="vbc" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Delete Files="@(BinObj)" />
|
|
|
|
|
|
|
|
<Delete Files="@(FilesToRemoveFromStageDirectory)" />
|
|
|
|
<RemoveDir Directories="$(StageDirectory)" />
|
|
|
|
<MakeDir Directories="$(StageDirectory)"/>
|
|
|
|
|
|
|
|
<!-- CopySharedFramework -->
|
|
|
|
<Copy SourceFiles="@(SharedFramework)"
|
|
|
|
DestinationFiles="@(SharedFramework->'$(StageDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
|
|
|
|
|
|
|
<!-- Publish DotNet -->
|
|
|
|
<Exec Command="%(Stage.DotnetExe) publish
|
|
|
|
--native-subdirectory
|
|
|
|
--output $(SdkOutputDirectory)
|
|
|
|
--configuration $(Configuration)
|
|
|
|
--version-suffix $(CommitCount)
|
|
|
|
$(SrcDirectory)/dotnet" />
|
|
|
|
|
|
|
|
<!-- Corehostify Binaries -->
|
|
|
|
<FixModeFlags Dir="$(SdkOutputDirectory)" />
|
|
|
|
|
|
|
|
<Exec Command="%(Stage.DotnetExe) publish
|
|
|
|
--output $(SdkOutputDirectory)
|
|
|
|
--framework netcoreapp1.0
|
|
|
|
$(SrcDirectory)/compilers" />
|
|
|
|
|
|
|
|
<Copy SourceFiles="$(BinaryToCorehostifyOutDir)/csc.exe"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/csc.dll" />
|
|
|
|
|
|
|
|
<Move SourceFiles="$(BinaryToCorehostifyOutDir)/csc.exe"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/csc.exe" />
|
|
|
|
|
|
|
|
<Copy SourceFiles="$(SdkOutputDirectory)/compilers.deps.json"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/csc.deps.json" />
|
|
|
|
|
|
|
|
<Copy SourceFiles="$(SdkOutputDirectory)/compilers.runtimeconfig.json"
|
|
|
|
DestinationFiles="$(SdkOutputDirectory)/csc.runtimeconfig.json" />
|
|
|
|
|
|
|
|
<ChangeEntryPointLibraryName
|
|
|
|
DepsFile="$(SdkOutputDirectory)/csc.deps.json"
|
|
|
|
NewName="csc.deps.json" />
|
|
|
|
|
|
|
|
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/csc.deps.json"
|
|
|
|
SectionName="runtimeTargets"
|
|
|
|
AssetPath="$(BinaryToCorehostifyRelDir)/%(BinariesToRemove.Identity).exe" />
|
|
|
|
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/dotnet.deps.json"
|
|
|
|
SectionName="runtimeTargets"
|
|
|
|
AssetPath="$(BinaryToCorehostifyRelDir)/%(BinariesToRemove.Identity).exe" />
|
|
|
|
|
|
|
|
<!-- cleanup compilers project output we don't need -->
|
|
|
|
<CleanPublishOutput Path="$(SdkOutputDirectory)"
|
|
|
|
Name="compilers"
|
|
|
|
DeleteRuntimeConfigJson="true"
|
|
|
|
DeleteDepsJson="true" />
|
|
|
|
|
|
|
|
<!-- 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-06-30 21:17:47 +00:00
|
|
|
<CrossgenDirectory CoreCLRVersion="$(CoreCLRVersion)"
|
|
|
|
JitVersion="$(JitVersion)"
|
|
|
|
SharedFrameworkNameVersionPath="$(SharedFrameworkNameVersionPath)"
|
2016-06-30 17:39:39 +00:00
|
|
|
SdkOutputDirectory="$(SdkOutputDirectory)" />
|
|
|
|
|
|
|
|
<!-- 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-07-06 20:46:54 +00:00
|
|
|
DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
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)" />
|
|
|
|
</Target>
|
2016-06-29 21:10:55 +00:00
|
|
|
</Project>
|