-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation on development best practices for iDaVIE #413
Open
Pietersielie
wants to merge
7
commits into
main
Choose a base branch
from
cilliers/develop-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
33f1a43
Create DEVELOP.md
Pietersielie 3b5ec1f
Update DEVELOP.md
Pietersielie cbd05a9
Update CONTRIBUTING.md
Pietersielie 9405189
Update README.md
Pietersielie 4c2d419
Update DEVELOP.md
Pietersielie 572eca1
Update DEVELOP.md
Pietersielie 7f65b0b
Merge branch 'main' into cilliers/develop-docs
Pietersielie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Developing for iDaVIE | ||
## Development environment | ||
Before developing for iDaVIE, we strongly recommend that, in addition to the steps listed in the [Building from source](https://github.com/idia-astro/iDaVIE/blob/main/BUILD.md#prerequisites) document, the following steps are followed: | ||
### Install a code editor | ||
Unity will require the installation of [Visual Studio](https://visualstudio.microsoft.com/) as part of its installation, since that provides the compiler and libraries for the C# aspects of Unity. While it can serve as an IDE, we do not recommend it due to the heavy performance load it demands when in use. Instead, we recommend the following IDEs: | ||
* [Jetbrains](https://www.jetbrains.com/rider/) | ||
* [VSCode](https://code.visualstudio.com/) | ||
|
||
They are both fully functional, and considerably more lightweight than Visual Studio. In addition, both have good integration with the Unity Editor to allow for debugging iDaVIE while it is running. Consult the following resources on how to set up debugging a Unity project in the respective IDEs: | ||
* [Debugging Unity Applications with Jetbrains](https://www.jetbrains.com/help/rider/Debugging_Unity_Applications.html) | ||
* [VSCode Tools for Unity](https://marketplace.visualstudio.com/items?itemName=visualstudiotoolsforunity.vstuc) | ||
### Set up UnityYamlMerge | ||
To facilitate the merging of separate branches in iDaVIE, Unity provides a mergetool called UnityYamlMerge. This requires a few set up steps before it can be used. | ||
Pietersielie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
1. First, the iDaVIE repo should be told to use UnityYamlMerge as the mergetool. Add the following lines to the `.git/commit` file. Note the escaped slash `\\` for folder divisors -- it will not work otherwise. | ||
``` | ||
[mergetool "UnityYamlMerge"] | ||
cmd = '<path\\to\\Unity>\\Unity\\2021.3.47f1\\Editor\\Data\\Tools\\UnityYAMLMerge.exe' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED" | ||
trustExitCode = false | ||
[merge] | ||
tool = UnityYamlMerge | ||
``` | ||
2. In the folder `<path\to\Unity>\Unity\2021.3.47f1\Editor\Data\Tools`, open the `mergespecfile.txt` text file. This file contains the fallback mergetools if UnityYamlMerge cannot resolve the conflicts or filetypes. Here we recommend VSCode as the fallback. Add the following lines to the `mergespecfile.txt` file. Note that `code` is likely in the system PATH if VSCode is installed, otherwise the path of the `code.exe` executable is required. | ||
``` | ||
# VSCode | ||
* use code --wait "%r" "%l" "b" "%d" | ||
``` | ||
## Merging procedure | ||
Merging two branches of a Unity project can be problematic and very time consuming if scene files were changed in both branches. We list the steps to follow when merging two branches. | ||
1. Switch to the target branch of iDaVIE with `git switch <target>`. | ||
2. Merge with `git merge --no-commit <remote>`, where remote is the branch to be merged into the current branch. | ||
3. If any conflict in script files occur, resolve using your mergetool of choice (we recommend VSCode or a derivative thereof). | ||
4. Once all script file conflicts are resolved, resolve scene file conflicts (if any exist) using UnityYamlMerge. | ||
5. Run `git mergetool` to run UnityYaml with the settings set up earlier. | ||
6. If a temporary file conflicts, select the `current` option and complete the merge. | ||
7. Test the final merged result using the testing protocol [checklist](https://forms.gle/ezLXLHeWR4ZeLmfz7). | ||
## Testing regime | ||
We provide a testing protocol [checklist](https://forms.gle/ezLXLHeWR4ZeLmfz7) that must be completed without issues before a change can be merged into the main branch. If a new feature is added, similar testing for that feature should be developed as well (i.e., how to test that feature, and what other features might be affected by it). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will recommend the installation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How else are the C# compiler and .NET libraries installed? I don't recall seeing an option to not install Visual Studio on the first install of Unity.