Child pages
  • External system integration
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Purpose

This page provides high-level overview of External System sub-system.

Table of contents

Rationale

There are multiple project management systems (maven, gradle, sbt etc) and it's good to support them at the ide. Luckily, they all provide a similar set of facilities from the integration point of view:

  • build ide project from external system config (pom.xml, build.gradle etc);
  • provide a list of available tasks;
  • allow to execute particular task;
  • ...
    That means that we can separate external system-specific logic and general ide processing. 'External system' sub-system provides simple api for wrapping external system and extensible ide-specific processing logic.

Project management

Project data domain

General
External system wrapper is required to be able to build project info on the basis of the given external system config. That information is built using in terms of DataNode, Key and ProjectEntityData.

Here DataNode class is just a holder for the target data (data type is defined by the Key). Multiple DataNode objects might be organized in directed graph where every edge identifies parent-child relation.

For example, simple one-module project might look as below:

Consequence
The ide provides a set of built-in Key_s and _ProjectEntityData_s but any external system integration or third-party plugin developer might enhance project data by defining her own _Key and ProjectEntityData and storing them at a child of appropriate DataNode.

Managing project data

We need to process project data is built on external system config basis. Here comes ProjectDataService. It is a strategy which knows how to manage particular ProjectEntityData. For example, when we want to import a project from external model, we can start by the top level DataNode which references project info and then import its data using corresponding service.

Custom services can be defined via 'externalProjectDataService' extension.

The good thing is that we can separate project parsing and management here. That means that a set of DataNode, Key and ProjectDataServices can be introduced for particular technology and then every external system integration can build corresponding data if necessary using it.

Importing from external model

IntelliJ platform provides standard api for that. Namely, ProjectImportBuilder and ProjectImportProvider. There are two classes built on template method pattern - AbstractExternalProjectImportBuilder and AbstractExternalProjectImportProvider. They might be sub-classes and that concrete implementations should be registered at IoC descriptor (plugin.xml).

Here is an example from the gradle integration plugin:

Note that AbstractExternalProjectImportBuilder is built on top of the 'external system settings' controls.

Settings

Using with 12.1.x IJ branch

Though main development is performed at the 'master' branch, there is a special 12.1.x-compatible version. Here are instructions on how to use it:

  1. Download external-system.zip;
  2. Unpack it and define external-system.jar as a library dependency;
  3. Configure sources from external-system-src.jar if necessary;
  4. Add definitions from ExternalSystemExtensionPoints.xml and ExternalSystemExtensions.xml to your plugin.xml (that .xml files are bundled into external-system-src.jar). *Note: it's very important to use custom namespace there because there is a possible case that more than one external system integration uses this approach to be compatible with 12.1.x;
  • No labels