Ezriilc / HyperEdit

A plugin for Kerbal Space Program.
http://www.Kerbaltek.com/hyperedit
GNU General Public License v3.0
41 stars 30 forks source link

fix build and add library path for mac #59

Closed sworisbreathing closed 5 years ago

sworisbreathing commented 5 years ago

In #52 I mentioned being unable to build the addon on my mac. There were two reasons for this:

  1. There appear to have been some changes to how the game ships the UnityEngine DLLs, so a few more assembly references are required now. Hopefully this was made across the board and isn't a Mac-specific issue.
  2. KspLibPath is in a different location on a Mac. I added a comment in the Hyperedit.csproj for what KspLibPath should be on a Mac (as well as @Ezriilc's original path).

Note that this doesn't fix the bug I introduced in #52 yet. I'll push another update to that PR to fix it.

sworisbreathing commented 5 years ago

FWIW (and because I'm not sure where exactly to document this), I'm on Visual Studio Community for Mac, version 7.5.3.

The IDE requires Mono 5.10.1 in order to launch, but Mono 5.10.1 does not include the .NET Framework 3.5 which KSP uses. So you also need to install a Mono version which

Unfortunately there doesn't seem to be a good reference page anywhere that says what versions of Mono ship with what versions of the .NET Framework.

To get it working on my machine, these are the steps that worked for me:

  1. Close Visual Studio
  2. Install Mono 4.8.0.
  3. Open a terminal and run sudo ln -sfn /Library/Frameworks/Mono.framework/Versions/5.10.1 /Library/Frameworks/Mono.framework/Versions/Current (otherwise this particular version of Visual Studio won't launch).
  4. Open Visual Studio
  5. Go to Visual Studio Community -> Preferences and select .NET Runtimes. Set 4.8.0 as the default.
Ezriilc commented 5 years ago

I'm using MS VS Community 2017 on Windows 10, and I'm able to build with the old settings, so I'm not sure if this change is needed or wise.

sworisbreathing commented 5 years ago

Maybe the way they've packed the DLLs on a Mac is different. I definitely can't build without adding these.

Also in #61 I had to add

    <Reference Include="UnityEngine.JSONSerializeModule">
      <HintPath>$(KspLibPath)\UnityEngine.JSONSerializeModule.dll</HintPath>
    </Reference>

for json support

Ezriilc commented 5 years ago

Again, I'm reluctant to merge this because my IDE is working, and it seems like fixing something that isn't broken. But I do want to make building easy for Mac users too, so... What should I do?

sworisbreathing commented 5 years ago

What about just adding them to the file, but commented out? With a comment that they might be needed on a mac?

Ezriilc commented 5 years ago

Yes, that sounds good. Thanks for the input!