Skip to content

Commit aa08144

Browse files
committed
fix: more changes related to package manager
1 parent f35f6ea commit aa08144

File tree

26 files changed

+178
-165
lines changed

26 files changed

+178
-165
lines changed

content/1.introduction/1.quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ icon: lucide:rocket
88
The documentation is currently under development and may contain inaccuracies.
99
::
1010

11-
Plugify is a powerful plugin and package manager designed to simplify multi-language plugin development. Whether you're a developer, modder, or integrator, this guide will help you get started quickly.
11+
Plugify is a powerful plugin manager designed to simplify multi-language plugin development. Whether you're a developer, modder, or integrator, this guide will help you get started quickly.
1212

1313
## General Information
1414

content/1.introduction/2.overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ icon: lucide:book-open
99
## Key Features
1010
- **Multi-Language Support**: Write plugins in any supported language, including C++, C#, Python, Go, and JavaScript.
1111
- **Inter-Language Communication**: Enable plugins written in different languages to interact and share data effortlessly.
12-
- **Package Management**: Easily install, update, and manage plugins and language modules with the built-in package manager.
12+
- **Package Management**: Easily install, update, and manage plugins and language modules with the Mamba package manager.
1313
- **Cross-Platform Compatibility**: Works on Windows, Linux, macOS, PlayStation, Nintendo Switch, Android, and iOS.
1414

1515
## Why Choose Plugify?

content/1.introduction/3.features.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: What makes Plugify powerful and unique?
44
icon: lucide:sparkles
55
---
66

7-
Plugify is a powerful and versatile plugin and package manager designed to simplify multi-language plugin development. Below is a detailed breakdown of its key features and capabilities.
7+
Plugify is a powerful and versatile plugin manager designed to simplify multi-language plugin development. Below is a detailed breakdown of its key features and capabilities.
88

99
## Multi-Language Support
1010

@@ -15,6 +15,7 @@ Plugify supports plugins written in multiple programming languages, enabling dev
1515
- **Python**: Integration with Python 3.12 and above.
1616
- **Go**: Full support for Go plugins.
1717
- **JavaScript**: Integration with the V8 engine.
18+
- **DLang**: Support of D language.
1819

1920
This flexibility allows teams to leverage their existing expertise and tools, making plugin development more accessible and efficient.
2021

@@ -28,7 +29,7 @@ Plugify enables seamless communication between plugins written in different lang
2829

2930
## Package Management
3031

31-
Plugify includes a robust package manager that simplifies the management of plugins and language modules. Key features include:
32+
Plugify could include the Mamba package manager that simplifies the management of plugins and language modules. Key features include:
3233

3334
- **Local and Remote Packages**: Manage both locally stored packages and remote packages from online repositories.
3435
- **Dependency Resolution**: Automatically resolve and install dependencies for plugins and modules.

content/1.introduction/5.faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ icon: lucide:badge-help
1111
What is Plugify?
1212

1313
#content
14-
Plugify is a **modern C++ plugin and package manager** designed to simplify and enhance plugin development across multiple programming languages. It provides a unified environment for creating, managing, and extending plugins, enabling seamless communication between plugins written in different languages. Plugify is ideal for game development, software extensibility, and cross-language projects.
14+
Plugify is a **modern C++ plugin manager** designed to simplify and enhance plugin development across multiple programming languages. It provides a unified environment for creating, managing, and extending plugins, enabling seamless communication between plugins written in different languages. Plugify is ideal for game development, software extensibility, and cross-language projects.
1515
::
1616

1717
::accordion-item
@@ -102,7 +102,7 @@ Refer to the [Language Module Development Guide](/developer-guide) for detailed
102102
How do I manage plugins and packages?
103103
104104
#content
105-
Plugify includes a robust **Package Manager** that handles:
105+
Plugify includes the **Mamba Package Manager** that handles:
106106
107107
- **Local and Remote Packages**: Manage both locally stored packages and remote packages from online repositories.
108108
- **Dependency Resolution**: Automatically resolve and install dependencies for plugins and modules.
@@ -263,7 +263,7 @@ To uninstall Plugify:
263263
264264
1. Remove the Plugify library from your project.
265265
2. Delete the `plugify.pconfig` file and the `res` folder (if no longer needed).
266-
3. If you installed Plugify system-wide, use your package manager or manually remove the installed files.
266+
3. If you installed Plugify system-wide, use Mamba package manager or manually remove the installed files.
267267
::
268268
269269
::

