Skip to main content
Jump to: navigation, search

Difference between revisions of "Tigerstripe Headless Generation Tutorial"

(Obtaining available Tigerstripe Generators)
(Obtaining available Tigerstripe Generators)
Line 31: Line 31:
Alternatively, it can be downloaded as a .zip file: [[|]]
Alternatively, it can be downloaded as a .zip file: [[|]]
If downloading the generator from the .zip file, please follow the instruction in the [[Importing_an_Example_Model | Importing an Example Model Section]]
=Running a generation from the command line=
=Running a generation from the command line=

Revision as of 14:34, 13 June 2008

< To: Tigerstripe_Tutorials


This tutorial will show you how to configure Tigerstripe to run code generations in a headless environment. This will allow you to incorporate Tigerstripe's code generation functionality into a build chain using many of the commonly available build tools, specifically Maven 2.

Tigerstripe Installation

See the Tigerstripe Installation Tutorial page for instructions on installing the Tigerstripe Workbench.

Importing an Example Model

  1. Download the sample Tigerstripe model project
  2. Start Eclipse and then open the Tigerstripe Workbench perspective.
  3. Import the sample project, into the Tigerstripe Workbench.
    • Right click in the Tigerstripe Explorer pane and select "Import"
    • Select General -> Existing Projects into Workspace. Click "Next >"
    • Click "Select Archive File" and browse to the location of the sample model project .zip file. Click "Finish"
  4. Verify that the project is in your Tigerstripe Explorer pane.

Installing Tigerstripe generators


Tigerstripe Generators are pluggable components that allow users to define rules and conventions for code that is generated from a Tigerstripe Model Project. Several generators are currently available, and in many cases, you may want to write your own. For more information on writing you own Tigerstripe Generators see Tigerstripe Tutorials, Code Generation.

Obtaining available Tigerstripe Generators

The generator used in this tutorial is in the Tigerstripe CVS repository at:

Alternatively, it can be downloaded as a .zip file:

If downloading the generator from the .zip file, please follow the instruction in the Importing an Example Model Section

Running a generation from the command line


Now that the Tigerstripe workbench is set up and the Tigerstripe generators have been installed and tested you can invoke a generation run from the command line. The Eclipse mechanism for running in a headless environment will be used to accomplish this.

The following command/syntax invokes a headless generation:

eclipsec -nosplash -data <workspace> -application org.eclipse.tigerstripe.workbench.headless.tigerstripe <referenced projects> <generation project>

  • <workspace> - The path of the workspace that contains the required projects
  • <generation project> - The project that will be generated. Defined by the key/value pair: GENERATION_PROJECT=<PROJECT_PATH>
  • <referenced projects> - The referenced projects required for generation. Defined by the key/value pair: PROJECT_IMPORT=<PROJECT_PATH>

Run a headless model generation using the Tigerstripe Workbench

@echo off

REM Set below to match your current configuration
set ECLIPSE_HOME=C:\eclipse
set WORKSPACE=C:\workspace
set HEADLESS_PLUGIN=org.eclipse.tigerstripe.workbench.headless.tigerstripe

REM Use below to define referenced projects

%ECLIPSE_HOME%\eclipsec -nosplash -data %WORKSPACE% -application %HEADLESS_PLUGIN% %PROJECT%
  1. Download (above) and unzip the .bat file in a handy location
  2. Verify that the .bat file parameters are set correctly for your system
  3. Execute the batch file to initiate model generation (Note: output may vary based on version)
  4. Verify generation by navigating to <workspace>OrderManagement\target\tigerstripe.gen\xml. Verify that OrderManagement.xml is a xml based representation of the example model

Running a generation from a Maven2 build

Back to the top