2016-06-27 18:45:51 +00:00
<?xml version="1.0" encoding="utf-8"?>
2016-06-28 02:09:30 +00:00
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2016-07-26 04:29:59 +00:00
<Import Project="Microsoft.DotNet.Cli.tasks" />
2016-07-21 03:42:23 +00:00
<Import Project="prepare/CheckPrereqs.targets" />
2016-06-29 07:41:38 +00:00
<Target Name="Prepare"
2017-08-11 14:09:01 +00:00
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages;IsolateArtifactsFromDirectoryBuildFiles;CreatePropsForNextStage" />
2016-06-27 18:45:51 +00:00
2016-06-29 07:41:38 +00:00
<Target Name="Init"
2017-03-08 19:10:53 +00:00
DependsOnTargets="PrintBuildInfo;
SetTelemetryProfile;
2016-07-21 03:42:23 +00:00
BuildDotnetCliBuildFramework;
CheckPrereqs;">
</Target>
2017-09-14 20:33:46 +00:00
<Target Name="SandBoxPrepare"
DependsOnTargets="PrintBuildInfo;
CheckPrereqs;
DownloadHostAndSharedFxArtifacts;
IsolateArtifactsFromDirectoryBuildFiles;
CreatePropsForNextStage">
</Target>
2017-03-08 19:10:53 +00:00
<Target Name="PrintBuildInfo">
<Message Text="Host info - Rid: $(HostRid), OSName: $(HostOSName)" Importance="High" />
<Message Text="Build info - Rid: $(Rid), Architecture: $(Architecture), OSName: $(OSName)" Importance="High" />
<Message Text="If you intended to use a different Rid, Architecture, or OSName run the following command to generate your build state:" Importance="High" />
<Message Text="dotnet msbuild build.proj /p:Architecture=Architecture /p:Rid=Rid /p:OSName=OSName /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles" Importance="High" />
</Target>
2017-02-16 03:37:51 +00:00
<Target Name="SetTelemetryProfile"
2016-07-21 03:42:23 +00:00
DependsOnTargets="BuildDotnetCliBuildFramework" >
2016-07-11 19:46:27 +00:00
<SetEnvVar Name="DOTNET_CLI_TELEMETRY_PROFILE" Value="$(DOTNET_CLI_TELEMETRY_PROFILE);https://github.com/dotnet/cli;$(CommitHash)" />
2016-06-27 18:45:51 +00:00
</Target>
2016-06-28 23:19:42 +00:00
2017-02-16 03:37:51 +00:00
<Target Name="DownloadHostAndSharedFxArtifacts">
2016-06-29 07:41:38 +00:00
2017-01-05 20:07:03 +00:00
<PropertyGroup>
<OverwriteExtractionDestination>%(_DownloadAndExtractItem.OverwriteDestination)</OverwriteExtractionDestination>
<OverwriteExtractionDestination Condition="'$(OverwriteExtractionDestination)' == ''">True</OverwriteExtractionDestination>
</PropertyGroup>
2017-09-14 20:33:46 +00:00
2016-06-29 07:41:38 +00:00
<DownloadFile Condition=" '@(_DownloadAndExtractItem)' != '' "
Uri="%(_DownloadAndExtractItem.Url)"
DestinationPath="%(_DownloadAndExtractItem.DownloadFileName)" />
2017-04-28 01:04:19 +00:00
<ZipFileExtractToDirectory Condition=" '%(_DownloadAndExtractItem.ExtractDestination)' != '' AND $([System.String]::new('%(_DownloadAndExtractItem.DownloadFileName)').EndsWith('.zip')) "
2016-07-26 04:29:59 +00:00
SourceArchive="%(_DownloadAndExtractItem.DownloadFileName)"
DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestination)"
2017-01-05 20:07:03 +00:00
OverwriteDestination="$(OverwriteExtractionDestination)" />
2016-07-26 04:29:59 +00:00
2017-04-28 01:04:19 +00:00
<TarGzFileExtractToDirectory Condition=" '%(_DownloadAndExtractItem.ExtractDestination)' != '' AND $([System.String]::new('%(_DownloadAndExtractItem.DownloadFileName)').EndsWith('.tar.gz')) "
2016-07-26 04:29:59 +00:00
SourceArchive="%(_DownloadAndExtractItem.DownloadFileName)"
DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestination)"
2017-01-05 20:07:03 +00:00
OverwriteDestination="$(OverwriteExtractionDestination)" />
2016-06-29 07:41:38 +00:00
</Target>
2016-07-21 03:42:23 +00:00
2016-10-29 08:04:20 +00:00
<Target Name="RestoreSrcPackages"
DependsOnTargets="SetupRestoreSrcPackagesInputsOutputs;Init"
Inputs="@(RestoreSrcPackagesInput)"
Outputs="@(RestoreSrcPackagesInput->'%(RelativeDir)/obj/project.assets.json');@(RestoreSrcPackagesInput->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props');@(RestoreSrcPackagesInput->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.targets')">
<CallTarget Targets="CleanSrcLockFiles" />
2017-08-11 23:13:43 +00:00
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
2016-11-12 07:46:29 +00:00
ProjectPath=""%(RestoreSrcPackagesInput.FullPath)"" />
2016-10-29 08:04:20 +00:00
</Target>
<Target Name="CleanSrcLockFiles" >
<ItemGroup>
<SrcLockFiles Include="$(RepoRoot)/src/**/project.assets.json;$(RepoRoot)/src/**/*.csproj.nuget.g.props;$(RepoRoot)/src/**/*.csproj.nuget.g.targets" />
</ItemGroup>
<Delete Files="@(SrcLockFiles)" />
</Target>
<Target Name="SetupRestoreSrcPackagesInputsOutputs">
<ItemGroup>
<RestoreSrcPackagesInput Include="$(RepoRoot)/src/**/*.csproj" Exclude="$(RepoRoot)/src/**/%24projectName%24.csproj"/>
</ItemGroup>
</Target>
<Target Name="RestoreToolsPackages"
DependsOnTargets="SetupRestoreToolsPackagesInputsOutputs;Init"
Inputs="@(RestoreToolsPackagesInput)"
Outputs="@(RestoreToolsPackagesInput->'%(RelativeDir)/obj/project.assets.json');@(RestoreToolsPackagesInput->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props');@(RestoreToolsPackagesInput->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.targets')">
<CallTarget Targets="CleanToolsLockFiles" />
2017-08-11 23:13:43 +00:00
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
2017-05-12 21:04:45 +00:00
ProjectPath=""%(RestoreToolsPackagesInput.FullPath)""
AdditionalParameters="/p:UsePortableLinuxSharedFramework=$(UsePortableLinuxSharedFramework)" />
2016-10-29 08:04:20 +00:00
</Target>
<Target Name="CleanToolsLockFiles" >
<ItemGroup>
<ToolsLockFiles Include="$(RepoRoot)/tools/**/project.assets.json;$(RepoRoot)/tools/**/*.csproj.nuget.g.props;$(RepoRoot)/tools/**/*.csproj.nuget.g.targets" />
</ItemGroup>
<Delete Files="@(ToolsLockFiles)" />
</Target>
<Target Name="SetupRestoreToolsPackagesInputsOutputs">
<ItemGroup>
<RestoreToolsPackagesInput Include="$(RepoRoot)/tools/**/*.csproj" />
</ItemGroup>
</Target>
2017-08-11 05:28:14 +00:00
<Target Name="IsolateArtifactsFromDirectoryBuildFiles">
<Copy SourceFiles="$(RepoRoot)TestAssets\Directory.Build.props"
2017-09-01 21:04:52 +00:00
DestinationFolder ="$(RepoRoot)bin"
2017-08-11 05:28:14 +00:00
SkipUnchangedFiles="true" />
</Target>
2017-08-11 14:09:01 +00:00
<Target Name="CreatePropsForNextStage">
<PropertyGroup>
<NextStagePropsContent>
<Project>
<PropertyGroup>
<PreviousStageDirectory>$(OutputDirectory)</PreviousStageDirectory>
<PreviousStageDotnet>$(DotnetInOutputDirectory)</PreviousStageDotnet>
<CliOuterBuildStage>$(CliBuildStage)</CliOuterBuildStage>
</PropertyGroup>
</Project>
</NextStagePropsContent>
<ExistingNextStagePropsContent Condition=" Exists('$(NextStagePropsPath)') ">
$([System.IO.File]::ReadAllText($(NextStagePropsPath)))
</ExistingNextStagePropsContent>
<ShouldOverwriteNextStagePropsFile>false</ShouldOverwriteNextStagePropsFile>
<ShouldOverwriteNextStagePropsFile
Condition=" '$(ExistingNextStagePropsContent.Trim())' != '$(NextStagePropsContent.Trim())' ">true</ShouldOverwriteNextStagePropsFile>
</PropertyGroup>
<WriteLinesToFile File="$(NextStagePropsPath)"
Lines="$(NextStagePropsContent)"
Condition=" '$(ShouldOverwriteNextStagePropsFile)' == 'true' "
Overwrite="true" />
</Target>
2016-07-22 23:01:32 +00:00
</Project>
2017-09-14 20:33:46 +00:00