dev is the main development branch of the project. dev is a protected branch set to reject any commits that have not passed the automated checks performed by Travis CI. In order to push to dev you must first push a new branch with your changes to GitHub. The automated tests will run within a minute or two and if they pass you will be able to push your commits to dev.
- Checkout
devand pull the latest changes from GitHub -git checkout dev-git pull origin dev - Make a new branch for your changes
git checkout -b <branch-name>
- Make your changes and commits (There are many commands/options to accomplish this, these are just a few)
- See what changes you made:
git status- Shows the modified filesgit diff [<file-name>]- Shows the modified lines- Stage the changes (Choose what changes will be part of the commit)
git add <file-name>- Add a specific file or patterngit add -p- Interactively choose chunks of code to add (My favorite)git add .- Add all changes (Use sparingly)- Make the commit
git commit -m "<commit-message>"- When the commit message is shortgit commit- Will open a text editor to enter longer commit messages
- Get any new changes from
dev(It is a good idea to do this throughout the development of your feature as well.) -git pull origin dev - Push your branch to GitHub
-
git push origin <branch-name> - Wait to see if the checks passed. If they pass, create a pull request on GitHub.
-
GitHub>Pull requests>New pull request>compare: <branch-name>>Create pull request> Fill in the description >Create pull request
Keeping a consistent code format is important and reduces the occurrences of merge conflicts.
To keep a consistent style on all platforms we are using Clang-format.
- Go
To Tools>Extensions and Updates - Click on
Onlineand in the top right search "clangformat" - Click
Download,Installand thenRestart Now
- With a file open, go to
Toolsand select eitherClang Format Selection (Ctrl-R, Ctrl-F)orClang Format Document (Ctrl-R, Ctrl-D)
- Do not use
Clang Format Documentif the file you are working in was not previously formatted. This will create a lot of unnecessary noise in the commits. However all existing code is now formatted so this should not be an issue. - It is best to either:
- Format before making each commit
- Or wait until you are done adding code and have committed all your changes. Then format all your changes in a single commit at the end.
- We may reject your code if it is not properly formatted.
- Download the 32-bit version of SFML 2.4.2.
- Extract the files.
- Place the extracted folder
SFML-2.4.2at the root of the project folder. - Copy all DLL files in
\SFML-2.4.2\binto\Simulation - In Studio right-click the
Simulationproject and selectSet as StartUp Project. - Build and run the project
- Install SFML (for example,
sudo pacman -S sfmlon Arch Linux;sudo apt-get install sfmlon Ubuntu) - Install
sconsandgccthe same way, if you do not already have them - Build with
scons - Run with
./simulate