-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathLLL.DurableTask.Ui.csproj
More file actions
90 lines (75 loc) · 4.05 KB
/
Copy pathLLL.DurableTask.Ui.csproj
File metadata and controls
90 lines (75 loc) · 4.05 KB
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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<SpaRoot>app\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
</PropertyGroup>
<PropertyGroup>
<Description>UI to manage and monitor Durable Task Orchestrations</Description>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<!-- Workaround for bug https://github.com/dotnet/aspnetcore/issues/63719 -->
<Target Name="_DontPruneFileProvidersEmbedded" AfterTargets="AddPrunePackageReferences">
<ItemGroup>
<PrunePackageReference Remove="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
</Target>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.14" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.25" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<!-- Don't publish the SPA source files, but do show them in the project files list -->
<Content Remove="$(SpaRoot)**" />
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
</ItemGroup>
<Target Name="EnsureNodeEnv" BeforeTargets="PnpmInstall">
<!-- Ensure Node.js is installed -->
<Exec Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
<!-- Ensure pnpm is installed -->
<Exec Command="pnpm --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="pnpm is required to build and run this project. To continue, please install pnpm from https://pnpm.io/, and then restart your command prompt or IDE." />
</Target>
<Target Name="PnpmInstall" BeforeTargets="PnpmBuild" Condition=" !Exists('$(SpaRoot)node_modules\.modules.yaml') ">
<Message Importance="high" Text="Restoring dependencies using 'pnpm'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="pnpm install --frozen-lockfile" />
</Target>
<ItemGroup>
<SpaInputFiles Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**;$(SpaRoot)build\**" />
</ItemGroup>
<!--
pnpm build runs before DispatchToInnerBuilds (outer build, TargetFramework is empty)
to avoid parallel builds across TFMs racing on the shared app/build directory.
The !Exists check is a fallback for single-TFM builds (e.g. dotnet build -f net9.0)
where DispatchToInnerBuilds is not invoked.
-->
<Target Name="PnpmBuild" BeforeTargets="DispatchToInnerBuilds;SpaEmbedResources" Condition="'$(TargetFramework)' == '' or !Exists('$(SpaRoot)build/index.html')" Inputs="@(SpaInputFiles)" Outputs="$(SpaRoot)build/index.html">
<RemoveDir Directories="$(SpaRoot)build" />
<Exec WorkingDirectory="$(SpaRoot)" Command="pnpm build" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<RemoveDir Directories="$(SpaRoot)build" Condition="'$(ErrorCode)' != '0'" />
<Error Condition="'$(ErrorCode)' != '0'" Text="Failed to run pnpm build" />
</Target>
<Target Name="SpaEmbedResources" BeforeTargets="PrepareForBuild">
<ItemGroup>
<EmbeddedResource Include="$(SpaRoot)build\**" />
</ItemGroup>
</Target>
</Project>