From 4a47835d6fae46eecc9d9cf5ad97cf0773d609db Mon Sep 17 00:00:00 2001 From: illyum Date: Sun, 15 Sep 2024 01:37:29 -0600 Subject: [PATCH] refactor(engine): move files to new structure\ --- .bumpversion.cfg | 18 +++++++++++++++++ VERSION | 1 + docs/Building.md | 19 ++++++++++++++++++ docs/Developers.md | 39 ++++++++++++++++++++++++++++++++++++ engine/src/core/ICEngine.ixx | 5 +++++ engine/src/core/Logger.hpp | 19 ++++++++++++++++++ examples/CMakeLists.txt | 18 +++++++++++++++++ examples/client/client.cpp | 10 +++++++++ examples/server/server.cpp | 10 +++++++++ 9 files changed, 139 insertions(+) create mode 100644 .bumpversion.cfg create mode 100644 VERSION create mode 100644 docs/Building.md create mode 100644 docs/Developers.md create mode 100644 engine/src/core/ICEngine.ixx create mode 100644 engine/src/core/Logger.hpp create mode 100644 examples/CMakeLists.txt create mode 100644 examples/client/client.cpp create mode 100644 examples/server/server.cpp diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..06d80fa --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,18 @@ +[bumpversion] +current_version = ALPHA-2.0.0 +commit = True +tag = True +tag_name = v{new_version} + +[bumpversion:file:VERSION] +search = {current_version} +replace = {new_version} + +[bumpversion:part:major] +first_value = 2 + +[bumpversion:part:minor] +first_value = 0 + +[bumpversion:part:patch] +first_value = 0 diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..86e768a --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +ALPHA-2.0.0 \ No newline at end of file diff --git a/docs/Building.md b/docs/Building.md new file mode 100644 index 0000000..38e1e28 --- /dev/null +++ b/docs/Building.md @@ -0,0 +1,19 @@ +# Building + +ICEngine supports both single and multi type configuration types: +Make/Ninja + +```bash +cmake -S . -B build -DCMAKE_BUILD_TYPE=Release +cmake --build build +``` + +\- OR - + +Visual Studio: + +```bash +cmake -S . -B build -G "Visual Studio 16 2019" # or your preferred Visual Studio version +cmake --build build --config Debug +cmake --build build --config Release +``` diff --git a/docs/Developers.md b/docs/Developers.md new file mode 100644 index 0000000..7081b6f --- /dev/null +++ b/docs/Developers.md @@ -0,0 +1,39 @@ +# Dev Notes + +### Version Bumping + +We use a tool called `bump2version` to manage bumping versions in the project. To ensure a clean git history and avoid +conflicts, follow these steps when bumping the version: + +1. **Before bumping the version**, always `git pull` to ensure you have the latest changes from the repository. +2. Ensure no other copies of the repo are being worked on or committed before running the `bump2version` tool. +3. Bump the version using the command: + +```bash +bumpversion [major|minor|patch] +``` + +This will: + +1. Update the version in the VERSION file. +1. Automatically commit the version bump. +1. Create a Git tag with the new version (e.g., vALPHA-2.0.1). + +Push your changes and the tag to the remote repository after bumping the version: + +```bash +git push origin master --tags +``` + +ersioning Guidelines + +We follow a versioning structure of ALPHA-major.minor.patch. Here’s a breakdown of the versioning rules: + +- **Major**: The major version is incremented for significant changes that introduce new features or incompatible API + changes. +- **Minor**: The minor version is incremented for adding new functionality in a backwards-compatible manner. +- **Patch**: The patch version is incremented for bug fixes and minor improvements that don’t affect the existing + functionality. + +This will be managed by a CI/CD pipeline (or Gitea Actions) later down the line, but for now, follow these manual steps +carefully to ensure version consistency. diff --git a/engine/src/core/ICEngine.ixx b/engine/src/core/ICEngine.ixx new file mode 100644 index 0000000..4faa81d --- /dev/null +++ b/engine/src/core/ICEngine.ixx @@ -0,0 +1,5 @@ +module; + +export module ICEngine; + +export void Test() { return; } diff --git a/engine/src/core/Logger.hpp b/engine/src/core/Logger.hpp new file mode 100644 index 0000000..3e57c91 --- /dev/null +++ b/engine/src/core/Logger.hpp @@ -0,0 +1,19 @@ +// +// Created by illyum on 9/14/2024. +// + +#pragma once + +#include +#include + +class Logger { +public: + void logVersion() { + std::cout << "ICEngine Version: " << PROJECT_VERSION << std::endl; + } + + void logCrash(const std::string& errorMessage) { + std::cerr << "Crash detected in version " << PROJECT_VERSION << ": " << errorMessage << std::endl; + } +}; diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..3f40b22 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,18 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.28) +PROJECT(ICEngineExamples LANGUAGES CXX) + +SET(CMAKE_CXX_STANDARD 20) +SET(CMAKE_CXX_STANDARD_REQUIRED ON) + +FIND_PACKAGE(ICEngine REQUIRED) + +SET(SERVER_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/server/server.cpp) +SET(CLIENT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/client/client.cpp) + +ADD_EXECUTABLE(server ${SERVER_SOURCE}) +TARGET_LINK_LIBRARIES(server PRIVATE ICEngine::ICEngine) +TARGET_INCLUDE_DIRECTORIES(server PRIVATE ${ICEngine_INCLUDE_DIRS}) + +ADD_EXECUTABLE(client ${CLIENT_SOURCE}) +TARGET_LINK_LIBRARIES(client PRIVATE ICEngine::ICEngine) +TARGET_INCLUDE_DIRECTORIES(client PRIVATE ${ICEngine_INCLUDE_DIRS}) \ No newline at end of file diff --git a/examples/client/client.cpp b/examples/client/client.cpp new file mode 100644 index 0000000..157db44 --- /dev/null +++ b/examples/client/client.cpp @@ -0,0 +1,10 @@ +// +// Created by illyum on 9/15/2024. +// + +import ICEngine; + +int main() { + Test(); + return 0; +} \ No newline at end of file diff --git a/examples/server/server.cpp b/examples/server/server.cpp new file mode 100644 index 0000000..3fa2732 --- /dev/null +++ b/examples/server/server.cpp @@ -0,0 +1,10 @@ +// +// Created by illyum on 9/15/2024. +// + +import ICEngine; + +int main() { + Test(); + return 0; +} \ No newline at end of file