refactor(mod): renamed project file and made build script zip releases automagically

This commit is contained in:
Yui
2025-11-05 17:25:14 -03:00
parent 95c864b3c5
commit 2051cf9c7a
40 changed files with 38 additions and 21 deletions

2
.gitignore vendored
View File

@@ -3,4 +3,4 @@ obj/
/packages/ /packages/
riderModule.iml riderModule.iml
/_ReSharper.Caches/ /_ReSharper.Caches/
Server/Server.csproj.user WeebSights/WeebSights.csproj.user

View File

@@ -1,6 +1,6 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{D2A6BE7F-0C34-4655-88EF-BC319CD2C069}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeebSights", "WeebSights\WeebSights.csproj", "{D2A6BE7F-0C34-4655-88EF-BC319CD2C069}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -53,8 +53,10 @@ public class WeebItemService(ISptLogger<WeebItemService> logger, JsonUtil jsonUt
{ {
logger.Error("[Weeb Iron Sights] Failed to add filter to item " + item.Key); logger.Error("[Weeb Iron Sights] Failed to add filter to item " + item.Key);
continue; continue;
} }
#if DEBUG
logger.Success($"[Weeb Iron Sights] Added {sight.Id} to filter on item {item.Key}"); logger.Success($"[Weeb Iron Sights] Added {sight.Id} to filter on item {item.Key}");
#endif
} }
} }

View File

@@ -9,23 +9,7 @@
<AssemblyVersion>1.0.0</AssemblyVersion> <AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion> <FileVersion>1.0.0</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')" />
</ItemGroup>
<PropertyGroup>
<ModsDirectoryPath>$(SPTPath)user/mods/$(MSBuildProjectName)</ModsDirectoryPath>
</PropertyGroup>
<Target Name="CopyToSPT" AfterTargets="AfterBuild" Condition="'$(SPTPath)' != ''">
<Message Importance="high" Text="Copying mods to $(ModsDirectoryPath)" />
<ItemGroup>
<FilesToCopy Include="$(OutputPath)$(TargetName)$(TargetExt)" />
<FilesToCopy Include="$(OutputPath)$(TargetName).pdb" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(ModsDirectoryPath)" ContinueOnError="false" />
<Message Text="Files copied" />
</Target>
<ItemGroup> <ItemGroup>
<PackageReference Include="SPTarkov.Server.Core" Version="4.0.3" /> <PackageReference Include="SPTarkov.Server.Core" Version="4.0.3" />
@@ -34,7 +18,7 @@
<Content Include="bundles\**"> <Content Include="bundles\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Server.csproj.user" /> <Content Include="WeebSights.csproj.user" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="bundles.json"> <Content Include="bundles.json">
@@ -46,4 +30,35 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')" />
<PropertyGroup>
<ModsDirectoryPath>$(SPTPath)user/mods/$(MSBuildProjectName)</ModsDirectoryPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</PropertyGroup>
<Target Name="CopyToSPT" AfterTargets="AfterBuild" Condition="'$(SPTPath)' != ''">
<Message Importance="high" Text="Copying mods to $(ModsDirectoryPath)" />
<Delete Files="$(OutputPath)/$(MSBuildProjectName).deps.json" />
<ItemGroup>
<FilesToCopy Include="$(OutputPath)/**" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(ModsDirectoryPath)\%(RecursiveDir)" ContinueOnError="false" />
<Message Text="Files copied" />
</Target>
<Target Name="MakeZIPFile" AfterTargets="AfterBuild" Condition="'$(Configuration)' == 'Release'">
<ItemGroup>
<FilesToMove Include="$(OutputPath)/**"/>
</ItemGroup>
<PropertyGroup>
<FolderToMove>$(OutputPath)../package/SPT/user/mods/$(MSBuildProjectName)</FolderToMove>
</PropertyGroup>
<Message Importance="high" Text="Making zip file for redistribution" />
<MakeDir Directories="$(FolderToMove)"/>
<Move SourceFiles="@(FilesToMove)" DestinationFolder="$(FolderToMove)\%(RecursiveDir)" />
<ZipDirectory DestinationFile="$(OutputPath)../$(MSBuildProjectName)-$(AssemblyVersion)" SourceDirectory="$(OutputPath)../package/" />
</Target>
</Project> </Project>