|
25 | 25 | <Version>1.0.0</Version> |
26 | 26 | <AssemblyName>Taskly</AssemblyName> |
27 | 27 | <ApplicationIcon>Assets\taskly.ico</ApplicationIcon> |
| 28 | + <TasklyRepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\..\..\..'))</TasklyRepoRoot> |
| 29 | + </PropertyGroup> |
| 30 | + |
| 31 | + <PropertyGroup Condition="'$(UseRivetBackend)' == 'true'"> |
| 32 | + <DefineConstants>$(DefineConstants);TASKLY_RIVET</DefineConstants> |
| 33 | + <RivetRoot Condition="'$(RivetRoot)' == ''">$(RIVET_ROOT)</RivetRoot> |
| 34 | + <TasklyGeneratedRivet Condition="'$(TasklyGeneratedRivet)' == ''">$(TasklyRepoRoot)\dotnet\GeneratedBackend.cs</TasklyGeneratedRivet> |
| 35 | + <TasklyRivetBundle Condition="'$(TasklyRivetBundle)' == ''">$(TasklyRepoRoot)\.rivet\dotnet\windows-x64</TasklyRivetBundle> |
28 | 36 | </PropertyGroup> |
29 | 37 |
|
30 | 38 | <ItemGroup> |
|
38 | 46 | <PackageReference Include="Velopack" Version="1.0.0" /> |
39 | 47 | </ItemGroup> |
40 | 48 |
|
| 49 | + <ItemGroup Condition="'$(UseRivetBackend)' == 'true'"> |
| 50 | + <ProjectReference Include="$(RivetRoot)\platform\dotnet\Rivet.Runtime\Rivet.Runtime.csproj" /> |
| 51 | + <Compile Include="$(TasklyGeneratedRivet)" Link="Generated\GeneratedBackend.cs" /> |
| 52 | + <RivetBootFile Include="$(TasklyRivetBundle)\runtime\**\*.*" /> |
| 53 | + <RivetResourceFile Include="$(TasklyRivetBundle)\res\**\*.*" /> |
| 54 | + <RivetNativeFile Include="$(TasklyRivetBundle)\*.dll" /> |
| 55 | + </ItemGroup> |
| 56 | + |
41 | 57 | <ItemGroup> |
42 | 58 | <Content Include="Strings\*.json"> |
43 | 59 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|
54 | 70 | </Content> |
55 | 71 | </ItemGroup> |
56 | 72 |
|
| 73 | + <Target Name="ValidateTasklyRivet" BeforeTargets="CoreCompile" Condition="'$(UseRivetBackend)' == 'true'"> |
| 74 | + <Error Condition="'$(RivetRoot)' == '' Or !Exists('$(RivetRoot)\platform\dotnet\Rivet.Runtime\Rivet.Runtime.csproj')" |
| 75 | + Text="UseRivetBackend=true requires RivetRoot (or RIVET_ROOT) to point to the pinned Rivet checkout." /> |
| 76 | + <Error Condition="!Exists('$(TasklyGeneratedRivet)')" |
| 77 | + Text="Taskly generated Rivet API is missing. Run 'raco rivet build-dotnet' from the Taskly repository first." /> |
| 78 | + <Error Condition="!Exists('$(TasklyRivetBundle)\rivet_native.dll')" |
| 79 | + Text="Taskly embedded Rivet bundle is missing. Run 'raco rivet build-dotnet' from the Taskly repository first." /> |
| 80 | + </Target> |
| 81 | + |
| 82 | + <Target Name="CopyTasklyRivetRuntime" AfterTargets="Build" Condition="'$(UseRivetBackend)' == 'true'"> |
| 83 | + <MakeDir Directories="$(OutDir)rivet\runtime;$(OutDir)rivet\res" /> |
| 84 | + <Copy SourceFiles="@(RivetBootFile)" |
| 85 | + DestinationFiles="@(RivetBootFile->'$(OutDir)rivet\runtime\%(RecursiveDir)%(Filename)%(Extension)')" /> |
| 86 | + <Copy SourceFiles="@(RivetResourceFile)" |
| 87 | + DestinationFiles="@(RivetResourceFile->'$(OutDir)rivet\res\%(RecursiveDir)%(Filename)%(Extension)')" /> |
| 88 | + <!-- The native bridge and libracketcs dependency must be beside Taskly.exe |
| 89 | + so the Windows loader can resolve them before managed startup. --> |
| 90 | + <Copy SourceFiles="@(RivetNativeFile)" DestinationFolder="$(OutDir)" /> |
| 91 | + </Target> |
| 92 | + |
57 | 93 | </Project> |
0 commit comments