content/1.introduction/6.requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Plugify has the following dependencies:
7272
### Recommended Tools
7373
- **IDE**: Visual Studio 2022, CLion, or VS Code with C++ extensions.
7474
- **Debugging Tools**: GDB, LLDB, or Visual Studio Debugger.
75-
- **Package Managers**:
75+
- **Package Managers**: mamba, micromamba or conda
7676
- **Windows**: vcpkg or NuGet.
7777
- **Linux**: apt, dnf, or pacman.
7878
- **macOS**: Homebrew.

content/2.essentials/2.directory-structure.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tree:
4040
- libplugify.so
4141
- other_binaries
4242
- res:
43-
- plugins:
43+
- extensions:
4444
- my-plugin:
4545
- bin:
4646
- my-plugin.dll
@@ -51,7 +51,6 @@ tree:
5151
- another-plugin.dll
5252
- libanother-plugin.so
5353
- another-plugin.pplugin
54-
- modules:
5554
- cpp-module:
5655
- bin:
5756
- cpp-module.dll

content/2.essentials/3.building.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -262,29 +262,24 @@ cmake -DCMAKE_BUILD_TYPE=MinSizeRel -G Ninja ..
262262
263263
Plugify provides several CMake options for customization:
264264
265-
| Option | Description |
266-
|--------------------------------------|----------------------------------------------------------------------------------------------------------------|
267-
| `-DPLUGIFY_BUILD_TESTS=ON` | Enable building tests |
268-
| `-DPLUGIFY_BUILD_JIT=OFF` | Build JIT object library |
269-
| `-DPLUGIFY_BUILD_ASSEMBLY=OFF` | Build assembly object library |
270-
| `-DPLUGIFY_BUILD_DOCS=OFF` | Enable building with documentation |
271-
| `-DPLUGIFY_BUILD_OBJECT_LIB=OFF` | Build Plugify as an object library |
272-
| `-DPLUGIFY_BUILD_SHARED_LIB=ON` | Build Plugify as a shared library |
273-
| `-DPLUGIFY_BUILD_SHARED_ASMJIT=OFF` | Build AsmJit as a shared library |
274-
| `-DPLUGIFY_BUILD_SHARED_CURL=OFF` | Build cURL as a shared library |
275-
| `-DPLUGIFY_USE_EXTERNAL_ASMJIT=OFF` | Use an external AsmJit library |
276-
| `-DPLUGIFY_USE_EXTERNAL_GLAZE=OFF` | Use an external Glaze library |
277-
| `-DPLUGIFY_USE_EXTERNAL_CURL=ON` | Use an external cURL library |
278-
| `-DPLUGIFY_USE_EXTERNAL_FMT=OFF` | Use an external fmt library |
279-
| `-DPLUGIFY_INTERFACE=OFF` | Build as a lightweight interface for language modules |
280-
| `-DPLUGIFY_DOWNLOADER=ON` | Enable the downloader for the package manager |
281-
| `-DPLUGIFY_LOGGING=ON` | Enable the logging system |
282-
| `-DPLUGIFY_DEBUG=ON` | Enable debugging mode (asserts) |
283-
| `-DPLUGIFY_USE_LIBCPP=OFF` | Use libc++ by adding `-stdlib=libc++` flag if available |
284-
| `-DPLUGIFY_USE_STATIC_STDLIB=OFF` | Enable static standard library linkage to avoid ABI issues by adding `-static-*` flags if available |
285-
| `-DPLUGIFY_USE_SANITIZER=OFF` | Enable sanitizers by adding `-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined` flags if available |
286-
| `-DPLUGIFY_USE_CLANG_TIDY=OFF` | Enable static analysis with clang-tidy |
287-
| `-DPLUGIFY_USE_ABI0=ON` | Enable use of the older C++ ABI, which was the default in GCC versions before GCC 5 |
265+
| Option | Description |
266+
|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
267+
| `-DPLUGIFY_BUILD_TESTS=ON` | Enable building tests |
268+
| `-DPLUGIFY_BUILD_DOCS=OFF` | Enable building with documentation |
269+
| `-DPLUGIFY_BUILD_OBJECT_LIB=OFF` | Build Plugify as an object library |
270+
| `-DPLUGIFY_BUILD_SHARED_LIB=ON` | Build Plugify as a shared library |
271+
| `-DPLUGIFY_BUILD_SHARED_ASMJIT=OFF` | Build AsmJit as a shared library |
272+
| `-DPLUGIFY_USE_EXTERNAL_ASMJIT=OFF` | Use an external AsmJit library |
273+
| `-DPLUGIFY_USE_EXTERNAL_GLAZE=OFF` | Use an external Glaze library |
274+
| `-PLUGIFY_USE_EXTERNAL_LIBSOLV=ON` | Use an external LibSolv library |
275+
| `-DPLUGIFY_USE_EXTERNAL_FMT=OFF` | Use an external fmt library |
276+
| `-DPLUGIFY_USE_LIBCPP=OFF` | Use libc++ by adding `-stdlib=libc++` flag if available |
277+
| `-DPLUGIFY_USE_STATIC_STDLIB=OFF` | Enable static standard library linkage to avoid ABI issues by adding `-static-*` flags if available |
278+
| `-DPLUGIFY_USE_SANITIZER=OFF` | Enable sanitizers by adding `-fsanitize=*` flags if available |
279+
| `-PLUGIFY_SANITIZER_PATH=""` | Path to sanitizes libraries. |
280+
| `-PLUGIFY_ENABLED_SANITIZERS=address` | Semicolon separated list of sanitizer names. E.g 'address;leak'. Supported sanitizers are address, leak, undefined and thread. |
281+
| `-DPLUGIFY_USE_CLANG_TIDY=OFF` | Enable static analysis with clang-tidy |
282+
| `-DPLUGIFY_USE_ABI0=ON` | Enable use of the older C++ ABI, which was the default in GCC versions before GCC 5 |
288283
289284
## Testing the Build
290285

