Modeling Builders
From Skyway Wiki
Introduction
When you install the Skyway Modeling facet on a project, the Skyway nature is applied to that project and the Skyway modeling builder is installed.
The modeling builder is an Eclipse incremental project builder. By default, it provides two services: indexing and validation. Indexing allows us to quickly search modeling metadata. Skyway uses Lucene (wrapped in Compass) to do its indexing.
When you save a Skyway modeling object like a DataType, the object is marshaled into XML using EMF and persisted in the Eclipse file system. This triggers the builder to run, which indexes and validates the object.
Since Skyway modeling artifacts are just XML documents on disk, you can access them outside of Skyway. While not recommended, you can even change these documents outside of Skyway. If you did make a simple change to the XML document, you should always refresh your workspace so Eclipse detects the change. That triggers the builder, which will re-index the document and re-validate your changes.
Adding your own
The modeling builder is extensible. If you wanted to perform some work on the Skyway modeling objects every time they were saved, you could use the org.skyway.core.builderContributor extension point. In fact, indexing and validation are actually contributions to this extension point defined in the org.skyway.core plugin.
To contribute to this extension point, you only need to specify the name of a class that implements the ISkywayBuilderContributor interface. This interface defines 5 methods:
public void prepareBuild(SkywayBuildContext context);
This is invoked once per project per build before the first buildImpl invocation. This is where you would do any type of setup or preparation work that must be done. For the indexing builder, this is where we open a Compass session with Lucene.
public boolean buildImpl(SkywayBuildContext context, SkywayBuildItem item) throws CoreException;
This is invoked for each resource that has changed in your project; during a clean build, this would be every resource in your project. And this includes non-Skyway resources. If you’re only interested in Skyway modeling objects, you can check isModelResource() on the SkywayBuildItem, which only returns true for Skyway modeling documents.
public void cleanupBuild(SkywayBuildContext context);
This is invoked once per project per build after the last buildImpl invocation. This is where you would do any cleanup activity. For example, the indexing builder closes the Compass session here.
public int getType();
This defines the builder type. You should return one of 3 constant values: ISkywayBuilderContributor.INDEXING; ISkywayBuilderContributor.VALIDATION; ISkywayBuilderContributor.OTHER;
public int getOrder();
This controls the order in which the builder contributors run. The indexing builder returns 25 and the validation builder returns 50. So if you wanted your contributor to run after indexing but before validation, you could return 35.

