Skip to content

Commit

Permalink
projectname instead of solutionname
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcassidy committed Sep 9, 2024
1 parent 0d2c562 commit 42fe00a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions KSPCommon.targets
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@

<ItemDefinitionGroup>
<KSPVersionFile>
<Name>$(SolutionName)</Name>
<KSP_Version>1.12</KSP_Version>
<KSP_Version_Min>1.8</KSP_Version_Min>
<KSP_Version_Max>1.12</KSP_Version_Max>
Expand All @@ -126,7 +125,13 @@

<!-- Target to generate the KSP version json file for AVC/CKAN etc-->
<Target Name="GenerateKSPVersionFile" AfterTargets="Build" Inputs="@(KSPVersionFile);$(FileVersion)" Outputs="%(KSPVersionFile.destination)">
<ReadLinesFromFile File="@(KSPVersionFile)" Condition="Exists('@(KSPVersionFile)')">
<ItemGroup>
<KSPVersionFile Update="@(KSPVersionFile)">
<Name Condition="%(KSPVersionFile.Version) == '$(ProjectName)'">$(ProjectName)</Name>
<Version Condition="%(KSPVersionFile.Version) == ''">$(FileVersion.Split(`.`)[0]).$(FileVersion.Split(`.`)[1]).$(FileVersion.Split(`.`)[2])</Version>
</KSPVersionFile>
</ItemGroup>
<ReadLinesFromFile File="%(KSPVersionFile.identity)" Condition="Exists('@(KSPVersionFile)')">
<Output TaskParameter="Lines" ItemName="_JSONLines"/>
</ReadLinesFromFile>
<PropertyGroup>
Expand All @@ -136,14 +141,7 @@
<JsonPoke Content="$(_JSON)" Query="$.NAME" RawValue="'%(KSPVersionFile.Name)'">
<Output TaskParameter="Content" PropertyName="_JSON"/>
</JsonPoke>
<JsonPoke Content="$(_JSON)" Query="$.VERSION"
RawValue="'%(KSPVersionFile.Version)'"
Condition="%(KSPVersionFile.Version) != ''">
<Output TaskParameter="Content" PropertyName="_JSON"/>
</JsonPoke>
<JsonPoke Content="$(_JSON)" Query="$.VERSION"
RawValue="'$(FileVersion.Split(`.`)[0]).$(FileVersion.Split(`.`)[1]).$(FileVersion.Split(`.`)[2])'"
Condition="%(KSPVersionFile.Version) == ''">
<JsonPoke Content="$(_JSON)" Query="$.VERSION" RawValue="'%(KSPVersionFile.Version)'">
<Output TaskParameter="Content" PropertyName="_JSON"/>
</JsonPoke>
<JsonPoke Content="$(_JSON)" Query="$.URL" RawValue="'%(KSPVersionFile.URL)'" Condition="%(KSPVersionFile.URL) != ''">
Expand Down

0 comments on commit 42fe00a

Please sign in to comment.