-
If you have forked this repository long time ago, please go to
Settings
, scroll down to the bottom, and clickDelete Repository
. -
Go to MAA main repository and click
Fork
, thenCreate fork
. -
Clone the
dev
branch of the (forked) repository to local:git clone <link to your forked repo> -b dev
-
Configure development environment
- Download and install
Visual Studio 2022 Community
. SelectDesktop development with C++
and.NET Desktop Development
.
- Download and install
-
Double-click to open the file
MAA.sln
. Visual Studio will load the project automatically. -
Run a build to test whether the development environment has been configured correctly. Chosse
Release
&x64
, right-clickMaaWpfGui
to set it as the startup project, and run it. If the build is successful, theMaaWpfGui
window will appear. You can connect to the emulator in order to confirm again that the development environment has been configured correctly. -
Now you are free to contribute to MAA.
-
Remember to commit once you have proper number of changes. Don't forget to write a commit message.
If you are a beginner of git, you might want to make changes on a newly created branch instead of committing todev
directlygit branch your_own_branch git checkout your_own_branch
so that your new commits would grow on the new branch, without being interrupted by updates of
dev
-
After development, push your local changes to the remote (your own repository).
git push origin dev
-
Go to MAA repository and submit a Pull Request. Wait until the administrator approves it. Please note that the changes should be based on
dev
instead ofmaster
branch, and should be merged todev
branch as well. -
When there are changes from other contributors on upstreaming MAA repository, it might be necessary for you to add them to your own branch.
-
Add MAA upstream repository.
git remote add upstream https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
-
Fetch upstream changes from the repository.
git fetch upstream
-
rebase (recommended) or merge changes.
git rebase upstream/dev
or
git merge
-
Repeat step 7-10.
-
Note: operations regarding Git can be done by VS2022 instead of command line tools, using the Git changes tab.
- Download clang-format.zip or compile zzyyyl/llvm-project. You will get a
clang-format.exe
. - Search
clang-format
inTools
-Options
. - Click
Enable ClangFormat
and selectUse custom clang-format.exe file
to use theclang-format.exe
you have got in Step 1.
You are all set with the clang-format integrated in Visual Studio supporting c++20 features!
You can also format with tools\ClangFormatter\clang-formatter.py
directly, by executing in the root folder of the project:
python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MaaCore