Jump to content

[Monodevelop][*nix] I found a way to make building way more effiecient!


peachoftree

Recommended Posts

(warning common knowledge may follow)

WILL NOT WORK IN WINDOWS

Do you hate having to copy paste your mods .dll into GameData every single time you go to test a mod? Then you need my simple solution to do it for you at compile time!

step s. make a script that looks something like this


#!/bin/bash

cp dll_location/my_mod.dll ksp_folder/gameData/my_mod

replacing .dll_location with the folder where your dll is stored after build and my_mod with the name of your mod

step 2. make the script executable by going into your terminal application and entering


$ sudo chmod +x my_script_location/my_script

step 3. go into monodevelop and open Project>my_project Options>Build>Custom commands

step 4. Select "After Clean" from the drop down menu.

step 5. in the command field navigate to the location of your script and select it

step 6. in working directory write ${HOME} (assumes that the paths you put in the script are relative to your home directory)

step 7. profit! (whenever you select build, your dll should be automatically copied into GameData) WILL OVERWRITE OLD VERSIONS IN GAMEDATA.

Link to comment
Share on other sites

you can do in windows the same with a simple bat file..

but I prefere the "official" methode..

in Visual Studio, open the project settings, and change the export folder to your gamedata..

open "advanced" and select for reporting "none"..

additionally you would want to set the "copy local" setting for all linked references to false..

done..

Link to comment
Share on other sites

and here is mine(a bit too hardcoded for my taste but bat really isnt a good language to write any more convinient code in)

in this example plugin output folder must contain a folder named the same as subdir name with all the folders/files needed for the plugin. you may turn off copylocal on all non needed references/etc. and debug output.

@echo off

setlocal ENABLEDELAYEDEXPANSION

set MODELS_SOURCE=Z:/Unity/OrionPlugin/Assets/MUs
set PLUGIN_SOURCE=Z:/Unity/OrionPlugin/Testfolder/ModulePulsePropulsionEngine/Output
set KSPDIR=C:/Users/Acer/Desktop/KerbalSpaceProgram32/

set SUBDIR_NAME=YOUR_MOD_NAME
set DESTINATION=%KSPDIR%GameData

ECHO dest=%KSPDIR%GameData/
ECHO var=%DESTINATION%

xcopy "%MODELS_SOURCE%" "%PLUGIN_SOURCE%/%SUBDIR_NAME%" /D /E /C /R /I /K /Y
xcopy "%PLUGIN_SOURCE%" "%DESTINATION%" /D /E /C /R /I /K /Y

call %KSPDIR%KSP.exe
::pause

This one will only work in windows

Has an added benefit of dropping the ksp.log of the session to the script folder. Should also be runnable from inside visualstudio as a post build event. Tho i like to be able to do both updating and running at the same time. And therefore its more convinient to put it in a bat.

tho as im saying this i realise i could use a pause statement before the ksp.exe call. So i can use it as a build event (*facepalm) and not have it run ksp every time

Edited by landeTLS
Link to comment
Share on other sites

you can do in windows the same with a simple bat file..

but I prefere the "official" methode..

in Visual Studio, open the project settings, and change the export folder to your gamedata..

open "advanced" and select for reporting "none"..

additionally you would want to set the "copy local" setting for all linked references to false..

done..

I use the visual studio post build event and enter this line:

copy $(TargetFileName) C:\kerbal\KSP_winDEV\GameData\MagicSmokeIndustries\Plugins\$(TargetFileName)

Link to comment
Share on other sites

I also use VS with a post build event that fires a batch file that runs robocopy or xcopy to copy source and the .dll into my ksp development install. Sirkut's dev helper plugin which loads a specific save and scene when you start KSP is also a massive time saver!

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...