Jump to content

Anyone developed on both Mac and Windows?


Recommended Posts

Yes.  You can set reference paths in the project settings, and it will also look for DLLs there (this is set in the csproj.user file, which shouldn't be included in source control and thus won't be shared when you compile on a different platform/computer).  I also remove the hint paths from the project file, but I don't think that's necessary.

Link to comment
Share on other sites

23 minutes ago, blowfish said:

Yes.  You can set reference paths in the project settings, and it will also look for DLLs there.

Thanks!  I also have a post-build step of copying my mod's .dll to the mod directory under GameData, and to start KSP.  Is there an easy way to genericize that? Using configuration variables or something?

Link to comment
Share on other sites

What I usually do is have it build into a GameData/WhateverMod/Plugins directory in the repository (which can use a relative path so it's not platform dependent), and then symlink GameData/Whatever into the KSP install I'm testing on.  The DLL itself may or may not be under version control.

Link to comment
Share on other sites

  • 2 weeks later...

I ended up just editing .csproj file by hand, adding these lines:

 

  <!-- Note that the OS for Mac is 'Unix', not sure how to specify a different dir on Linux if I ever needed to. -->
  <!-- Also, this assumes a Steam install in the default location, so its really a hack. -->
  <PropertyGroup Condition=" '$(OS)' == 'Unix' ">
    <KSPDir>/Users/$(USER)/Library/Application Support/Steam/steamapps/common/Kerbal Space Program</KSPDir>
    <KSPExe>$(KSPDir)/KSP.app/Contents/MacOS/KSP</KSPExe>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
    <KSPDir>C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program</KSPDir>
    <KSPExe>$(KSPDir)\KSP.exe</KSPExe>
  </PropertyGroup>
  <PropertyGroup>
    <KSPModDir>$(KSPDir)/GameData/AscentOptimizer/Plugins</KSPModDir>
  </PropertyGroup>
  <Target Name="AfterBuild">
    <Copy SourceFiles="$(OutputPath)/AscentOptimizer.dll" DestinationFolder="$(KSPModDir)" />
    <Exec Command="&quot;$(KSPExe)&quot;" />
  </Target>

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...