configurationengine/doc/plugins/plugin-dir-structure.rst
author terytkon
Thu, 11 Mar 2010 17:04:37 +0200
changeset 0 2e8eeb919028
permissions -rw-r--r--
Adding EPL version of configurationengine.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     1
Plug-in directory structure
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
===========================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
ConE plug-ins are divided into plug-in "packages", which enables a ConE
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
distribution to be built with a specific set of installed plug-ins. There is a ``common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
package that contains the default plug-ins that are always present in a ConE installation,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
and any other plug-in package provides extra plug-ins in addition to these.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
For example, one might build a 'vanilla' ConE distribution which contains only the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
core ConE components and common plug-ins, or a 'symbian' distribution which contains
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
those as well as all Symbian-specific plug-ins.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
The plug-in packages are simply sub-directories of ``source/plugins``. For example, the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
following shows the current plug-in packages:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
  .. image:: plugins-dir.png
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
As can be seen, there are three plug-in packages (``common``, ``example`` and ``symbian``)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
and several utility Python files.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
Package directory structure
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
---------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
Each plug-in package contains the sources of all plug-ins, an optional integration test set,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
and a Python script to run all test cases related to the plug-in package. For example, the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
following shows the contents of the ``common`` plug-in package:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
  .. image:: plugins-common-dir.png
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
The naming of the sub-directories is important:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
- Directories with a name of the form ``Cone*Plugin`` are considered to be plug-in sources
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
- If a directory with the name ``integration-test`` exists, it is expected to contain a
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
  ``runtests.py`` file that runs the integration tests
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
Plug-in source directory structure
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
----------------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
A plug-in source directory is expected to contain two things:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
- A single Python module that contains the plug-in sources
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
- ``setup.py`` for packaging the plug-in into an egg (``setup.cfg`` and ``makefile`` are related to this)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
The following shows the contents of the command plug-in directory in the common package:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
  .. image:: plugins-common-commandplugin-dir.png
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
For an example with more complete descriptions see
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    49
:ref:`here <plugin-howto-example-plugin-dir-structure>`.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    50
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    51
Integration test directory structure
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    52
------------------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    53
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    54
In addition to a collection of plug-in sources a plug-in package directory may contain an
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    55
``integration-test`` directory. This directory is supposed to contain integration tests
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    56
for the plug-ins by running actions (e.g. generate) using the ConE CLI to test that the plug-ins
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    57
work correctly from the topmost level.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    58
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    59
File naming matters here too:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    60
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    61
- Files of the form ``unittest_*.py`` are expected to contain the test cases
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    62
- If a file named ``export_standalone.py`` exists, it is expected to contain a function that
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    63
  exports any needed extra data when exporting the integration tests into a standalone test set.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    64
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    65
For an example with more complete descriptions see
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    66
:ref:`here <plugin-howto-example-plugin-integration-tests`.