-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcommon.targets
More file actions
90 lines (75 loc) · 4.39 KB
/
common.targets
File metadata and controls
90 lines (75 loc) · 4.39 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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\MoonShared\MoonShared.projitems" Label="Shared" />
<!--common project properties-->
<PropertyGroup>
<Authors>moonslime</Authors>
<UniqueId>$(Authors).$(AssemblyName)</UniqueId>
<MinimumApiVersion_Behavior>UpdateFull</MinimumApiVersion_Behavior>
<MinimumGameVersion_Behavior>UpdateFull</MinimumGameVersion_Behavior>
<EntryDll>$(AssemblyName)</EntryDll>
<BaseManifest>new</BaseManifest>
<Version_AppendConfiguration>false</Version_AppendConfiguration>
<Dependencies_AlwaysIncludeRequire>true</Dependencies_AlwaysIncludeRequire>
<Dependencies_VersionBehavior>Error</Dependencies_VersionBehavior>
<ManifestComment>false</ManifestComment>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnableHarmony>true</EnableHarmony>
<GamePath>E:\SteamLibrary\steamapps\common\Stardew Valley</GamePath>
<EnableModZip Condition="$(Configuration) == 'Debug'">false</EnableModZip>
</PropertyGroup>
<!--import mod build package-->
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="Leclair.Stardew.ModManifestBuilder" Version="2.4.1" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.4.0" />
</ItemGroup>
<!--common mod build package options-->
<PropertyGroup>
<ModZipPath>$(SolutionDir)\_releases\$(Configuration)</ModZipPath>
<ModReleasePath>$(GamePath)\Mods</ModReleasePath>
<Dependencies_VersionBehavior>Ignore</Dependencies_VersionBehavior>
<References_VersionBehavior>Ignore</References_VersionBehavior>
</PropertyGroup>
<PropertyGroup>
<GameModsPath>$(GamePath)\Mods\$(AssemblyName)</GameModsPath>
<EnableModZip>false</EnableModZip>
</PropertyGroup>
<!--Deploying Content patcher files in the mod folder-->
<Target Name="DeployPack" AfterTargets="Build">
<Message Text="Running DeployPack target..." />
<ItemGroup>
<_ContentPatcherFiles Include="$(ProjectDir)ContentPatcher/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_ContentPatcherFiles)" DestinationFiles="@(_ContentPatcherFiles->'$(GameModsPath)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!--Zip up the mod for the github version (mainly used to store the latest release)-->
<Target Name="ZipPack" AfterTargets="DeployPack">
<Message Text="Running Github ZipPack target..." />
<ItemGroup>
<_ModFiles Include="$(GameModsPath)/**/*" />
<_FilesToDelete Include="$(GamePath)temp/$(AssemblyName)/$(AssemblyName)/$(AssemblyName)/config.json" />
</ItemGroup>
<Copy SourceFiles="@(_ModFiles)" DestinationFiles="@(_ModFiles->'$(GamePath)temp/$(AssemblyName)/$(AssemblyName)/%(RecursiveDir)%(Filename)%(Extension)')" />
<Delete Files="@(_FilesToDelete)" />
<!-- Use ZipDirectory after build. -->
<ZipDirectory DestinationFile="$(ModZipPath)/$(AssemblyName) 1.0.0.zip" SourceDirectory="$(GamePath)temp/$(AssemblyName)" Overwrite="True" />
<RemoveDir Directories="$(GamePath)temp" />
</Target>
<!--Zip up the mod for the github version (mainly used to store the latest release)-->
<Target Name="ZipReleaseVersion" AfterTargets="DeployPack">
<Message Text="Running Release ZipPack target..." />
<ItemGroup>
<_ModFiles Include="$(GameModsPath)/**/*" />
<_FilesToDelete Include="$(GamePath)temp/$(AssemblyName)/$(AssemblyName)/$(AssemblyName)/config.json" />
</ItemGroup>
<Copy SourceFiles="@(_ModFiles)" DestinationFiles="@(_ModFiles->'$(GamePath)temp/$(AssemblyName)/$(AssemblyName)/%(RecursiveDir)%(Filename)%(Extension)')" />
<Delete Files="@(_FilesToDelete)" />
<!-- Use ZipDirectory after build. -->
<ZipDirectory DestinationFile="$(ModReleasePath)/$(AssemblyName)-1.6-v$(Version).zip" SourceDirectory="$(GamePath)temp/$(AssemblyName)" Overwrite="True" />
<RemoveDir Directories="$(GamePath)temp" />
</Target>
</Project>