Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Package.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$authors$</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://raw.githubusercontent.com/schlosrat/ManeuverNodeController/master/LICENSE.md</licenseUrl>
<description>$description$</description>
<tags>ksp2 mod library nodes</tags>
<projectUrl>$repositoryUrl$</projectUrl>
<repository type="$repositoryType$" url="$repositoryUrl$" />
<readme>README.md</readme>
<dependencies>
<group targetFramework=".NETStandard2.1" />
</dependencies>
</metadata>
<files>
<file src="README.md" target="" />
<file src="LICENSE.md" target="" />
<file src="temp_nuget\*.dll" target="lib/netstandard2.1/" />
<file src="temp_nuget\*.xml" target="lib/netstandard2.1/" />
</files>
</package>
7 changes: 7 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json"/>
<add key="SpaceWarp NuGet repository" value="https://nuget.spacewarp.org/v3/index.json"/>
</packageSources>
</configuration>
6 changes: 3 additions & 3 deletions plugin_template/swinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"name": "Maneuver Node Controller",
"description": "Provides an interface to finely tune maneuver nodes.",
"source": "https://github.com/schlosrat/ManeuverNodeController",
"version": "1.2.1",
"version": "1.2.2",
"version_check": "https://raw.githubusercontent.com/schlosrat/ManeuverNodeController/main/plugin_template/swinfo.json",
"ksp2_version": {
"min": "0.2.0",
"min": "0.2.2",
"max": "*"
},
"dependencies": [
Expand All @@ -29,7 +29,7 @@
{
"id": "com.github.schlosrat.node_manager",
"version": {
"min": "0.7.1",
"min": "0.8.1",
"max": "*"
}
}
Expand Down
35 changes: 34 additions & 1 deletion src/ManeuverNodeController/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<Project>
<!-- Commands for Windows and Linux -->
<PropertyGroup>
<NuGetExecutable Condition="'$(OS)' == 'Windows_NT'">nuget</NuGetExecutable>
<NuGetExecutable Condition="'$(OS)' != 'Windows_NT'">mono /usr/local/bin/nuget.exe</NuGetExecutable>
<PowerShellExecutable Condition="'$(OS)' == 'Windows_NT'">powershell</PowerShellExecutable>
<PowerShellExecutable Condition="'$(OS)' != 'Windows_NT'">pwsh</PowerShellExecutable>
</PropertyGroup>
Expand Down Expand Up @@ -65,6 +67,28 @@
<Exec Condition="$(ConfigurationName) == Release"
Command="$(PowerShellExecutable) -Command &quot;&amp; {Push-Location '$(SolutionDir)/dist/$(ConfigurationName)'; Compress-Archive -Path './*' -DestinationPath '$(SolutionDir)/dist/$(SolutionName)-$(Version).zip'; Pop-Location}&quot;"/>

<!-- Packing NuGet package -->
<Message Text="Copying plugin DLLs and XMLs to temporary folder for NuGet packing" Condition="$(ConfigurationName) == Release"/>
<MakeDir Condition="$(ConfigurationName) == Release"
Directories="$(SolutionDir)/temp_nuget"/>
<ItemGroup Label="Plugin XMLs to be copied">
<PluginXMLs Include="$(PluginBinPath)/**/*.xml"/>
</ItemGroup>
<Copy Condition="$(ConfigurationName) == Release"
SourceFiles="@(PluginDLLs)"
DestinationFolder="$(SolutionDir)/temp_nuget"/>
<Copy Condition="$(ConfigurationName) == Release"
SourceFiles="@(PluginXMLs)"
DestinationFolder="$(SolutionDir)/temp_nuget"/>

<Message Text="Packing NuGet package" Condition="$(ConfigurationName) == Release"/>
<Exec Condition="$(ConfigurationName) == Release"
Command="$(NuGetExecutable) pack &quot;$(SolutionDir)/Package.nuspec&quot; -OutputDirectory &quot;$(SolutionDir)/nuget&quot; -Properties &quot;NoWarn=NU5125;id=$(ProjectName);version=$(Version);authors=$(Authors);description=$(Description);repositoryType=$(RepositoryType);repositoryUrl=$(RepositoryUrl)&quot;" />

<Message Text="Removing temporary folder" Condition="$(ConfigurationName) == Release"/>
<RemoveDir Condition="$(ConfigurationName) == Release"
Directories="$(SolutionDir)/temp_nuget"/>

<!-- Deploying plugin to game folder -->
<Message Text="Clean up the game's plugin folder" Condition="$(ConfigurationName) == Deploy Or $(ConfigurationName) == DeployAndRun"/>
<RemoveDir Condition="$(ConfigurationName) == Deploy Or $(ConfigurationName) == DeployAndRun"
Expand All @@ -85,5 +109,14 @@
<Message Text="Deploy plugin and run game" Condition="$(ConfigurationName) == DeployAndRun"/>
<Exec Condition="$(ConfigurationName) == DeployAndRun"
Command="$(PowerShellExecutable) &quot;start-process &quot;&quot;$(KSP2DIR)\KSP2_x64.exe&quot;&quot;&quot;"/>

<OnError ExecuteTargets="Cleanup"/>
</Target>

<!-- Clean up temporary folder if build fails -->
<Target Name="Cleanup">
<Message Text="Removing temporary folder if it exists"/>
<RemoveDir Directories="$(SolutionDir)/temp_nuget"
Condition="Exists('$(SolutionDir)/temp_nuget')"/>
</Target>
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/ManeuverNodeController/ManeuverNodeController.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all"/>
<PackageReference Include="BepInEx.Core" Version="5.*"/>
<PackageReference Include="HarmonyX" Version="2.10.1"/>
<PackageReference Include="NodeManager" Version="0.7.1"/>
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.2.0" PrivateAssets="all" Publicize="true"/>
<PackageReference Include="NodeManager" Version="0.8.1"/>
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.2.2" PrivateAssets="all" Publicize="true"/>
<PackageReference Include="SpaceWarp" Version="1.8.0"/>
<PackageReference Include="SpaceWarp.PluginInfoProps" Version="1.*"/>
<PackageReference Include="UitkForKsp2" Version="2.4.0"/>
Expand Down