The bot used on a Counting Server to handle messages.
The first step in contributing is to download all the necessary tools. You will need Premake5 (see Premake) and a C++ compiler (if you're using Visual Studio you're all set!).
Next, you'll need to fork this repository. You don't have permissions to push code directly to this repository, so you'll need to make your own copy. To do this, press the "Fork" button in the upper-right corner of this page, and Github magic will take care of the rest!
Now that you've got a fork, you'll need to clone it. This means that you create a local (i.e. on your own hard drive) copy of the repository.
git clone --recurse-submodule -j8 https://github.com/<MyGithubAccount>/CountingBot.git
cd CountingBot
If that didn't work, due to using an older version of git, you might want to try
git clone https://github.com/<MyGithubAccount>/CountingBot.git
cd CountingBot
git submodule update --init --recursive
Excelent, you've got a local copy of this repository. Now you need to build the code (see Building) and make your changes (for a basic Git workflow, see Git). Remember to re-run Premake whenever you add a new file.
Changes committed and pushed? Great! Create a Pull Request by going to the "Pull Requests" tab in Github. This allows others to review your code, and maybe ask you to make changes if needed. If all goes well your changes will be merged, nad you will see them appear in the main repository.
This project uses Premake for project configuration. (What is Premake?) You can get the latest version here! Make sure you have it in your PATH or in the project root directory.
-
Open a terminal in the project root directory.
-
Run premake with the action of your choice. It's as simple as:
premake5 [action]
.
A few examples of actions are:vs2017
/vs2019
(Visual Studio),gmake2
(GNU Make) andxcode4
(Xcode).
Here is a full list of available actions.(Psst! There are also a few third-party premake extensions at your disposal, in case none of the official generates pique your interest)
-
Premake will now have generated project files for the action you specified.
You should see a workspace file in the project root directory.
For Visual Studio this takes the shape of a.sln
file. For GNU Make; aMakefile
, etc..
This means that you can now build the project using the corresponding build tool on your computer.
If you're using GNU Make, for instance, you can now simply callmake
.
Otherwise, if you're using an IDE, you should open the workspace file with said IDE and you will be able to build the project.
- I get
invalid value 'Objective-C++' for compileas
, what should I do?- Update Premake, you are likely not using the latest version
- Visual Studio keeps asking me to "Retarget Solution", how can I avoid this?
- Use the right Premake action,
vs2017
for Visual Studio 2017 andvs2019
for Visual Studio 2019
- Use the right Premake action,
Note: This is just a basic workflow, for more detailed descriptions see the documentation.
Checking the status of your repository:
git status
Saving (committing) your changes (do this regularly):
# For a list of files
git add <file1> <file2>
# For all files
git add *
git commit -m "Message"
Branch management:
git branch branchName # Creates the branch
git checkout branchName # To switch to that branch
git branch -d branchName # Deletes the branch (local)
git push origin :branchName # Deletes the branch (remote)
Pushing your changes to a remote repository:
git push
Reverting back to an older commit: (WARNING: you will lose all uncommitted work)
# Find the commit ID (e.g. a1b2c3d4)
git log --oneline
git reset --hard a1b2c3d4
Ensuring your local repository is up-to-date with the original repository:
# Only do this once:
git remote add upstream https://github.com/MarcaGames/CountingBot.git
git fetch upstream
git checkout master
git merge upstream/master
Rebasing your branch (first, ensure your local repository is up-to-date with the original repository):
git checkout branchName
git rebase master