-
Notifications
You must be signed in to change notification settings - Fork 3
/
PostBuildTasks.targets
32 lines (27 loc) · 1.87 KB
/
PostBuildTasks.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Deploy" AfterTargets="Build" Condition="'$(MSBuildProjectName)' == 'ShinkaiClient'">
<!-- First, gather outputs of all projects referenced by Shinkai, and from the Patcher itself. -->
<MSBuild Projects="@(ProjectReference);$(MSBuildProjectFile)" Targets="Build">
<Output TaskParameter="TargetOutputs" ItemName="RequiredLocalAssemblies" />
</MSBuild>
<!-- In order to retrieve only local dependencies (without .NET libraries which are not copied to the bin directory anyway),
our projects have a target that returns @(ReferenceCopyLocalPaths) containing only said required files. -->
<!-- Secondly, gather dependencies from supported projects, invoking that target -->
<MSBuild
Projects="@(ProjectReference)"
Targets="ComputeRequiredLocalAssemblies"
BuildInParallel="true"
SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs" ItemName="RequiredLocalAssemblies" />
</MSBuild>
<!-- Final note: The first task could have been incorporated in ComputeRequiredLocalAssemblies,
but then projects without the target (currently only Harmony) require a fallback. -->
<Message Text="Copying dependencies to Subnautica game folder: $([System.IO.Path]::GetFullPath($(SubnauticaManaged)))" />
<!-- Also note that a bunch of dependencies come from Subnautica and are already present in the target folder.
These will be ignored by the Copy command. -->
<Message Text="@(RequiredLocalAssemblies)" />
<Copy SourceFiles="@(RequiredLocalAssemblies)" DestinationFolder="$(SubnauticaManaged)" Retries="0" ContinueOnError="true" />
<Copy SourceFiles="@(RequiredLocalAssemblies)" DestinationFolder="$(SubnauticaManagedAlt)" Retries="0" ContinueOnError="true" />
</Target>
</Project>