This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
redist.csproj
103 lines (89 loc) · 4.32 KB
/
redist.csproj
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$(RepoRoot)/build/MSBuildExtensions.targets" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<AssetTargetFallback>dotnet5.4</AssetTargetFallback>
<PackageId>Microsoft.DotNet.Cli.Runtime</PackageId>
<NoPackageAnalysis>true</NoPackageAnalysis>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\dotnet\dotnet.csproj" />
<!--
We will run tests with dotnet.deps.json from stage 0 as we do not have enough here
to regerate a full deps.json. To avoid a cycle where we have to update stage 0
when a new dll is added, set the runtimeconfig option to allow additional dlls in
app base to load.
-->
<RuntimeHostConfigurationOption
Include="Microsoft.NETCore.DotNetHostPolicy.SetAppPaths"
Value="true" />
</ItemGroup>
<Target Name="GetCustomPackageFiles"
BeforeTargets="_GetPackageFiles"
DependsOnTargets="PublishMSBuildExtensions;PublishSdks;ChmodPublishDir">
<ItemGroup>
<_PackageFiles Include="@(MSBuildExtensionsContent)" BuildAction="Content" PackageCopyToOutput="true" PackageFlatten="false" PackagePath="contentFiles\any\$(CliTargetFramework)\%(MSBuildExtensionsContent.PackagePath)" />
<_PackageFiles Include="@(SdksContent)" BuildAction="Content" PackageCopyToOutput="true" PackageFlatten="false" PackagePath="contentFiles\any\$(CliTargetFramework)\%(SdksContent.PackagePath)" />
<_BuildOutputInPackage Remove="@(_BuildOutputInPackage)" />
</ItemGroup>
</Target>
<Target Name="PublishMSBuildExtensions"
DependsOnTargets="GenerateMSBuildExtensions"
AfterTargets="Build;Publish">
<ItemGroup>
<MSBuildExtensionsContent Update="@(MSBuildExtensionsContent)">
<DestinationPath Condition="'%(MSBuildExtensionsContent.DestinationPath)' == ''">$(OutputPath)/%(MSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)</DestinationPath>
<PackagePath>%(MSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</MSBuildExtensionsContent>
</ItemGroup>
<Copy SourceFiles="@(MSBuildExtensionsContent)"
DestinationFiles="%(MSBuildExtensionsContent.DestinationPath)" />
</Target>
<Target Name="PublishSdks"
AfterTargets="Build;Publish">
<ItemGroup>
<SdksToBundle Include="$(RepoRoot)/build/RestoreDependency.proj">
<Properties>
DotNetExe=$(DotNetExe);
NuGetPackagesDir=$(NuGetPackagesDir);
SdkLayoutDirectory=$(OutputPath)Sdks/%(BundledSdk.Identity);
DependencyPackageName=%(BundledSdk.Identity);
DependencyPackageVersion=%(BundledSdk.Version)
</Properties>
</SdksToBundle>
</ItemGroup>
<MSBuild
BuildInParallel="False"
Projects="@(SdksToBundle)"
>
</MSBuild>
<ItemGroup>
<SdksContent Include="$(OutputPath)/Sdks/**/*">
<PackagePath>Sdks/%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</SdksContent>
</ItemGroup>
</Target>
<Target Name="CopySdksToPublishDir"
AfterTargets="Publish">
<Copy SourceFiles="@(MSBuildExtensionsContent)"
DestinationFiles="@(MSBuildExtensionsContent -> '$(PublishDir)%(DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(SdksContent)"
DestinationFiles="@(SdksContent -> '$(PublishDir)Sdks/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="CopyRuntimeConfiguration"
AfterTargets="Publish">
<Copy SourceFiles="$(ProjectRuntimeConfigFilePath)"
DestinationFiles="$(PublishDir)dotnet.runtimeconfig.json" />
<Copy SourceFiles="$(ProjectRuntimeConfigFilePath)"
DestinationFiles="$(PublishDir)MSBuild.runtimeconfig.json" />
</Target>
<Target Name="ChmodPublishDir"
AfterTargets="PublishMSBuildExtensions"
Condition=" '$(OS)' != 'Windows_NT' ">
<Exec Command="find $(OutputPath) -type d -exec chmod 755 {} \;" />
<Exec Command="find $(OutputPath) -type f -exec chmod 644 {} \;" />
</Target>
</Project>