Skip to content

Commit 722e640

Browse files
committed
Fix #3152: update contributing.md
1 parent 81d1638 commit 722e640

File tree

1 file changed

+18
-133
lines changed

1 file changed

+18
-133
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
#### INDEX
2-
* [Pull Requests](#pull-requests)
3-
* [Nobody merges their own PR](#nobody-merges-their-own-pr)
4-
* [Setting Up Your Environment](#setting-up-your-environment)
5-
* [Assumptions](#assumptions)
6-
* [Your Repository](#setting-up-your-repository)
7-
* [Solution Dependencies](#setting-up-the-solution-dependencies)
8-
91
Pull Requests
102
=============
113

@@ -14,6 +6,7 @@ Pull Requests
146
an issue that applies to your PR, please submit a new issue with the PR.
157
* If a PR changes the scripting API, it must include all related changes to the documentation.
168
The documentation is edited by changing or adding to the `*.rst` files under `doc/source/`.
9+
* If a change is user-facing or fixes a bug, the PR should include an update to CHANGELOG.md.
1710
* Try to keep types that do not rely directly on KSP types in the `kOS.Safe` project
1811
* Try to include unit tests in `kOS.Safe.Test` for additions to `kOS.Safe`
1912
* Try to include kerboscript test scripts for new language features in `kerboscript_tests`
@@ -41,53 +34,9 @@ Pull Requests
4134
communicate the same thing, and edit the title to remove it later when
4235
it is ready.
4336

44-
## Nobody merges their own PR
45-
46-
NOTE THIS RULE IS SUSPENDED.
47-
48-
THIS RULE IS SUSPENDED BECAUSE THE DEV TEAM SHRUNK TO JUST ONE
49-
PERSON, MAKING IT IMPOSSIBLE TO GET ANY PR MERGED IF THIS RULE
50-
WAS STILL BEING FOLLOWED. (If the dev team grows again to more
51-
people, this rule may be re-instated, as it is very good practice,
52-
WHEN there's actually more than one person on the team who has the
53-
time.)
54-
55-
(Rules for priviledged members of the team who have permission to
56-
write directly to the main repository.)
57-
58-
1. (SUSPENDED - SEE ABOVE) As a general policy, even experienced developers on the team should not
59-
merge their own pull requests into the upstream `develop`. Instead they
60-
should get another developer to merge it for them.
61-
2. (SUSPENDED - SEE ABOVE) As such, even if you have permission to do so, never directly push a
62-
change to `upstream develop` except in cases where you are doing so as
63-
part of the process of merging somebody *else's* pull request other than
64-
your own, or during some of the final steps of the release checklist
65-
that require it.
66-
3. (SUSPENDED - SEE ABOVE) When merging somebody else's pull request, do not "rubber stamp" it. Actually
67-
try to read and understand what it does and how, and raise questions with
68-
the author using the github "line note" system.
69-
70-
The general principle is that doing this has two beneficial effects: (1) Redundancy.
71-
In order for a mistake to slip past, two different brains have to fail to notice it,
72-
rather than just one, and (2) In the event one developer falls off the face of
73-
the earth, never to be heard from again, everything they've done has had at least
74-
one other developer on the team with a bit of familiarity with it.
75-
76-
7737
Setting Up Your Environment
7838
===========================
7939

80-
## Assumptions
81-
82-
* `$KSP` is the full path to your Kerbal Space Program installation directory.
83-
(i.e. `"C:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program"`)
84-
* `$KOS` is the full path to your KOS git repository.
85-
* Other than examples of full paths for Windows, all paths are shown in this
86-
guide using the unix directory seperator of `/`. Please change all instances
87-
of `/` and `\` to match the style of your development environment.
88-
* You already have a C# IDE and are familiar with how to use it to build a
89-
.sln solution.
90-
9140
## Setting Up Your repository
9241

9342
1. Use the github web interface to create a fork of KSP-KOS/KOS
@@ -159,84 +108,20 @@ Setting Up Your Environment
159108

160109
## Setting Up The Solution Dependencies
161110

162-
1. Copy the folder `$KOS/Resources/GameData/kOS` to `$KSP/GameData/`
163-
164-
2. Get the Unity assemblies into your project. There are two options:
165-
166-
1. Copy these DLLs from `$KSP/KSP_x64_Data/Managed `into `$KOS/Resources` (NB: see note below about assemblies/DLLs):
167-
168-
* `Assembly-CSharp`
169-
* `Assembly-CSharp-firstpass`
170-
* `UnityEngine*.dll`
171-
172-
* ^ (Please notice the wildcard asterisk in the above point.
173-
As of KSP 1.8, The version of Unity being used has split much
174-
of its functionality into many different dlls when it used to
175-
be combined into just a few. To be sure you have all of the
176-
pieces of Unity that KSP uses, copy all the filenames of the
177-
form UnityEngine[whatever].dll from the game to your
178-
Resources folder. Some may be unnecessary, but it's
179-
better to have unneeded ones than to be missing one you
180-
ended up needing.)
181-
182-
2. Add these files as "References" to your kOS project, if they aren't already.
183-
Again, these are needed because Unity split itself into separate DLLS
184-
in the newer version that KSP 1.8 is using.
185-
(Hypothetically they should already be there in the .proj file, but check
186-
to make sure):
187-
188-
* Resources/Assembly-CSharp
189-
* Resources/Assembly-CSharp-firstpas
190-
* Resources/UnityEngine
191-
* Resources/UnityEngine.AnimationModule
192-
* Resources/UnityEngine.AudioModule
193-
* Resources/UnityEngine.CoreModule
194-
* Resources/UnityEngine.ImageConversionModule
195-
* Resources/UnityEngine.IMGUIModule
196-
* Resources/UnityEngine.InputLegacyModule
197-
* Resources/UnityEngine.TextRenderingModule
198-
* Resources/UnityEngine.UI
199-
* Resources/UnityEngine.UnityWebRequestAudioModule
200-
* Resources/UnityEngine.UnityWebRequestModule
201-
* Resources/UnityEngine.UnityWebRequestWWWModule
202-
203-
If you get any compile errors that look like the following line
204-
when you do a full rebuild, it might mean there is one of these
205-
DLLs missing from the Resources:
206-
207-
* "The type or namespace name [name here] could not be found (are you missing a using directive or an assembly reference?)"
208-
If you get one of these errors and don't know which DLL to use to fix it,
209-
here is how you find out:
210-
* Go to this page: https://docs.unity3d.com/ScriptReference/
211-
* Find the "Search Scripting" box in the top of the page.
212-
* Type the [name here] from the error message in that search box and hit enter
213-
* Click on the resulting link to go to that class's documentation page.
214-
* The Unity documentation for that class will start with some faint grey text at the top of the page that says, "Implemented in:", which tells you which DLL you need to reference to get code using that class to compile properly.
215-
216-
3. If you do not have a copy of KSP locally, you may
217-
download dummy assemblies at https://github.com/KSP-KOS/KSP_LIB
218-
219-
3. Make sure you are targeting this version of .Net: ".Net 4.0 Framework".
220-
It is *sometimes* possible to make DLLs work for newer versions of .Net,
221-
but only on some user's computers. To ensure that you remain compatible
222-
with all the target platforms (which are using an older version of Mono),
223-
you must limit yourself to .net 4.0 only. If you use a newer feature that
224-
did not exist yet in .Net 4.0, it may result in a DLL that works fine on
225-
your computer, but not all the KSP target platforms.
226-
227-
4. Tell "NuGet" to pull the packages defined in the kOS solution. (In Visual
228-
Studio, this is accomplished by right clicking the kOS Solution and picking
229-
"Restore NuGet Packages". In other dev environments it may be a different
230-
place on the menus.)
231-
232-
5. If you want building the solution to update the dlls in your KSP
233-
directory, create a symbolic link called `KSPdirlink` from the root
234-
of this repository to your KSP installation directory.
235-
236-
**Note**: the list of assemblies above is not necessarily exactly what you will need. The `UnityEngine.ImageConversionModule` assembly for example only exists on the macOS port of KSP.
237-
238-
You can build the list of assemblies yourself by building the kOS solution and looking for the "forwarded to assembly" errors. These errors should look something like this:
239-
240-
> …/KOS/src/kOS/Binding/FlightStats.cs(143,143): Error CS1069: The type name 'Rigidbody' could not be found in the namespace 'UnityEngine'. This type has been forwarded to assembly 'UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Consider adding a reference to that assembly. (CS1069) (kOS),
241-
242-
In this case the assembly you are looking for is `UnityEngine.PhysicsModule` which should be provided in the `UnityEngine.PhysicsModule.dll` DLL file.
111+
KOS makes use of [KSPBuildTools](https://github.com/kspmoddingLibs/kspbuildTools/).
112+
Please refer to that documentation for details. If you restore the nuget package
113+
references and set your KSP install root, everything should build without any
114+
modifications to the project or sln files.
115+
116+
Since KOS contains several csproj files, you should set the path to your KSP install
117+
in a solution-wide `KOS.props.user` file adjacent to `KOS.sln`. An example file
118+
is below:
119+
120+
```
121+
<?xml version="1.0" encoding="utf-8"?>
122+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
123+
<PropertyGroup>
124+
<KSPRoot>C:\Program Files (x86)\Steam\steamapps\common\KSP Stripped</KSPRoot>
125+
</PropertyGroup>
126+
</Project>
127+
```

0 commit comments

Comments
 (0)