A clean version of the app can be downloaded from here
The clean version consists in the JAR file which contains the builder app and the utility shell scripts which facilitate running the builder app. There is one utility shell script for Linux systems and one for Windows systems.
Step 1
Create the directory where you want to place the CodeGen builder runtime. Put the JAR file and the utility scripts into that directory.
Step 2
Create the environment variable named "CODEGEN_PATH" and set it to the directory mentioned at step 1. The following links might help:
- StackOverflow thread about adding environment variables on a Linux system
- Article on editing environment variables in a Windows system
Optionally, add the CODEGEN_PATH to the system or user PATH variable. See this article for Linux users or this article for Windows users.
Step 3
Under the CODEGEN_PATH, create the following subdirectories:
- lib: it will hold the dependency libraries that you will download at step 4
- projects: it will hold the template projects that you will download at step 5
- dictionaries: it will hold the dictionaries that you will download at step 6
Step 4
Download the following dependency libraries and place them into the "lib" subdirectory of the CODEGEN_PATH. The dependencies and dependency versions are listed in the release notes.
For example, version 1.0.0 of the CodeGen builder has the following dependencies:
- commons-configuration-1.10
- commons-exec-1.3
- commons-io-1.3.2
- commons-lang-2.6
- commons-lang3-3.4
- commons-logging-1.1.1
- freemarker-2.3.23
- hamcrest-core-1.3
- junit-4.12
Step 5
Download the required template projects and place them into the "projects" subdirectory of the CODEGEN_PATH. Template projects may be downloaded from here
Step 6
Download the stock dictionaries and place them into the "dictionaries" subdirectory of the CODEGEN_PATH. Dictionaries may be downloaded fro here
Version 1.0.0, of the stock dictionaries should has the following structure:
FILE unique-keys.dictionary
FILE types.dictionary
FILE primitives.dictionary
FILE collections.dictionary
DIRECTORY languages
FILE languages/java-jpa-validation.dictionary
FILE languages/java.dictionary
FILE languages/jsf-validation.dictionary
FILE languages/mssql.dictionary
FILE languages/mysql.dictionary
After setting up the CODEGEN_PATH environment variable and all of the content of the CodeGen runtime directory referenced by the CODEGEN_PATH, calling the shell script or batch file without parameters will cause it to display the syntax, like in the following example:
> export CODEGEN_PATH=/others/work/java/codegen/codegen-1.0.0/
> ./codegen-builder-console.sh
SYNTAX: codegen-builder-console.sh <goal-name : clean|build> <project-name> <model-pathname> <output-path> [<optional-parameters>]
> Example optional parameters: company-name=evilcorp unit-name=blackops app-name=populationcontrol customer-name=government
.
.
goal-name
There are two goals currently available. The "clean" goal clears the "output-path" of any content which may have been generated by previous runs. The "build" goal generates content into the "output-path".
project-name
The project name is dictated by the name of the directory in which the project was installed. These are sub-directories of the "projects" directory within the CODEGEN_PATH.
model-pathname
The path and name of the indented text file containing the minimal model definition.
output-path
The path to the directory in which the content should be generated.
optional-parameters
These are project-specific parameters, which can be found in the release notes of each template project. As shown in the above example, the optional parameters are provided as key-value pairs.
.
.
.
Example builds:
> ./codegen-builder-console.sh build jsf-layered-crud-with-crudrepository models/audit-model.txt output/audit company-name=evilcorp unit-name=blackops app-name=audit customer-name=government standalone=true primefaces-theme=ui-darkness
Goal [build] successfully terminated
> ./codegen-builder-console.sh build mssql-normalization models/audit-model.txt output/audit company-name=evilcorp app-name=audit
Goal [build] successfully terminated