Creating a plugin ***************** .. toctree:: :maxdepth: 4 A plugin is a folder : * that is located in ``CAST_PLUGINS_ROOT_PATH`` whose default value is : * ``\CustomPlugins`` for versions < 8.0.0 * %ALLUSERSPROFILE%/CAST/CAST/Extensions for versions >= 8.0.0 * that may contains python files that declare a class inheriting from :class:`cast.Extension` Those plugins are meant to be self sufficient. They can contain : * metamodel files, * installation scripts, * assessment models fragments, * any thing that will make them a coherent whole. Plugins are identified by the name of their folder. There exist 2 ways of running python code : * running during analysis of a particular analyser * running at the end of analysis on the application Those 2 ways can be used together in the same plugin. Plugin naming convention ======================== The folder name of a plugin is its identity so it should be unique. We follow the same conventions as `Java `_ does. For example, CAST R&D may use such ids:: com.castsoftware.sqlscript com.castsoftware.angularjs Plugin versionning ================== To describe version and plugin add a *plugin.nuspec* file to the plugin folder with following content :: my.company.plugin 1.0.3 Title of your extension This is the description of the extension Version should follow `Semantic Versioning `_ conventions. We use `nuspec `_ convention and file for packaging. Plugin content organisation =========================== Plugin folder will have the following organisation:: my.company.plugin ├───bin │ └───.exe ├───Configuration │ └───Languages │ └─── │ ├───res │ │ └───.ico │ ├───.xml │ ├───.xml │ └───.xml ├───InstallScripts │ ├───CastStorageService │ │ ├───local.sql │ │ └───local.pck │ ├───Common │ ├───Oracle │ └───SqlServer ├───jars │ ├───.jar ├───tests │ ├───__init__.py │ └───.py ├─── │ └───__init__.py ├───plugin.nuspec └───.py Most of those are **optional**. Use them when needed only. * plugin.nuspec contains the `nuspec `_ description of the plugin (version, description, ...) * .py a file with that contains python extension code. * Configuration contains the metamodel if you need a metamodel fragment * InstallScripts contains the pck, xml and sql files needed or servman if you need to add custom quality rules * bin contains the external binaries needed * tests is a python Package that contains automatic tests * a third party python library included direclty in the plugin to be used. You can include any third party library in that way. Metamodel conventions ===================== Metamodel included in plugins should respect the `ID assignment scheme `_.