forked from dotnet/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
87 lines (69 loc) · 4.15 KB
/
build.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="BuildTheWholeCli" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<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>
<CoreSetupChannel>release/1.1.0</CoreSetupChannel>
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
<SharedFrameworkVersion>1.1.1</SharedFrameworkVersion>
<SharedHostVersion>1.1.0</SharedHostVersion>
<HostFxrVersion>1.1.0</HostFxrVersion>
<CoreCLRVersion>1.1.1</CoreCLRVersion>
<JitVersion>1.1.1</JitVersion>
<ExeExtension>.exe</ExeExtension>
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' "></ExeExtension>
<Stage0Directory>$(RepoRoot)/.dotnet_stage0/$(Architecture)</Stage0Directory>
<Stage0PjDirectory>$(RepoRoot)/.dotnet_stage0PJ/$(Architecture)</Stage0PjDirectory>
<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/**/*.csproj" />
</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">
<Exec Command="$(DotnetStage0) publish -o $(DotnetCliBuildDirectory)/bin --framework netcoreapp1.1"
WorkingDirectory="$(DotnetCliBuildDirectory)"/>
</Target>
<ItemGroup>
<RestoreDotnetCliBuildFrameworkOutputs Include="$(DotnetCliBuildDirectory)/obj/project.assets.json" />
<RestoreDotnetCliBuildFrameworkOutputs Include="$(DotnetCliBuildDirectory)/obj/dotnet-cli-build.csproj.nuget.g.props" />
<RestoreDotnetCliBuildFrameworkOutputs Include="$(DotnetCliBuildDirectory)/obj/dotnet-cli-build.csproj.nuget.g.targets" />
</ItemGroup>
<Target Name="RestoreDotnetCliBuildFramework"
Inputs="$(DotnetCliBuildDirectory)/dotnet-cli-build.csproj"
Outputs="@(RestoreDotnetCliBuildFrameworkOutputs)">
<PropertyGroup>
<ExtraRestoreArgs Condition="'$(OS)' != 'Windows_NT'">$(ExtraRestoreArgs) --disable-parallel</ExtraRestoreArgs>
</PropertyGroup>
<Exec Command="$(DotnetStage0) restore $(ExtraRestoreArgs)"
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" />
</Project>