diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-09-12 16:34:47 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-14 14:36:32 -0400 |
commit | 1d230372d911cf5ec2b88214c7ba378761069d2d (patch) | |
tree | f3209436315ae2bcc7e7f8c47aa83c109242d151 /buildstream | |
parent | 5438fe308a1843e7cddcfbaf1c662d1d52c1b15e (diff) | |
download | buildstream-1d230372d911cf5ec2b88214c7ba378761069d2d.tar.gz |
Add documentation
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/plugin.py | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py index 110d865f5..5be2255e5 100644 --- a/buildstream/plugin.py +++ b/buildstream/plugin.py @@ -19,7 +19,52 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> """ Plugin -====== +======= +BuildStream supports third party plugins to define additional kinds of +elements and sources. + +Plugin Structure +---------------- +A plugin should consist of a `setuptools package +<http://setuptools.readthedocs.io/en/latest/setuptools.html>`_ that +advertises contained plugins using `entry points +<http://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins>`_. + +A plugin entry point must be a module that extends a class in the +:ref:`core_framework` to be discovered by BuildStream. A YAML file +defining plugin default settings with the same name as the module can +also be defined in the same directory as the plugin module. + +.. note:: + + BuildStream does not support function/class entry points. + +A sample plugin could be structured as such: + +.. code-block:: text + + . + ├── elements + │ ├── autotools.py + │ ├── autotools.yaml + │ └── __init__.py + ├── MANIFEST.in + └── setup.py + +The setuptools configuration should then contain at least: + +setup.py: + +.. literalinclude:: ../source/sample_plugin/setup.py + :language: python + +MANIFEST.in: + +.. literalinclude:: ../source/sample_plugin/setup.py + :language: text + +Class Reference +--------------- """ import os @@ -44,6 +89,7 @@ class Plugin(): Some common features to both Sources and Elements are found in this class. + """ BST_REQUIRED_VERSION_MAJOR = 0 |