From 09e3085f496a615d3a977b62d14c988b03a3e122 Mon Sep 17 00:00:00 2001 From: Tashcan Date: Wed, 20 Mar 2024 11:22:17 -0700 Subject: [PATCH] Update CONTRIBUTING.md --- .gitignore | 5 ++-- .vscode/extensions.json | 5 ++++ CONTRIBUTING.md | 57 +++++++++++--------------------------- gen_compdb.ps1 | 1 + third_party/CMakeLists.txt | 2 -- 5 files changed, 25 insertions(+), 45 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 gen_compdb.ps1 delete mode 100644 third_party/CMakeLists.txt diff --git a/.gitignore b/.gitignore index e2f1168..b9cb8c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -.vscode/ +.vscode/* +!.vscode/extensions.json .vs/ /out/ /build/ @@ -8,6 +9,6 @@ compile_commands.json version.aps *.vars debug.log -enc_temp_folder/ /app/ /.xmake/ +/vsxmake*/ \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..cb55ca9 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "tboox.xmake-vscode" + ] +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e46207c..574edae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,16 +2,13 @@ ## Building -First clone and initialise the repository: +First clone and initialize the repository: ```bash git clone https://github.com/tashcan/bob.git cd bob -git submodule update --recursive --init ``` -This will download three submodules and further submodules that they have, so this will take some time to complete. - ## Installing Please note that when this project compiles, it will create a DLL called `stfc-community-patch.dll`. This @@ -52,39 +49,20 @@ apply the changes to have the SDK downloaded and installed. This will take arou #### Configure and building the project -Create or enter the `.vs/` folder and place the following in `launch.vs.json`: - -```json -{ - "version": "0.2.1", - "defaults": {}, - "configurations": [ - { - "type": "default", - "exe": "C:\\Games\\Star Trek Fleet Command\\Star Trek Fleet Command\\default\\game\\prime.exe", - "project": "CMakeLists.txt", - "projectTarget": "stfc-community-patch.dll", - "name": "Prime", - "cwd": "C:\\Games\\Star Trek Fleet Command\\Star Trek Fleet Command\\default\\game" - } - ] -} -``` - -Once they are installed, either standalone or via Visual Studio, you can open the `bob` folder inside -Visual Studio or by right clicking in a Windows Explorer via and selecting `Open with Visual Studio`. -When it first opens, it should automatically start a build to configure the project. You can -reconfigure the project by right clicking on the `CMakeLists.txt` file and selecting -`Configure STFC Community Patch`. +Once they are installed, either standalone or via Visual Studio, you can configure the `bob` project. +We are using [XMake](https://xmake.io/#/). +To configure a Visual Studio solution, simple run the following on the Command Line. -Once the project configuration has finished, you can build the project by pressing `F6` or right clicking -on the `CMakeLists.txt` file and selecting `Build`. +```powershell +xmake project -k vsxmake -m "debug,release" +``` +You will now find a `bob.sln` file inside `vsxmake2022`(or similarly named). You can simply open that in `Visual Studio` +and Build the solution. -**IMPORTANT**: To reset the build, you can remove the `out/` folder and all items beneath it. Visual +**IMPORTANT**: To reset the build, you can remove the `build/` folder and all items beneath it. Visual Studio will then rebuild the project. -**IMPORTANT**: To fully reset the project, also remove the `.vs/` folder. If you do this, please remember -to recreate the `.vs/launch.vs.json` file. +**IMPORTANT**: To fully reset the project, also remove the `.vs/` folder. ### Visual Studio Code @@ -93,21 +71,18 @@ are available. Once they are installed, either standalone or via Visual Studio, you can open the `bob` folder inside Visual Studio or by right clicking in a Windows Explorer via and selecting `Open with Visual Studio Code`. -When it first opens, it should ask you to install the CMake extensions bundle. Once the extensions are -installed, you can build the project by pressing `F7` or right clicking on the `CMakeLists.txt` file and -selecting `Build All Projects`. This will ask you to configure the project and pick various items to use -in the build on the first build only. +When it first opens, it should ask you to install the XMake extension. Once the extensions are +installed, you can build the project by navigating to the XMake section in the Activity Bar and clicking `Build All` at the top. **IMPORTANT**: To reset the build, you can remove the `build/` folder and all items beneath it. Visual -Studio will then rebuild the project. +Studio Code will then rebuild the project. ### Command Line -If you do not have Visual Studio Code, this project uses CMake, so the simplest way to build it on Windows: +If you do not have Visual Studio Code, this project uses XMake, so the simplest way to build it on Windows: ```ps1 mkdir build cd build -cmake ../ -cmake --build . +xmake ``` diff --git a/gen_compdb.ps1 b/gen_compdb.ps1 new file mode 100644 index 0000000..0fe946e --- /dev/null +++ b/gen_compdb.ps1 @@ -0,0 +1 @@ +xmake project -k compile_commands \ No newline at end of file diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt deleted file mode 100644 index f50e823..0000000 --- a/third_party/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -# add_subdirectory(abseil-cpp) -add_subdirectory(spdlog)