# How to build ## Build Requirements This repository is LFS-enabled. To clone it, you should use a git client that supports git LFS 2.x and submodules. ### Windows - dotnet core 2.1+, Visual Studio 2017+ or Mono 5.x. - `UnityEngine.dll` and `UnityEditor.dll`. - 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 `[Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work ### MacOS - dotnet core 2.1+ or Mono 5.x. You can install it via brew. - `UnityEngine.dll` and `UnityEditor.dll`. - 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 `[Unity installation path]/Unity.app/Contents/Managed` into the `lib` directory in order for the build to work ## How to Build Clone the repository and its submodules in a git GUI client that supports Git LFS, or via the command line with the following command: ``` git lfs clone https://github.com/Unity-Technologies/Git-for-Unity ``` ### Windows Command Line - Release builds: `.\build` - Debug builds: `.\build -d` ### Mac, Linux and Windows bash - Release builds: `./build.sh` - Debug builds: `./build.sh -d` ### Visual Studio To build with Visual Studio, open the solution file `GitForUnity.sln`. Select `Build Solution` in the `Build` menu. ## Build artifacts Once you've built the solution for the first time, you can open `UnityProject/Git for Unity - UI` in Unity. This folder contains an empty Unity project referencing the API and UI sources as packages. 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. ### Packman (npm) sources The sources and tests for each package are versioned and copied to `build/packages` as part of the build process. Metafiles for autogenerated build artifacts (like the `Version.cs` file generated during the build) are copied from the `extras/[name of package]` folder into `build/packages`. The artifacts in `build/packages` are used for packaging during the `pack` step. ## Packaging ### Windows - Release build packaging: `.\pack` - Debug build packaging: `.\pack -d` - Build and pack in one: `.\pack -b` ### Mac, Linux, Windows Bash - Release build packaging: `./pack.sh` - Debug build packaging: `./pack.sh -d` - Build and pack in one: `./pack.sh -b` ## Packaging artifacts ### Packman (npm) - Location: `upm-ci~/packages` ### Nuget - Location: `build/nuget` ## Testing ### Windows - Test release: `.\test` - Test debug: `.\test -d` - Build and test: `.\test -b` ### Mac, Linux, Windows Bash - Test release: `./test.sh` - Test debug: `./test.sh -d` - Build and test: `./test.sh -b`