Skip to content

Commit d9f70f3

Browse files
authored
Update CONTRIBUTING.md (#1798)
* Update CONTRIBUTING.md * updated some more
1 parent edbc0eb commit d9f70f3

File tree

1 file changed

+44
-45
lines changed

1 file changed

+44
-45
lines changed

CONTRIBUTING.md

+44-45
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,54 @@
66

77
# Basics
88

9-
## Machine Setup
9+
## Quick Start
1010

1111
### Install Unity
1212

13-
We recommend using [Unity Hub](https://unity3d.com/get-unity/download). The specific version to download can be found [here](https://github.com/getsentry/sentry-unity/blob/main/samples/unity-of-bugs/ProjectSettings/ProjectVersion.txt#L1).
14-
15-
You'll need the following modules to be added in order to use Sentry Unity:
16-
* Android Build Support.
17-
* iOS Build Support.
18-
* IL2CPP Build Support for your platform.
19-
* (optional) WebGL Build Support
13+
1. Install [Unity Hub](https://unity3d.com/get-unity/download).
14+
2. [Optional] Download the Unity version specified [here](https://github.com/getsentry/sentry-unity/blob/main/samples/unity-of-bugs/ProjectSettings/ProjectVersion.txt#L1).
15+
3. Required modules:
16+
* Android Build Support
17+
* iOS Build Support
18+
* IL2CPP Build Support for your platform
19+
* (optional) WebGL Build Support
20+
4. If you installed a different version than #3: Add that version as `UNITY_VERSION` to the path (i.e. `export UNITY_VERSION=2022.3.44f1`)
2021

2122
### Install PowerShell Global tool
2223

2324
```
2425
dotnet tool install --global PowerShell
2526
```
2627

28+
### Install GitHub CLI
29+
30+
You can either download the newest release of [here](https://github.com/cli/cli/releases), or if you're on macOS use `brew install gh`. You'll need to log in through the commandline.
31+
32+
## Get the code
33+
34+
Clone the repo `git clone https://github.com/getsentry/sentry-unity.git` and `cd` into it
35+
36+
## Download the Native SDKs
37+
38+
You can save some time on the initial build by downloading the prebuild Native SDK artifacts from the last successful build of the `main` branch (requires [GH CLI](https://cli.github.com/) to be installed locally).
39+
40+
`dotnet msbuild /t:DownloadNativeSDKs src/Sentry.Unity`
41+
42+
## Build the project
43+
44+
[Optional] The build process tries to infer the Unity version by looking up the unity-of-bugs `ProjectVersion.txt`. If you've got a different version installed you can overwrite this behaviour by setting the `UNITY_VERSION` on the path, i.e. adding `export UNITY_VERSION=2022.3.44f1` to your `.zshenv`.
45+
46+
To build the whole project (including native SDKs if you've skipped the previous step), run:
47+
48+
`dotnet build`
49+
50+
> Several projects are used as submodules - [sentry-dotnet](https://github.com/getsentry/sentry-dotnet), [Ben.Demystifier](https://github.com/benaadams/Ben.Demystifier)
51+
> The submodule will be restored as a result of `dotnet build`.
52+
53+
## Advanced Setup
54+
55+
This section details the setup required to be able to build the individual Native SDKs.
56+
2757
### Setup for building the Java SDK
2858

2959
* Install Git and ensure is accessible from the PATH
@@ -57,55 +87,24 @@ Sentry Native is a sub module from Sentry Unity and for building it, currently r
5787
* Install [CMake](https://cmake.org/download/).
5888
* A supported C/C++ compiler.
5989

60-
## Get the code
61-
62-
Clone the repo `git clone https://github.com/getsentry/sentry-unity.git` and `cd` into it
63-
64-
## Build the project
65-
66-
[Optional] You can save some time on the initial build by downloading the prebuild Native SDK artifacts from the last successful build of the `main` branch (requires [GH CLI](https://cli.github.com/) to be installed locally).
67-
68-
`dotnet msbuild /t:DownloadNativeSDKs src/Sentry.Unity`
69-
70-
To build the whole project (including native SDKs if you've skipped the previous step), run:
71-
72-
`dotnet build`
73-
74-
> Several projects are used as submodules - [sentry-dotnet](https://github.com/getsentry/sentry-dotnet), [Ben.Demystifier](https://github.com/benaadams/Ben.Demystifier)
75-
> The submodule will be restored as a result of `dotnet build`.
76-
> The Unity editor is also loaded via the build if needed to restore any UPM package required by the project, like testing libraries.
77-
7890
### Run tests
7991

8092
```sh
8193
dotnet msbuild /t:"UnityPlayModeTest;UnityEditModeTest" /p:Configuration=Release test/Sentry.Unity.Tests
8294
```
8395

84-
### Smoke test by building and running a player with IL2CPP:
96+
### Running CI integration tests locally
8597

86-
```sh
87-
dotnet msbuild /t:"Build;UnityBuildStandalonePlayerIL2CPP;UnitySmokeTestStandalonePlayerIL2CPP" test/Sentry.Unity.Tests
98+
CI makes use of a handful of scripts for creating, exporting, building and smoke-testing builds for desktop and mobile platforms. We've added a script to make use of that functionality to emulate (and debug) our integration tests locally.
99+
100+
```pwsh
101+
pwsh ./test/Scripts.Integration.Test/integration-test.ps1 -Platform "Android-Export" -UnityVersion "6000"
88102
```
89103

90-
After this you can open your IDE (i.e: Visual Studio or Rider) and Unity Editor for development.
104+
Please refer to the script to make use of any optional parameters.
91105

92106
# Advanced and Troubleshooting
93107

94-
## Finding the Unity installation
95-
96-
The `UnityPath` in `src/Directory.Build.targets` does a lookup at different locations to find Unity.
97-
This is different per operating system. The repository is configured for Windows and macOS. You can adjust it as needed:
98-
99-
```xml
100-
<Project>
101-
<!-- Other properties & groups -->
102-
<PropertyGroup>
103-
<UnityPath Condition="<YOUR_PATH_CONDITION>">YOUR_PATH</UnityPath>
104-
</PropertyGroup>
105-
</Project>
106-
```
107-
> There is a configuration in place already. Just make sure it works for you or reconfigure for your needs.
108-
109108
## Project Structure
110109

111110
There are two projects involved in `sentry-unity` development. `UPM` package (`src` and `package-dev` folders) and `Unity` project (`samples/unity-of-bugs` folder, `BugFarmScene.unity`) to test the package in.

0 commit comments

Comments
 (0)