Skip to content

Commit

Permalink
Use KSPBuildTools version file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcassidy committed Aug 31, 2024
1 parent a3cf82d commit e96eda5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion KSPBuildTools
18 changes: 3 additions & 15 deletions Source/Shabby.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<!-- Version Files -->
<ItemGroup>
<VersionFile Include="$(RepoRootPath)Shabby.version">
<VersionFile Include=".">
<Destination>$(RepoRootPath)GameData/Shabby/Shabby.version</Destination>
</VersionFile>
</ItemGroup>
Expand Down Expand Up @@ -69,20 +69,8 @@
</Target>

<Target Name="MakeModDir" BeforeTargets="BeforeBuild">
<MakeDir Directories="$(RepoRootPath)GameData/Shabby"/>
<MakeDir Directories="$(RepoRootPath)GameData/Shabby" />
</Target>

<!-- Target to generate the .version file -->
<!-- Depends on the jq tool which comes included in the github actions environment and macOS 15 -->
<!-- Can be installed with Brew, Winget, or your linux package manager of choice -->
<Target Name="MakeVersionFiles" BeforeTargets="BeforeBuild" AfterTargets="MakeModDir">
<Exec Command= "cat '%(VersionFile.Identity)' | jq '.VERSION = {
MAJOR:$(VersionMajor),
MINOR:$(VersionMinor),
PATCH:$(VersionPatch),
BUILD:$(Build)
}' > '%(VersionFile.Destination)'" EchoOff="true"/>
</Target>

<Import Project="$(ProjectDir)../KSPBuildTools/KSPCommon.targets"/>
<Import Project="$(ProjectDir)../KSPBuildTools/KSPCommon.targets" />
</Project>

0 comments on commit e96eda5

Please sign in to comment.