Developing for iDaVIE
Development environment
Before developing for iDaVIE, we strongly recommend that, in addition to the steps listed in the Building iDaVIE from source document, the following steps are followed:
Install a code editor
Unity will require the installation of Visual Studio 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:
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:
Set up UnityYamlMerge
To facilitate the merging of separate branches that include merge conflicts in scene (*.unity) files in iDaVIE, Unity provides a mergetool called UnityYamlMerge. This requires a few set up steps before it can be used.
1. First, the iDaVIE repo should be told to use UnityYamlMerge as the mergetool. Add the following lines to the
.git\configfile. 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 = UnityYamlMerge2. In the folder
<path\to\Unity>\Unity\2021.3.47f1\Editor\Data\Tools, open themergespecfile.txttext 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 themergespecfile.txtfile. Note thatcodeis likely in the system PATH if VSCode is installed, otherwise the path of thecode.exeexecutable 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.
Switch to the target branch of iDaVIE with
git switch <target>.Merge with
git merge --no-commit <remote>, where remote is the branch to be merged into the current branch.If any conflict in script files occur, resolve using your mergetool of choice (we recommend VSCode or a derivative thereof).
Once all script file conflicts are resolved, resolve scene file conflicts (if any exist) using UnityYamlMerge.
Run
git mergetoolto run UnityYaml with the settings set up earlier.If a temporary file conflicts, select the
currentoption and complete the merge.Test the final merged result using the testing protocol checklist.
Testing regime
We provide a testing protocol checklist 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).