content/2.essentials/4.integrating.md

Lines changed: 85 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -93,46 +93,95 @@ In this setup, `thirdparty/plugify` should contain a complete copy of the Plugif
9393

9494
## Example: Initializing Plugify in Your Application
9595

96-
Once integrated, you can initialize Plugify in your application as follows:
96+
This code creates an instance of the plugify::Plugify object. It sets up services, initializes the instance, and then interacts with a plugin manager. Error handling is included for initialization failures.
9797

9898
::code-group
9999
```c++ [main.cpp]
100+
// Example 1: Simple usage with defaults
100101
int main() {
101-
// Create a Plugify instance
102-
std::shared_ptr<plugify::IPlugify> instance = plugify::MakePlugify();
103-
if (instance) {
104-
// Set up logging
105-
auto logger = std::make_shared<CustomLogger>();
106-
instance->SetLogger(logger);
107-
logger->SetSeverity(plugify::Severity::Debug);
108-
109-
// Initialize Plugify
110-
if (!instance->Initialize()) {
111-
std::cerr << "Failed to initialize Plugify!" << std::endl;
112-
return EXIT_FAILURE;
113-
}
114-
115-
// Access the Package Manager
116-
if (auto packageManager = instance->GetPackageManager().lock()) {
117-
packageManager->Initialize();
118-
119-
// Handle missing or conflicted packages
120-
if (packageManager->HasMissedPackages()) {
121-
std::cerr << "Plugin manager has missing packages." << std::endl;
122-
packageManager->InstallMissedPackages();
123-
}
124-
if (packageManager->HasConflictedPackages()) {
125-
std::cerr << "Plugin manager has conflicted packages." << std::endl;
126-
packageManager->UninstallConflictedPackages();
127-
}
128-
}
129-
130-
// Access the Plugin Manager
131-
if (auto pluginManager = instance->GetPluginManager().lock()) {
132-
pluginManager->Initialize();
133-
}
134-
}
135-
return EXIT_SUCCESS;
102+
auto result = plugify::MakePlugify("./app");
103+
if (!result) {
104+
std::cerr << "Failed to create Plugify: " << result.error().message << std::endl;
105+
return 1;
106+
}
107+
108+
auto plugify = result.value();
109+
if (auto initResult = plugify->Initialize(); !initResult) {
110+
std::cerr << "Failed to initialize: " << initResult.error().message << std::endl;
111+
return 1;
112+
}
113+
114+
// Load extensions
115+
const auto& manager = plugify->GetManager();
116+
manager->Initialize();
117+
118+
// Main loop
119+
bool running = true;
120+
while (running) {
121+
plugify->Update();
122+
// Your application logic here
123+
}
124+
125+
plugify->Terminate();
126+
return 0;
127+
}
128+
```
129+
::
130+
131+
::code-group
132+
```c++ [main.cpp]
133+
// Example 2: Advanced configuration
134+
int main() {
135+
// Create custom logger
136+
auto logger = std::make_shared<plugify::impl::AsyncLogger>(
137+
std::make_shared<plugify::impl::FileLogger>("./logs/app.log")
138+
);
139+
140+
// Configure plugin manager
141+
plugify::Config config;
142+
config.paths.baseDir = "./app";
143+
config.paths.extensionsDir = "extensions";
144+
config.loading.enableHotReload = true;
145+
config.loading.parallelLoading = true;
146+
config.runtime.updateInterval = std::chrono::milliseconds(16);
147+
148+
// Build Plugify instance
149+
auto result = plugify::Plugify::CreateBuilder()
150+
.WithConfig(config)
151+
.WithLogger(logger)
152+
.WithService<MyCustomService>(std::make_shared<MyCustomServiceImpl>())
153+
.Build();
154+
155+
if (!result) {
156+
std::cerr << "Failed: " << result.error().message << std::endl;
157+
return 1;
158+
}
159+
160+
auto plugify = result.value();
161+
162+
// Initialize asynchronously
163+
auto initFuture = plugify->InitializeAsync();
164+
165+
// Do other initialization...
166+
167+
// Wait for initialization
168+
if (auto initResult = initFuture.get(); !initResult) {
169+
std::cerr << "Failed to initialize: " << initResult.error().message << std::endl;
170+
return 1;
171+
}
172+
173+
// Access service locator for convenient operations
174+
auto logger = plugify->GetServices().Resolve<ILogger>();
175+
logger->Log("Application started", Severity::Info);
176+
177+
// Main loop
178+
bool running = true;
179+
while (running) {
180+
plugify->Update();
181+
}
182+
183+
plugify->Terminate();
184+
return 0;
136185
}
137186
```
138187
::

