User Tools

Site Tools


05_developer_tutorials:dev-guide:plugins-repository

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
05_developer_tutorials:dev-guide:plugins-repository [2025/02/19 15:51] – removed - external edit (Unknown date) 127.0.0.105_developer_tutorials:dev-guide:plugins-repository [2025/11/03 02:47] (current) Tim
Line 1: Line 1:
 +====== Plugin repositories ======
  
 +The [[01_user_documentation:user-guide:pluginmanager|Plugin Manager]] uses Plugin repositories to gather knowledge on the available plugins.
 +The repositories can be provided in three formats:
 +
 +  - Ordered List ItemAs a JSON file. Which contains the metadata of one or several plugins.The file need to follow the JSON format for plugin data (see bellow).
 +  - Ordered List ItemAs a local directory. The directory is automatically scanned to find any Groimp plugin. They are found from their plugin.xml file. The plugin data is then extracted from that file.
 +  - Ordered List ItemAs a list of repositories (.list). The .list file is a simple list of any of the three repository formats.
 +
 +
 +====== JSON format for plugin data ======
 +
 +The metadata used by the plugin is:
 +
 +id : The unique id of the plugin.
 +name : The name of the plugin. Defined in plugin.properties
 +versions : A list of version.
 +description (optional)
 +helpUrl (optional)
 +vendor (optional)
 +mainClass (optional)
 +
 +A version is composed of:
 +
 +its version : The version number
 +a downloadUrl : The url to download the plugin .jar. It can be a local path.
 +depends : A list of other GroIMP plugin required to run the plugin. The plugins are designed by their id and a version number
 +
 +libs : A list of external libraries required by the plugin. The list must contains the name of the jar used by groimp and an url (or local path) to fetch that jar.
 +
 +Here is an example of a plugin.json file:
 +<code>
 +[
 +    {
 +        "id" : "de.grogra.test",
 +        "name" : "Test",
 +        "description" : "This is a testing plugin",
 +        "helpUrl": "https://gitlab.com/grogra/groimp-plugins/",
 +        "vendor": "de.grogra",
 +        "mainClass": "",
 +        "versions" : {
 +            "1.2.3" : {
 +                "downloadUrl" : "https://gitlab.com/grogra/groimp-plugins/Test/download",
 +                "libs" : {
 +                "xmlbeans.jar" :"https://repo1.maven.org/maven2/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar"
 +                },
 +                "depends" : {
 +                   "de.grogra.ext.x3d":"=2.1.1"
 +                }
 +            }
 +        }
 +    }
 +]
 +</code>
 +===== Plugin version conditions =====
 +
 +
 +==== Equal condition ====
 +
 +The plugin usually depends on other groimp plugins. It can however depends on a specific version of a plugin.
 +That dependency is defined by the = before the version number:
 +<code>
 +"depends" : {
 +    "de.grogra.ext.x3d":"=2.1.1"
 +}
 +</code>
 +==== Higher than condition ====
 +
 +By default the plugin manager uses the "Higher than condition". It means that if a plugin depends on another, as long a a version newer of that plugin is available, the condition is met.