# Plugin Development Development

Plugins are an extension method opened by the platform itself. Through plugins, new functionalities can be added to the platform, or existing functionalities can be modified.

You can refer to the following video to understand how to develop a simple plugin and how to use it:

# Plugin Usage

Plugins are files ending with .myp, which can be uploaded and enabled through the platform's plugin management interface.

# Plugin Runtime Description

  • The same set of plugins can have different versions in the platform, and only one version of a plugin can be enabled at the same time.
  • Enabling and disabling plugins take effect in real-time, without the need to restart the platform.
  • All enabled plugins in the platform share the same runtime environment, and plugins can directly call each other. At the same time, the platform also provides some APIs for plugins to call platform functions.

# Plugin Development

# Target Audience

This document is mainly intended for advanced developers who wish to understand how to develop plugins for the Muyan development platform.

# Prerequisites

Readers need to have some understanding of gradle. Here are some related reference materials:

# Creating a Plugin

  1. Create a new plugin based on the platform-plugin-template (opens new window) plugin template.
  2. Modify the plugin's build.gradle configuration file, replace the plugin's name, version, dependencies on other plugins, and other information.
    def muyanPluginName = "DemoPlugin"
    def muyanPluginVersion = project.version
    def description = "Demo Plugin"
    def dependsOnPlugins = [
       "PlatformAdapter": "0.0.1",
    ]
    
    1
    2
    3
    4
    5
    6
  3. Add your third-party dependencies through build.gradle and start writing your business logic.

# Plugin Packaging

After development is complete, execute the gradle packageMuyanPlugin task to package the plugin. All third-party dependency packages in this project will be included in the plugin. Note that third-party dependencies marked as compileOnly will not be included during packaging.

Last Updated: 9/13/2024, 3:41:28 PM