.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : CIX_JCIE_ExternalLibraries.rst * Created by : Marnix Bochove (original text) * Last update : 18-03-2021 * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /metadata_include.txt .. include:: /inline-images.txt External libraries ================== Writing code instructions is all about abstraction: no specifics should be included to make that one piece of code instructions is suitable for multiple entities. Since you’ve decided to go down this road anyway, then why not take it one step further by reusing your code instructions between projects? You can create an external library of code instructions and use that for multiple projects. Consequently refactoring and introducing new functionality in all projects only requires a single change in code instructions. After that, just generate all project files again and you’ll be fully up to date. .. rubric:: Configure an external library An external library should always have a unique name by which attributes can be determined. The element **external_libraries** is a collection of one or more **external_library** elements. Here is an example of using 2 external libraries: .. code-block:: xml :caption: example :name: external libraries-01 :linenos: :emphasize-lines: 4-9, 13-15 ... name="lib1" ... We recommend to use a version control system to contain only the library and nothing else, so that you can safely use it with multiple projects. .. rubric:: Attributes .. list-table:: **attributes of ** :widths: 20 80 :header-rows: 1 :class: tight-table * - Name - Details * - name - Name of the library: required .. rubric:: Sub elements .. list-table:: **sub elements of ** :widths: 15 70 15 :header-rows: 1 :class: tight-table * - Name - Details - Number * - path - The path tag contains the absolute path to a folder. - 1 * - code_instruction_folder - The code_instruction_folder tag contains the relative path to the code instructions - 0 or 1 * - snippets_folder - The snippetsFolder tag contains the relative path to the snippets - 0 or 1 * - features_folder - |Question S| - 0 or 1 * - function_library - |Question S| - 0 or more