Report a Bug Β· Request a Feature . Ask a Question
Table of Contents
Unlock a new era in plugin development with Plugify, a revolutionary library designed to streamline and enhance the way plugins are created and utilized. Plugify goes beyond traditional plugin management by introducing innovative language modules, redefining the boundaries of cross-language communication.
-
Dynamic Language Diversity:
Plugifyβs power is in its flexibility. It allows you to use multiple programming languages. Choose the languages you need for the project, and go. This will make your development environment more diverse and flexible. -
Language Modules:
Plugify allows you to install language modules for various programming languages, so you can use the language of your choice and develop plugins with the core without any doubt about language incompatibilities. -
Inter-Language Communication:
Make plugins communicate to each other in any existing language. Export methods, and share data between plugins, without regard for the programming language used. -
Package Manager:
Lets your system manage packages. It has a robust package manager. Install, remove, update, downgrade packages easily and make your development environment keep up with the latest packages to read. -
Versatile Packages:
The package system handles plugins and language modules, and covers most of a developerβs needs. Package your plugins and modules for easy sharing. Easily extend Plugify with new packages that meet the requirements of your project and fit the ecosystem.
The plan was to build a new plugin system for CS in C#, but some of the decisions that were made in the early version led to a decision to βremove the training wheelsβ, unshackle the system from any game or embeddable language and create a system which allows the developers of plugins to build them in whatever language they like. For as long as that language module is installed, the system is able to support it. So by no longer trying to force it to be deemed a βgoodβ solution to be embedded in a variety of games, Plugify now goes far beyond the logical limitations a C#-specific solution has. What this means is that Plugify not only has the potential to have a larger community of developers, but is now flexible from the beginning to last a long time. Longevity was always a selling point, since if it was to work, it always had to be a βforeverβ feature. Itβs not just games development that stands to benefit. The flexibility of Plugify should mean it has uses in many projects, not just in games.
- CMake version 3.14 or later.
- Doxygen version 1.8 or later.
- Requires C++20 or later.
- Designed for x86 and Arm.
- Tested on 64bit little-endian systems.
- Windows (7+)
- Linux
- macOS (13.0+)
- PlayStation 4/5
- Nintendo Switch
- Android (14+)
- iOS/iPadOS/tvOS (16.0+)
- UWP (Universal Windows, Xbox One)
- Clang 15 and above
- GCC 11 and above
- MSVC 2022 and above
- Apple Clang 15 and above
Actions build created for windows, linux and apple.
You can also use the plugify::plugify
interface target in CMake.
To use this library from a CMake project, you can locate it directly with find_package()
and use the namespaced imported target from the generated package configuration:
# CMakeLists.txt
find_package(plugify REQUIRED)
...
add_library(foo ...)
...
target_link_libraries(foo PRIVATE plugify::plugify)
To embed the library directly into an existing CMake project, place the entire source tree in a subdirectory and call add_subdirectory()
in your CMakeLists.txt
file:
# Typically you don't care so much for a third party library's tests to be
# run from your own project's code.
set(PLUGIFY_BUILD_TESTS OFF CACHE INTERNAL "")
# Don't use include(plugify/CMakeLists.txt) since that carries with it
# unintended consequences that will break the build. It's generally
# discouraged (although not necessarily well documented as such) to use
# include(...) for pulling in other CMake projects anyways.
add_subdirectory(plugify)
...
add_library(foo ...)
...
target_link_libraries(foo PRIVATE plugify::plugify)
Since CMake v3.11, FetchContent can be used to automatically download a release as a dependency at configure time.
Example:
include(FetchContent)
FetchContent_Declare(plugify URL https://github.com/untrustedmodders/plugify/releases/download/v1.0.0/plugify.tar.xz)
FetchContent_MakeAvailable(plugify)
target_link_libraries(foo PRIVATE plugify::plugify)
Note: It is recommended to use the URL approach described above which is supported as of version 1.0.0. See wiki for more information.
To allow your project to support either an externally supplied or an embedded Plugify library, you can use a pattern akin to the following:
# Top level CMakeLists.txt
project(FOO)
...
option(FOO_USE_EXTERNAL_PLUGIFY "Use an external Plugify library" OFF)
...
add_subdirectory(thirdparty)
...
add_library(foo ...)
...
# Note that the namespaced target will always be available regardless of the
# import method
target_link_libraries(foo PRIVATE plugify::plugify)
# thirdparty/CMakeLists.txt
...
if(FOO_USE_EXTERNAL_PLUGIFY)
find_package(plugify REQUIRED)
else()
add_subdirectory(plugify)
endif()
...
thirdparty/plugify
is then a complete copy of this source tree.
This code creates an instance of the object implementing the plugify::IPlugify interface. It sets up logging, initializes the instance, and then interacts with a package manager and a plugin manager if they are available. Error handling is included for initialization failures.
std::shared_ptr<plugify::IPlugify> instance = plugify::MakePlugify();
if (instance) {
auto logger = std::make_shared<StdLogger>();
instance->SetLogger(logger);
logger->SetSeverity(plugify::Severity::Debug);
if (!instance->Initialize()) {
std::cout << "No feet, no sweets!");
return EXIT_FAILURE;
}
if (auto packageManager = instance->GetPackageManager().lock()) {
packageManager->Initialize();
if (packageManager->HasMissedPackages()) {
std::cerr << "Plugin manager has missing packages." << std::endl;
packageManager->InstallMissedPackages();
continue;
}
if (packageManager->HasConflictedPackages()) {
std::cerr << "Plugin manager has conflicted packages." << std::endl;
packageManager->UninstallConflictedPackages();
continue;
}
}
if (auto pluginManager = instance->GetPluginManager().lock()) {
pluginManager->Initialize();
}
}
The documentation is based on doxygen. To build it:
cd build
cmake .. -DPLUGIFY_BUILD_DOCS=ON
cmake --build . --target docs
The API reference is created in HTML format in the build/docs/html
directory.
To navigate it with your favorite browser:
cd build
your_favorite_browser docs/html/index.html
The same version is also available online
for the latest release, that is the last stable tag.
There is also a wiki page dedicated
to the project where users can find all related documentation pages.
Additionally, we offer an online documentation generator that allows you to easily create documentation for your plugin's manifest file.
To build the basic testing app:
-
Install dependencies:
a. Windows
Setting up CMake tools with Visual Studio Installer
b. Linux:
sudo apt-get install -y build-essential cmake ninja-build
c. Mac:
brew install cmake ninja
-
Clone the repo:
git clone https://github.com/untrustedmodders/plugify.git
-
Install CURL, otherwise build it in embedding mode with cmake options:
a. Linux:
sudo apt-get install -y libcurl4-openssl-dev
b. Mac:
brew install curl
The dependencies can be used as external
(find_package)
and embedding(add_subdirectory)
, you can use plugify options to choose what you suits your need. -
Create build folder:
mkdir build cd build
-
Build the project:
cmake .. cmake --build . --target plug
Here is a list of all already implemented language modules:
- C++ Language Module
- C# (.NET) Language Module
- C# (Mono) Language Module
- Go Language Module
- Python Language Module
While Plugify is a relatively new project, it is making waves in the realm of server-side modding, particularly in the Counter-Strike 2 community. As of now, Plugify is primarily utilized in the ance of a new project known as MM2-Plugify, which is also being developed by our team.
If you know of other resources out there that are about Plugify
, feel free to open an issue or a PR and we will be glad to add them here.
See the open issues for a list of proposed features (and known issues).
- Top Feature Requests (Add your votes using the π reaction)
- Top Bugs (Add your votes using the π reaction)
- Newest Bugs
Reach out to the maintainer at one of the following places:
- Discord
- GitHub issues
- Contact options listed on this GitHub profile
If you want to say thank you or/and support active development of plugify:
- Add a GitHub Star to the project.
- Tweet about the plugify.
- Write interesting articles about the project on Dev.to, Medium or your personal blog.
Together, we can make plugify better!
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
The original setup of this repository is by untrustedmodders.
For a full list of all authors and contributors, see the contributors page.
Plugify follows good practices of security, but 100% security cannot be assured. Library is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the MIT license.
See LICENSE for more information.
[?] If your work was funded by any organization or institution, acknowledge their support here. In addition, if your work relies on other software libraries, or was inspired by looking at other work, it is appropriate to acknowledge this intellectual debt too.