You can invoke the building APIs in your build process. You need to import btttbpers.jar from<toolkit_root>\plugins\tooling\com.ibm.btt.tools.perspective.0directory.
Following is an example for building whole project:
ProjectGenerator pg = CodeGeneratorFactory.getProjectGenerator(CodeGeneratorFactory.CHANNEL_DOJO); pg.setProgressMonitor(monitor); //Optional, do not use in batch build mode. // The monitor parameter is an Eclipse IProgressMonitor. GenerationResult[] results = pg.generateProject(prj); // "prj" is the Eclipse IProject to build reportResult(results); // User-provided method to report build results
Besides the project-level building, BTT provides Java interfaces to implement the flexible building requirement.
Following is the package/class list and relationship
Package com.ibm.btt.tools.build | Defines the public API and interfaces of the functionality |
---|---|
AbstractGenerator | Base implementation of CodeGenerator interface, providing common code, reused by all other concrete implementations |
CodeGenerator | Public interface, implemented by configured code generators, to be implemented by alpha developers intending to provide their own build generators |
CodeGeneratorFactory | Provides an API to retrieve configured project and code generators from the plugin extensions, for a given channel and model file type |
GenerationResult | Encapsulates all information about the result of the runtime generation for a given model file. |
GeneratorException | Exception thrown if problems are found during generation. |
GeneratorPriority | Simple enumeration type to provide the 3 priority levels. Recommendation is to refractor all BTT configuration priorities into a single place. |
ProjectGenerator | Public interface, implemented by configured Dojo channel generator, to be implemented by alpha developers intending to provide their own channel generators. |
TransactionGenerator | Implements the CodeGenerator interface to generate XML from *.transaction model files. |
UIMessages | NLS helper class. |
Package com.ibm.btt.tools.build.dojo | Provides dojo-related generator code |
---|---|
DojoProjectGenerator | Implements the ProjectGenerator interface for the Dojo channel. |
NlsGenerator | Implements the CodeGenerator interface to generate *.js from *.properties files in the configured NLS folder. |
XuiGenerator | Implements the CodeGenerator interface to generate *.js and *.jsp from *.xui files in the configured XUI folder. |