Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit cff4c5b

Browse files
authored
Update instructions with more detail
1 parent 6f6b6f0 commit cff4c5b

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

docs/contributing/how-to-build.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,56 @@
11
# Contributing to GitHub for Unity
22

33
## Build Requirements
4-
- To build GitHub for Unity we recommend using Visual Studio 2015 or Mono 4.x and bash.
5-
- Building from the command line or from Visual Stuido requires referencing Unity DLLs
6-
- Windows: `C:\Program Files (x86)\Unity\`
7-
- macOS: `\Applications\Unity\`
8-
- Alternatively `UnityEditor.dll` and `UnityEngine.dll` can be copied to `.\script\lib`
4+
5+
This repository is LFS-enabled. To clone it, you should use a git client that supports git LFS 2.x and submodules.
6+
7+
### Windows
8+
9+
- Visual Studio 2015+ or Mono 4.x + bash shell (git bash). Mono 5.x will not work
10+
- `UnityEngine.dll` and `UnityEditor.dll`.
11+
- If you've installed Unity in the default location of `C:\Program Files\Unity` or `C:\Program Files (x86)\Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from your Unity installation into the `lib` directory in order for the build to work
12+
13+
### MacOS
14+
15+
- Mono 4.x. Mono 5.x will likely not work
16+
- `UnityEngine.dll` and `UnityEditor.dll`.
17+
- If you've installed Unity in the default location of `/Applications/Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from your Unity installation into the `lib` directory in order for the build to work
18+
19+
## Solution organization
20+
21+
The `GitHub.Unity.sln` solution includes several projects:
22+
23+
- dotnet-httpclient35 and octokit: external dependencies for threading and github api support, respectively. These are the submodules.
24+
- packaging: empty projects with build rules that copy DLLs to various locations for testing
25+
- Tests: unit and integration test projects
26+
- GitHub.Logging: A logging helper library
27+
- GitHub.Api: The core of the extension. This project is C#6 and includes async/await threading and other features that Unity cannot currently compile.
28+
- GitHub.Unity: Unity-specific code. This project is compilable by Unity
929

1030
## How to Build
1131

12-
Clone the repository and its submodules in a git GUI client or via the command line:
32+
Clone the repository and its submodules in a git GUI client that supports Git LFS or via the command line with the following commands
1333

1434
```
15-
git clone https://github.com/github-for-unity/Unity
35+
git lfs clone https://github.com/github-for-unity/Unity
1636
cd Unity
1737
git submodule init
1838
git submodule deinit script
1939
git submodule update
2040
```
21-
41+
2242
### Visual Studio
2343

2444
To build with Visual Studio 2015 open the solution file `GitHub.Unity.sln`. Select `Build Solution` in the `Build` menu.
2545

26-
### Mono and Bash
46+
### Mono and Bash (windows and mac)
2747

2848
To build with Mono 4.x and Bash execute `build.sh` in a bash shell.
2949

3050
## Build Output
3151

32-
Building the project creates an output folder named `github-unity-test` that is a sibling to the cloned repository. For instance, if the solution is located at `c:\Projects\Unity` the test output can be foud at `c:\Projects\github-unity-test`. The output folder contains a blank Unity project folder named `GitHubExtensionProject`. This folder is a blank Unity 5.5 project with GitHub for Unity installed.
52+
Once you've built the solution for the first time, you can open `src/UnityExtension/Assets/Editor/GitHub.Unity` in Unity. This folder contains the `GitHub.Unity` project and all the Unity UI and other Unity-specific code that you can have Unity compile as normal for quick testing and prototyping.
53+
54+
The build also creates a Unity test project called `GitHubExtension` inside a directory called `github-unity-test` next to your local clone. For instance, if the repository is located at `c:\Projects\Unity` the test project will be at `c:\Projects\github-unity-test\GitHubExtension`. You can use this project to test binary builds of the extension in a clean environment (all needed DLLs will be copied to it every time you build).
55+
56+
Note: some files might be locked by Unity if have one of the build output projects open when you compile from VS or the command line. This is expected and shouldn't cause issues with your builds.

0 commit comments

Comments
 (0)