Refacola Project Wizard

The project wizard can be used to automatically projects with refacola definitions, and workflows for generating source code as well as the generated source code itsself.

Installation

The project wizard does not have any dependencies to Refacola, neither to the language definition nor to the Refacola API. Thus it can be installed independently, e.g. in your main development Eclipse instance. The easiest way to separately install the project wizard is by copying the plugin jar file (de.feu.ps.refacola.ui.project_0.1.0.jar) to the dropins folder of your Eclipse installation.

Invocing the Project Wizard

The project wizard is incoved by creating a new project File / New / Project... and selecting the "Refacola Wizard", as shown in Figure 1

Fig. 1: Select Refacola Wizard
Select a name for the project, the last segment of the name is used as the default language name, ash sown in Figure 2. E.g., in "de.feu.ps.refacola.eiffel", the language name would be "eiffel".

Fig. 2: Enter project name

Project Structure and Workflow

The project structure generated by the wizard is shown in Figure 3.

Fig. 3: Project structure
The generated workflow GenerateJavaAPI.mwe2 can be then used to generate the java sources from your refacola definition. In order to be able to successfully run the workflow, the project de.feu.ps.refacola.generator must be in the classpath available to the workflow. This can be achieved by two ways, depending on your currrent task and settings:
Template or API Developer
In that case, you probably have imported all Refacola projects from the SVN into your workspace, that is de.feu.ps.refacola.generator will be an opened project in your workspace. The workflow engine has access to all opened projects, thus the generator will be found and your latest templates and API (which is probably also open in your workspace) will be used.
Refacola Definition or Adapter Developer
If you are developing new language and rule set definitions, or if you are writing an adapter for a new language, you either have installed all the refacola plugins in your installation anyway (that is, the generator plugin is installed as well) or you have opened all the projects in your primary Eclipse instance and maybe use a runtime instance for taking advantage of the Refacola editor. In both cases, the generator plugin is available, either as installed plugin, or plugin installed in the runtime instance as all opened projects in the primary instance are usually available in the runtime instance.
If the workflow has run successfully, the Java source should have been generated in the src-gen folder of the project. Additionally, the generated packages have been added to the Exported-Packages section of the MANIFEST.MF file, as shown in Figure 4.

Fig. 4: Generated sources and exported packages
Of course, you can adjust the workflow and everything to your needs. The wizard only helps you to start you project.