content/3.use-cases/1.metamod-plugin/2.installation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ tree:
4343
- ^plugify.dll^
4444
- linuxsteamrt64:
4545
- ^libplugify.so^
46-
- modules:
47-
- plugins:
46+
- extensions:
4847
- ^plugify.pconfig^
4948
- csgo_core:
5049
- csgo_imported:

content/3.use-cases/1.metamod-plugin/4.updating.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The output should display the updated version of Plugify.
3434

3535
## **Automatic Update**
3636

37-
Plugify seamlessly integrates with a **package manager**, a tool that automates the process of installing, upgrading, configuring, and removing packages (plugins and language modules) in a consistent manner. Each plugin and language module is considered a package, and the package manager simplifies the management of these components.
37+
Plugify seamlessly integrates with the **Mamba package manager**, a tool that automates the process of installing, upgrading, configuring, and removing packages (plugins and language modules) in a consistent manner. Each plugin and language module is considered a package, and the package manager simplifies the management of these components.
3838

3939
### **Using the Package Manager**
4040
To update plugins and language modules automatically, follow these steps:
@@ -67,9 +67,6 @@ To update plugins and language modules automatically, follow these steps:
6767
Restart your server to ensure that all updates are applied correctly.
6868
::
6969

70-
## **Important Note**
71-
The **package manager cannot update itself or the core Plugify library** at this time. To update Plugify, you must follow the **manual update process** described above.
72-
7370
## **Troubleshooting**
7471

7572
### **Common Issues**

0 commit comments

Comments
 (0)