forked from PolyModdingTeam/PolyScriptTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPolyScriptTemplate.csproj
More file actions
52 lines (42 loc) · 2.32 KB
/
Copy pathPolyScriptTemplate.csproj
File metadata and controls
52 lines (42 loc) · 2.32 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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestoreAdditionalProjectSources>
https://api.nuget.org/v3/index.json;
https://nuget.bepinex.dev/v3/index.json;
https://nuget.samboy.dev/v3/index.json;
https://polymod.dev/nuget/v3/index.json;
</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PolyMod" Version="*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSBuildTasks" Version="1.5.0.235">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<PropertyGroup>
<ModFilesDir>$(ProjectDir)..\modFiles\</ModFilesDir>
<ZipFile>$(ProjectDir)..\template.polymod</ZipFile>
<SteamDir Condition="'$(SteamDir)' != ''">$(SteamDir)</SteamDir>
<SteamDir Condition="'$(SteamDir)' == '' AND '$(OS)' == 'Windows_NT'">C:\Program Files (x86)\Steam</SteamDir>
<SteamDir Condition="'$(SteamDir)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(HOME)/.steam/steam')">$(HOME)/.steam/steam</SteamDir>
<SteamDir Condition="'$(SteamDir)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(HOME)/Library/Application Support/Steam')">$(HOME)/Library/Application Support/Steam</SteamDir>
<PolytopiaModsDir>$(SteamDir)/steamapps/common/The Battle of Polytopia/Mods</PolytopiaModsDir>
</PropertyGroup>
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ModFilesDir)" />
<ItemGroup>
<FilesToZip Include="$(ModFilesDir)**\*" />
</ItemGroup>
<ZipDirectory SourceDirectory="$(ModFilesDir)" DestinationFile="$(ZipFile)" Overwrite="true" />
<Error Condition="!Exists('$(PolytopiaModsDir)')"
Text="Polytopia Mods folder not found at '$(PolytopiaModsDir)'. Please set SteamDir manually (e.g. dotnet build -p:SteamDir=/path/to/steam)." />
<Message Text="Deploying $(ZipFile) to $(PolytopiaModsDir)" Importance="high" />
<Copy SourceFiles="$(ZipFile)" DestinationFolder="$(PolytopiaModsDir)"/>
</Target>
</Project>