Build Module
Detailed instructions on building and packaging C# language module.
The C# Language Module (plugify-module-dotnet) is a core component of Plugify that enables the creation and management of C# plugins. This guide will walk you through the process of building the module from source.
Prerequisites
Before building the C# Language Module, ensure you have the following installed:
- CMake (version 3.14 or later)
- C++ Compiler with C++23 support. Release builds use:
- GCC 14 (Linux)
- MSVC 2022 (Windows)
- Apple Clang (macOS)
- Git: the Plugify core is a submodule of the repository, so clone it with
--recursive. A separate build of the core is not needed. - .NET 10 SDK: only if you change the managed part of the module (
Plugify.dll).
Steps to Build the C# Language Module
Clone the Repository
Clone the plugify-module-dotnet repository to your local machine:
Generate Build Files
Create a build directory and generate the build files using CMake:
Build the Module
Build the module using the following command. The target name is plugify-module-dotnet.
Build the Managed Part (Optional)
The managed library Plugify.dll lives in managed/Plugify. Build it if you changed it:
The result is in managed/Plugify/bin/Release/net10.0/publish/; it replaces the contents of the module's api folder.
Verify the Build
Once the build process is complete, the compiled module will be located in the build directory. Verify the build by checking for the following files:
plugify-module-dotnet.dll(Windows)libplugify-module-dotnet.so(Linux)libplugify-module-dotnet.dylib(macOS)
Integrating the C# Language Module
After building the module, you can integrate it into your Plugify setup:
- Install a released package of the module as described in Installation. It brings the manifest and the runtime files the module needs.
- Replace the library in its
binfolder with the one from yourbuildfolder. - Run
plg loadand check thatplg moduleslists the module.
Troubleshooting
Common Issues
- Build Fails:
- Ensure that you have the correct version of CMake, .NET SDK, and a compatible C++ compiler installed.
- Verify that the submodules are cloned:
git submodule update --init --recursive.
- Module Not Loaded:
- Ensure the module file is placed in the correct directory (
envs). - Check the Plugify logs for any errors related to module loading.
- Ensure the module file is placed in the correct directory (
- Missing Symbols:
- Build the module from a release tag, so that the bundled core matches the Plugify version you run.
Advanced Configuration
For more detailed instructions on building Language Modules (e.g., configuring CMake options, enabling tests, or building documentation), refer to the Building Plugify guide. The process is similar but contains much more info.