-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
43 lines (39 loc) · 2.77 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
43 lines (39 loc) · 2.77 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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GameDir>$(APPDATA)\raicuparta\rai-pal\data\installed-mods\8148729079362356270\bepinex\BepInEx\plugins\</GameDir>
<!--<GameDir>Y:\SteamLibrary\steamapps\common\New Star GP\release\BepInEx\plugins\</GameDir>-->
<!--<GameDir>C:\Program Files (x86)\Steam\steamapps\common\New Star GP\release\BepInEx\plugins\</GameDir>-->
</PropertyGroup>
<Target Name="CreateAndCopyToGameDir" AfterTargets="Build" Condition="Exists('$(GameDir)')">
<PropertyGroup>
<GamePluginDir>$(GameDir)$(TargetName)</GamePluginDir>
</PropertyGroup>
<PropertyGroup>
<MozaNativeDir>$(MSBuildThisFileDirectory)libs\moza\x64\</MozaNativeDir>
</PropertyGroup>
<ItemGroup>
<!-- Managed assemblies → plugin dir -->
<FilesToCopy Include="$(TargetPath)" />
<FilesToCopy Include="$(TargetDir)TelemetryLib.dll" Condition="Exists('$(TargetDir)TelemetryLib.dll')" />
<FilesToCopy Include="$(TargetDir)MOZA_API_CSharp.dll" Condition="Exists('$(TargetDir)MOZA_API_CSharp.dll')" />
<FilesToCopy Include="$(TargetDir)Nefarius.ViGEm.Client.dll" Condition="Exists('$(TargetDir)Nefarius.ViGEm.Client.dll')" />
<!-- PDBs (Debug only) -->
<FilesToCopy Include="$(TargetDir)$(TargetName).pdb" Condition="'$(Configuration)' == 'Debug' and Exists('$(TargetDir)$(TargetName).pdb')" />
<FilesToCopy Include="$(TargetDir)TelemetryLib.pdb" Condition="'$(Configuration)' == 'Debug' and Exists('$(TargetDir)TelemetryLib.pdb')" />
<PdbFilesToDelete Include="$(GamePluginDir)\*.pdb" Condition="'$(Configuration)' == 'Release'" />
<!-- Moza native x64 DLLs → plugin dir\x64\ -->
<MozaNativeToCopy Include="$(MozaNativeDir)MOZA_SDK.dll" Condition="Exists('$(MozaNativeDir)MOZA_SDK.dll')" />
<MozaNativeToCopy Include="$(MozaNativeDir)MOZA_API_C.dll" Condition="Exists('$(MozaNativeDir)MOZA_API_C.dll')" />
</ItemGroup>
<MakeDir Directories="$(GamePluginDir)" Condition="!Exists('$(GamePluginDir)')" />
<MakeDir Directories="$(GamePluginDir)\x64" Condition="@(MozaNativeToCopy->Count()) > 0 and !Exists('$(GamePluginDir)\x64')" />
<Delete Files="@(PdbFilesToDelete)" Condition="'$(Configuration)' == 'Release'" />
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(GamePluginDir)" />
<Copy SourceFiles="@(MozaNativeToCopy)" DestinationFolder="$(GamePluginDir)\x64" />
<Message Text="[$(ProjectName)] Copied managed → $(GamePluginDir)" Importance="High" />
<Message Text="[$(ProjectName)] Copied native → $(GamePluginDir)\x64" Importance="High" Condition="@(MozaNativeToCopy->Count()) > 0" />
</Target>
<Target Name="WarnGameDirNotFound" AfterTargets="Build" Condition="!Exists('$(GameDir)')">
<Message Text="[$(ProjectName)] GameDir not found. Looked for: $(GameDir)" Importance="High" />
</Target>
</Project>