Child pages
  • External system integration

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose

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

Table of contents

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.

Image Removed

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:
Image Removed

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:

Code Block

<projectImportProvider implementation="org.jetbrains.plugins.gradle.service.settings.GradleProjectImportProvider"/>
<projectImportBuilder implementation="org.jetbrains.plugins.gradle.service.settings.GradleProjectImportBuilder"/>

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:

...

Redirect
locationhttp://www.jetbrains.org/intellij/sdk/docs/reference_guide/frameworks_and_external_apis/external_system_integration.html