Skip to content

Commit

Permalink
Run CKANInstall when running build too
Browse files Browse the repository at this point in the history
Due to NuGet/Home#3604, `restore` targets defined in nuget packages never get run. Luckily the ckaninstall stuff only runs when needed so having it under `build` is not the end of the world
  • Loading branch information
drewcassidy committed Sep 7, 2024
1 parent 6f61483 commit 39504e5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions KSPCommon.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
</Target>

<!-- Use CKAN to install mods for any references tagged with a CKAN Identifier -->
<Target Name="CKANInstallScriptGen" BeforeTargets="_GenerateRestoreProjectSpec;Restore">
<Message Text="IntermediateOutputPath: $(Test)"/>
<Target Name="CKANInstallScriptGen">
<ItemGroup>
<_CKANCompatibleVersionItems Include="$(CKANCompatibleVersions.Split(' '))"/>
<_CKANDependency Include="%(Reference.CKANIdentifier)" Condition="%(Reference.CKANVersion) == ''"/>
Expand All @@ -45,7 +44,7 @@
</Target>

<!-- Execute generated CKAN command list -->
<Target Name="CKANInstall" DependsOnTargets="CKANInstallScriptGen" BeforeTargets="_GenerateRestoreProjectSpec;Restore" Inputs="$(CKANCommandFile)" Outputs="$(KSPRoot)/CKAN/registry.json">
<Target Name="CKANInstall" DependsOnTargets="CKANInstallScriptGen" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Build" Inputs="$(CKANCommandFile)" Outputs="$(KSPRoot)/CKAN/registry.json">
<Exec Command="cat '$(CKANCommandFile)' | ckan prompt --headless" Condition="'$(CKANDependencyList)' != ''"/>
</Target>

Expand Down

0 comments on commit 39504e5

Please sign in to comment.