Skip to content

Commit

Permalink
Automatically generate the PVersion.cs file so that it always matches…
Browse files Browse the repository at this point in the history
… the NuGet lib version.
  • Loading branch information
peterhaneve committed Nov 25, 2024
1 parent 0c79bc5 commit f72d49d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
<DistributeMod>true</DistributeMod>
<ArchivedVersionPath></ArchivedVersionPath>
<UsePublicized>false</UsePublicized>
<PLibVersion>4.17.0.0</PLibVersion>
<PLibVersion>4.17.1.0</PLibVersion>
</PropertyGroup>
</Project>
1 change: 0 additions & 1 deletion ONIMods.sln
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ Global
{86E9BA14-F3B4-45B6-9DE6-537F6EF6EB30}.Debug|Vanilla.ActiveCfg = Debug|Vanilla
{86E9BA14-F3B4-45B6-9DE6-537F6EF6EB30}.Debug|Vanilla.Build.0 = Debug|Vanilla
{86E9BA14-F3B4-45B6-9DE6-537F6EF6EB30}.Release|Mergedown.ActiveCfg = Release|Mergedown
{86E9BA14-F3B4-45B6-9DE6-537F6EF6EB30}.Release|Mergedown.Build.0 = Release|Mergedown
{86E9BA14-F3B4-45B6-9DE6-537F6EF6EB30}.Release|Vanilla.ActiveCfg = Release|Vanilla
{86E9BA14-F3B4-45B6-9DE6-537F6EF6EB30}.Release|Vanilla.Build.0 = Release|Vanilla
{E367FD41-DCD7-4921-82A9-27783206D7BD}.Debug|Mergedown.ActiveCfg = Debug|Mergedown
Expand Down
13 changes: 13 additions & 0 deletions PLibCore/PLibCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@
<DistributeMod>false</DistributeMod>
<PLibCore>true</PLibCore>
<Platforms>Vanilla;Mergedown</Platforms>
<PLibVersionFileContent>
namespace PeterHan.PLib {
public static class PVersion {
public const string VERSION = "$(PLibVersion)"%3B
}
}
</PLibVersionFileContent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Platform)\Release\PLibCore.xml</DocumentationFile>
</PropertyGroup>
<Target Name="WriteModVersionFile" BeforeTargets="PreBuildEvent">
<WriteLinesToFile File="$(IntermediateOutputPath)\PVersion.cs" Overwrite="true" Lines="$(PLibVersionFileContent)"/>
</Target>
<ItemGroup>
<Compile Include="$(IntermediateOutputPath)\PVersion.cs" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Utils\**" />
<EmbeddedResource Remove="Utils\**" />
Expand Down
30 changes: 0 additions & 30 deletions PLibCore/PVersion.cs

This file was deleted.

0 comments on commit f72d49d

Please sign in to comment.