Plugin.info Guide

DMDirc logo

This page was written for DMDirc version 0.5.5.

The contents may not be applicable to earlier or later versions.

Introduction

The plugin system as of DMDirc 0.5 requires that plugins be in jar files (ending in .jar).

Inside this jar there should be the .class files of the plugin as needed, aswell as a file called plugin.info inside the META-INF folder of the jar.

Details

plugin.info is a Properties file containing meta-information about the plugin.

The following MetaInformation is required:

  1. version - The version (int) of the plugin (eg “5” - used for update manager)
  2. author - The Author of the plugin (eg “Shane shane@dmdirc.com”)
  3. name - The name of the plugin (eg “windowstatus”)
  4. minversion - The minimum version of dmdirc required to use the plugin (See Plugin Requirements below for more information)
  5. mainclass - The main class of the plugin (eg “com.dmdirc.addons.windowstatus.WindowStatusPlugin”)

The following optional MetaInformation is catered for with helper methods:

  1. nicename - The name to display in the UI (eg “WindowStatus Plugin”)
  2. friendlyversion - The version to display in the UI (eg “0.5”)
  3. description - The description to show in the UI (eg “Displays information related to the current window in the status bar.”)
  4. maxversion - The maximum version of dmdirc that this plugin will run on (See Plugin Requirements below for more information)
  5. addonid - If the plugin is on the addons site and this is specified, the DMDirc updater can also update the plugin.

Additional MetaInfo is permitted, and can be obtained using pluginInfo.getMiscMetaInfo(“foo”); (assuming pluginInfo is the PluginInfo object for the plugin)

Plugin Requirements

plugin.info can also be used to specify requirements for the plugin. These requirements are checked when the plugin is loaded, and if they fail the plugin will not be loaded.

Requirements are checked as follows:

  1. The plugin “minversion” is checked.
    • This should be an integer (The plugin will not load otherwise) that represents the earliest svn revision that the plugin works (or is known to work).
    • A “0” for minversion will result in this check being passed
  2. The plugin “maxversion” is checked if specified.
    • This check is the same as minversion, only it checks that the current verison is below, or equal to the given version.
    • A “0” for maxversion will result in this check being passed
  3. The “required-os” parameter is checked.
    • If “required-os” is not found, “require-os” will be looked for instead.
    • This parameter specifies a regular expression to check the os.name (os.version and os.arch can also optionally be checked)
      • All values are lowercased before being checked (ie look for “linux” not “Linux”)
      • Synax: <regex for os.name>[:<regex for os.version>[:<regex for os.arch>]]
        • “required-os=.*linux.*” - look for “linux” in the OS name
        • “required-os=.*linux.*:.*2\.6\.*” - look for “linux” in the OS name, and an os.version of “2.6.<anything>”
        • “required-os=.*linux.*:.*2\.6\.*:.*x86_64.*” - look for “linux” in the OS name, and an os.version of “2.6.<anything>”, and an x86_64 arch
        • “required-os=.*linux.*:.*:.*x86_64.*” - look for “linux” in the OS name, any os.version, and an x86_64 arch
  4. The “required-files” parameter is checked
    • If “required-files” is not found, “require-files” will be looked for, is this is not found “required-file” is looked for, and finally “require-file”
    • Files are separated by commas (,). Options are specified by pipes (|)
      • “required-files=/usr/bin/dcop,/usr/bin/bash” - Require /usr/bin/dcop AND /usr/bin/bash
      • “required-files=/usr/bin/dcop,/usr/bin/bash|/bin/bash” - Require /usr/bin/dcop AND either /usr/bin/bash or /bin/bash
  5. The “required-ui” parameter is checked
    • The UI requested UI is compared as a regular expression to the package name of the current UIController.
  6. The “required-plugins” parameter is checked
    • If “required-plugins” is not found, “require-plugins” will be looked for, is this is not found “required-plugin” is looked for, and finally “require-plugin”
    • Plugins are separated by commas (,)
    • Synax: <plugin name>[:<minimum plugin version>[:<maximum plugin version>]]
      • “required-plugins=dcop” - Require dcop plugin
      • “required-plugins=dcop:10” - Require dcop plugin version 10 or greater
      • “required-plugins=dcop:10:18” - Require dcop plugin newwer or equal to version 10, but not older than verison 18
      • “required-plugins=dcop:0:18” - Require dcop plugin not older than verison 18
    • A plugin that is required by another plugin will be loaded automatically if found and not already loaded.

If all the checks pass, the plugin will be allowed to load.