Introduction
Xbase++ comes with so-called assets. You can consider an asset as a reference implementation. The idea of assets is to formalize the packaging of libraries, frameworks, etc. beyond the Xbase++ core product featureset. In practice, assets are there to clean up the project chaos and provide a unified model for add-on library/framework/code usage/binding.The user of an asset is not allowed to change the asset or its underlying code. To do so, the original asset must be edited and repackaged.
The Xbase++ Workbench offers the possibility to add an asset to a project. Physically, assets are stored in the subdirectory ".assets" and will then become part of the project. This includes the asset meta files and the corresponding asset files. This also means the .assets directory and files must be treated just like any other directory or source file of the project. For example, they must be checked into a source repository.
Asset types
Assets manifest themselves in different types and are integrated into the project in different ways depending on their complexity and requirements.Files only
An asset can only contain files. The asset "Modern flat UI alias metro" is an example of this. After installation, the sources of the asset are located in the .assets\metro-ui directory and can be referenced from a CXP page via this path, for example.Simple
Assets can also consist of source code files. These source code files are also stored in the .assets directory. However, they are also entered in the project file so that their object files are linked to the EXE or DLL target. As a result, all classes and functions of the asset are available to the target. The Impersonate asset is a representative of this category.Komplex
A similar procedure is used for assets that are implemented as a DLL. Here a reference to the DLL target is added to the project file and the EXE/DLL target to which the asset was added receives a dependency to the DLL asset. The DLL asset is linked to the target and so all exported classes and functions are available for the target. An example of this is the "OAuth2 client" asset.Installation
Assets are target specific and are added to an existing target accordingly. This is done via the Asset Manager which is opened with a right-click on the target within the Project Manager of the Workbench.The Asset Manager opens and the desired asset can be selected.
Deinstallation
The same interaction can be used to uninstall the asset. Open the Asset Manager and remove the asset.Samples
Each asset is accompanied by a readme that is opened and displayed by the Workbench as soon the asset is installed. This readme may contain examples of asset usage. These examples can be added to the project.Usually, an executable target is created to which the asset has been added. The source code files may still need to be adapted. Corresponding places in the source code are marked with a "TODO" comment.