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