|
1 | 1 | # Contributing to GitHub for Unity |
2 | 2 |
|
3 | 3 | ## 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 |
9 | 29 |
|
10 | 30 | ## How to Build |
11 | 31 |
|
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 |
13 | 33 |
|
14 | 34 | ``` |
15 | | -git clone https://github.com/github-for-unity/Unity |
| 35 | +git lfs clone https://github.com/github-for-unity/Unity |
16 | 36 | cd Unity |
17 | 37 | git submodule init |
18 | 38 | git submodule deinit script |
19 | 39 | git submodule update |
20 | 40 | ``` |
21 | | - |
| 41 | + |
22 | 42 | ### Visual Studio |
23 | 43 |
|
24 | 44 | To build with Visual Studio 2015 open the solution file `GitHub.Unity.sln`. Select `Build Solution` in the `Build` menu. |
25 | 45 |
|
26 | | -### Mono and Bash |
| 46 | +### Mono and Bash (windows and mac) |
27 | 47 |
|
28 | 48 | To build with Mono 4.x and Bash execute `build.sh` in a bash shell. |
29 | 49 |
|
30 | 50 | ## Build Output |
31 | 51 |
|
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