Home

IntelliJ 12 JetBrains Project System

This memo shows what happens within the new IntelliJ 12 JPS build system if a user triggers the "Make Project" action in the IntelliJ IDE. This post is based on IntelliJ 12.1.1 (IC-129.239).

The entry point into IntelliJs new build system is the class BuildMain. In here you can find an inner class called MyMessageHandler that receives controller messages. Depending on the type of a controller message different actions take place. There are four different controller message types.

  • BUILD_PARAMETERS
  • FS_EVENT
  • CONSTANT_SEARCH_RESULT
  • CANCEL_BUILD_COMMAND

In the case that a project build was triggered the first controller message type is BUILD_PARAMETERS. This type causes that a new BuildSession is created and executed. The BuildSession holds information about the build process. One important participant is the BuildRunner. The BuildRunner instantiates and executes an IncProjectBuilder. Now it is getting interesting, because now really something is happening. Before the IncProjectBuilder there was only instantiation and setup work going on. Now builders and tasks get executed in the following order.

  1. TargetBuilder (Build started)
  2. ModuleLevelBuilder (Build started)
  3. Running 'before' tasks
  4. Checking sources (BUILDERS GET EXECUTED!)
  5. Running 'after' tasks
  6. TargetBuilder (Build finished)
  7. ModuleLevelBuilder (Build finished)

Date published:
Date modified: 2013-05-27
Keywords: IntelliJ, JPS