MagicDraw 18.3 Documentation
The preconfigured IntelliJ IDEA project with modules for two sample plugins and a batch mode (command-line) tool is provided with a program installation directory. The project can be found in <modeling tool installation directory>\openapi\ide\intellij.zip.
Let's use MagicDraw as an example to describe the following procedures.
To setup the IntelliJ IDEA environment for the MagicDraw (or other program according to a modeling tool you are using) development
- In IntelliJ IDEA, add a path variable named MAGIC_DRAW_INSTALL_DIRECTORY and pointing to the MagicDraw installation directory.
2. Extract <MagicDraw installation directory>\openapi\ide\intellij.zip to a chosen folder.
3. Open the extracted IntelliJ IDEA project MagicDraw development.ipr from that folder.
The launch configuration is designed to load plugins from the program installation directory (see step #1) and two plugins from the IDEA project. Thus, if the md.plugins.dir java system property is not defined (see Plugins directories), developing plugins are not loaded.
After projects are imported and the launch configurations are prepared, the IDEA project are ready for the source code development and running/debugging.
Even if the plugin descriptor file contains information about a runtime plugin .jar file, it is not necessary to build and deploy this .jar file to a plugin directory while a plugin is developed under IntelliJ IDEA.
A custom test launching mechanism is used to launch MagicDraw tests, because of an Eclipse OSGi environment (which is not officially supported by the recent version of IntelliJ IDEA).
The test launcher classes are defined at the end of VM options (without prefix -D) and the classpath to those classes is additionally defined as CLASSPATH variable in Environment variables section of the run configuration. These settings should be used for any test configuration for MagicDraw on IntelliJ IDEA by default (see the picture below and the provided sample configuration).
An IntelliJ IDEA module that is used for classpath in the test configuration should include all contents of the <modeling tool installation directory>\lib directory recursively as it's dependencies.
The test launching mechanism is designed to use IntelliJ IDEA classpath file (autmatically generated) to support long classpaths. It is mandatory to setup Intellij IDEA to create that classpath file for provided test launchers. That can be done by adding or modifying a property dynamic.classpath to be true in IntelliJ IDEA workspace properties file <project_name>.iws (it usually resides beside project file <project_name>.ipr) or .idea/workspace.xml (if the directory based project structure is used).