dotnet-installer/build.proj

90 lines
4.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="BuildTheWholeCli" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="build/Microsoft.DotNet.Cli.Monikers.props" />
<PropertyGroup>
<!--
$(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.
-->
<PlatformScriptHost Condition=" '$(OS)' == 'Windows_NT' ">powershell -NoProfile -NoLogo -Command </PlatformScriptHost>
<PlatformScriptHost Condition=" '$(OS)' != 'Windows_NT' "></PlatformScriptHost>
<PlatformScriptExtension Condition=" '$(OS)' == 'Windows_NT' ">.ps1</PlatformScriptExtension>
<PlatformScriptExtension Condition=" '$(OS)' != 'Windows_NT' ">.sh</PlatformScriptExtension>
<CLITargets Condition=" '$(CLITargets)' == '' ">Prepare;Compile;Test;Package;Publish</CLITargets>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<CLIBuildFileName>$(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build</CLIBuildFileName>
<CLIBuildDll>$(CLIBuildFileName).dll</CLIBuildDll>
<BuildToolsDir>$(RepoRoot)/build_tools</BuildToolsDir>
<CoreSetupChannel>preview</CoreSetupChannel>
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
<SharedFrameworkVersion>1.0.0</SharedFrameworkVersion>
<SharedHostVersion>1.0.1</SharedHostVersion>
<HostFxrVersion>1.0.1</HostFxrVersion>
<CoreCLRVersion>1.0.2</CoreCLRVersion>
<JitVersion>1.0.2</JitVersion>
<ExeExtension>.exe</ExeExtension>
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' "></ExeExtension>
<Stage0Directory>$(RepoRoot)/.dotnet_stage0/$(Architecture)</Stage0Directory>
<DotnetStage0>$(Stage0Directory)/dotnet$(ExeExtension)</DotnetStage0>
<DotnetCliBuildDirectory>$(RepoRoot)/build_projects/dotnet-cli-build</DotnetCliBuildDirectory>
<PackagesDir>$(RepoRoot)/.nuget</PackagesDir>
</PropertyGroup>
<ItemGroup>
<DotnetCliBuildFrameworkInputs Include="build_projects/**/*.cs" Exclude="build_projects/**/obj/**/*.cs" />
<DotnetCliBuildFrameworkInputs Include="build_projects/**/project.json;build_projects/**/project.lock.json" />
</ItemGroup>
<!-- Workaround to "Native image cannot be loaded multiple times" issue
A target in the top level file needs to run and invoke a task
https://github.com/Microsoft/msbuild/issues/750 -->
<Target Name="MSBuildWorkaroundTarget">
<Message Text="Dont remove this target" />
</Target>
<Target Name="BuildDotnetCliBuildFramework"
Inputs="@(DotnetCliBuildFrameworkInputs)"
Outputs="$(CLIBuildDll)"
DependsOnTargets="MSBuildWorkaroundTarget;
RestoreDotnetCliBuildFramework">
<ItemGroup>
<DotnetSdkDirectories Include="$([System.IO.Directory]::GetDirectories(&quot;$(Stage0Directory)/sdk&quot;))" />
<AzureStorageToCopy Include="@(DotnetSdkDirectories)">
<Source>$(DotnetCliBuildDirectory)/bin/Microsoft.WindowsAzure.Storage.dll</Source>
<Destination>%(Identity)/Microsoft.WindowsAzure.Storage.dll</Destination>
</AzureStorageToCopy>
</ItemGroup>
<Exec Command="$(DotnetStage0) publish -o $(DotnetCliBuildDirectory)/bin --framework netcoreapp1.0" WorkingDirectory="$(DotnetCliBuildDirectory)"/>
<!-- This is a work around to issue https://github.com/Microsoft/msbuild/issues/658 -->
<Copy SourceFiles="%(AzureStorageToCopy.Source)"
DestinationFiles="%(AzureStorageToCopy.Destination)" />
</Target>
<Target Name="RestoreDotnetCliBuildFramework"
Inputs="$(DotnetCliBuildDirectory)/project.json"
Outputs="$(DotnetCliBuildDirectory)/project.lock.json">
<Exec Command="$(DotnetStage0) restore" WorkingDirectory="$(DotnetCliBuildDirectory)"/>
</Target>
<Target DependsOnTargets="$(CLITargets)" Name="BuildTheWholeCli"></Target>
<Import Project="build/Microsoft.DotNet.Cli.Prepare.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Compile.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Package.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Test.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Publish.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Run.targets" />
<Import Project="$(BuildToolsDir)/clean.targets" />
</Project>