Modifying Artifact Generation

From Skyway Wiki

Jump to: navigation, search

Skyway artifact generation is very extensible.

The center of the generation process is the artifact itself. An artifact is any file that you want created for a specific type of modeling object. You define artifacts through an extension point. These artifact definitions are grouped in sets. An artifact set has an id and many different plug-ins can contribute to the same artifact set. In addition to artifact definitions, an artifact set can contain overrides.

A Skyway deployment facet is an Eclipse facet that is linked to one or more artifact sets. You can apply a Skyway deployment facet to a Skyway modeling project. A Skyway modeling project is an Eclipse project with the org.skyway.core.modeling.facet facet applied to it. A deployment facet installs a special Eclipse builder that knows how to inspect your models and generate artifacts from them. This builder uses the artifact sets associated with the deployment facet to know which artifacts to generate.

Only one deployment facet should be applied to a modeling project at one time. You can, of course, remove one deployment facet from a project and add another. You can swap out deployment facets whenever you want. When you change the deployment facet applied to a modeling project, it will trigger a clean build of that project. The clean build will remove all of the generated artifacts from the previous facet and generate new artifacts from the current facet.

The artifact generation process is very extensible. You can override any aspect of it; often, without writing any new classes. Here are just a few options:

  1. You can add or override artifact definitions in an existing artifact set.
  2. You can remove an artifact by overriding the artifact definition and using IArtifactDefinition#isInterestedIn(IArtifactBuilderItem item) to effectively turn the artifact off.
  3. You can create a new deployment facet and new artifact sets.
  4. You can extend an existing deployment facet by adding its artifact sets to a new deployment facet.
  5. You can overhaul the entire generation process by extending any class involved in the artifact generation process.

By default, Skyway uses JET to generate its artifacts. These wiki pages assume you also use JET. But the architecture is not coupled to JET. You can use a different templating technology (Velocity, etc).

Any customizations you build must be done through plug-ins. These can be very simple plug-ins (w/ little to no code), but you should be familiar with building and installing plug-ins. Once you build a plug-in with your customizations, you must install that plug-in for it to affect the artifact generation process. The Setup link below guides you through the creation of a basic JET-enabled plug-in project and is a prerequisite for the links that follow.

Setup

Adding an artifact

Replacing a template (or artifact)

Adding a new facet

How To Guide

How To Add Artifact Guide

Personal tools