configurationengine/doc/plugins/dev-plugin/steps.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
.. _plugin-howto-steps:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
Step-by-step instructions for creating a new plug-in based on the example
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
=========================================================================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
This page provides step-by-step instructions for creating a new plug-in based on the example
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
plug-in described in :ref:`plugin-howto-example-plugin`. The new plug-in will simply be exactly the same as the example plug-in, except that
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
the name will be changed from ExampleML to NewML.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
These steps show how to create a new plug-in under the ``example`` plug-in package, but the instructions
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
can be used for creating an entirely new plug-in package also. To do that, simply export
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
``source/plugins/example`` into ``source/plugins/new`` instead of just ``source/plugins/example/ConeExamplePlugin``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
into ``source/plugins/example/ConeNewPlugin``.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
#. Export the example plug-in into the new plug-in path. With TortoiseSVN it can be done like this:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
    #. Open ``source/plugins/example`` in Windows Explorer
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
    #. Drag'n'drop ``ConeExamplePlugin`` into the empty area using the right mouse button
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
    #. Select "SVN export to here" from the pop-up menu
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
    #. Select "Auto rename" from the dialog that pops up
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
    #. After the export is done, rename "Export of ConeExamplePlugin" to "ConeNewPlugin"
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
#. Refresh the ``plugins/`` directory in Eclipse
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
#. Rename all files and folders containing "exampleml" to "newml" under ``ConeNewPlugin/``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
    - ``examplemlplugin/`` -> ``newmlplugin/``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
    - ``exampleml_impl.py`` -> ``newml_impl.py``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
    - ``tests/unittest_exampleml_generation.py`` -> ``tests/unittest_newml_generation.py``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
    - ``tests/project/Layer/implml/test.exampleml`` -> ``tests/project/Layer/implml/test.newml``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
    - etc.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
#. Change "exampleml" to "newml" inside all files
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
    - Select "ConeNewPlugin" in the PyDev Package Explorer
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
    - Press Ctrl+H to do a file search. Use the following options:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
         - Containing text: exampleml (case-insensitive)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
         - File name patterns: *
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
         - Scope: Selected resources
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
    - Change the string everywhere (use the same case convention, e.g. "exampleml_impl" -> "newml_impl" and "ExamplemlReader" -> "NewmlReader")
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
#. Check that test cases are run correctly and they pass
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
    #. Run ``source/plugins/example/ConeNewPlugin/newmlplugin/tests/runtests.py`` to check that all tests pass (all modules are found etc.)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
    #. Run ``source/plugins/example/runtests.py`` to check that all tests pass also from the plug-in package level
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
#. Modify ``setup.py``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
#. Check that the new plug-in is present in a ConE installation created using the ``example`` plug-in package
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
    #. Go to the working directory on the command line and run (remember to use forward slashes)::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
     
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
        install.cmd C:/cone_temp_or_whatever_dir example
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
    #. Go to the temporary directory specified in the previous step and run::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
        cone info --print-supported-impls
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
    #. Check that you can find the new namespace and file extension in the list of supported namespaces and file extensions