Build Module

From Olympus
Jump to: navigation, search

The Olympus build module, OlympusBuild.pm, is a perl module with convenience functions that can be used to build an Olympus system. Here's an example use:

#!perl

use strict;

# The following line puts the Olympus Build directory in the use search path.
use lib "$ENV{OLYMPUS_ROOT}/Build";

use OlympusBuild;

# Set up a build object for the project 'MeetingLine'.
my $build = OlympusBuild->new('PROJECT' => 'MeetingLine');

# Compile the System. (A Visual Studio solution file named 'System.sln'.)
$build->buildSystem;

# Build the language model and pronunciation dictionary from the grammar:
#    'Resources/grammar/GRAMMAR/MeetingLineTask.gra'
# Also compiles said grammar.
$build->buildResources;

Properties

The following properties can be specified:

Property Default Description
PROJECT undef The name of the project. In particular, it refers to a part of the name of the grammar file.
OLYMPUS_ROOT The OLYMPUS_ROOT environment variable if set. If PROJECT is not defined then the current directory is used. This is the root directory of all the olympus components.
PROJECT_ROOT The current directory. If PROJECT is not defined then this is also not defined. This is the root directory of an Olympus system.
BUILD_TYPE Build Can be Build or Rebuild. Build will attempt to build all of the out-of-date components. Rebuild will rebuild everything, even if it things that a component is up-to-date. Rebuild is recommended in cases where the OLYMPUS_ROOT has changed.
BUILD_CONF Release This is a build configuration, which is typically either Release or Debug, but can be set to any configuration present in your solution file.

Methods

The following methods can be called. The first method is specifically used to build the Olympus framework and its components. This next x methods can be used to build Olympus systems. The remaining methods are generally used internally, but can be accessed if needed.

Method Parameters Description
buildOlympus none Specifically to build the Olympus framework and its components.
buildSystem none Builds an Olympus system. In particular it builds a Visual Studio solution file named Solution.sln
buildResources none Takes a grammar file, in particular PROJECT_ROOT/Resources/grammar/GRAMMAR/PROJECTTask.gra, compiles it, and also builds a pronunciation dictionary and language model for it. See MakeLM for more details.
buildSAPI none Builds the SAPI dll required by KalliopeSAPI
buildAgents none Build a Visual Studio solution file. If PROJECT is not defined it builds the Olympus framework, otherwise, it builds PROJECT_ROOT\System.sln
buildAnt the ant build file Run and Apache ANT build file.
buildVSSolution the solution file and optional build paramaters for BUILD_TYPE and BUILD_CONF Builds a Microsoft Visual Studio solution file. The optional parameters may override parameters set in the new call.
findSolution none Returns the name of the solution file that will be built.
getMSDev none Returns the full path of the Microsoft Visual Studio 8.0 or 9.0 vcbuild.exe, if it exists and is the lowest installed version of Visual Studio. Prints a warning and returns nothing if it can't be found.
getAnt none Return the full path of the Apache ANT script. Prints a warning and returns nothing if it can't be found.
pLog Text to print Prints the text passed in on screen and in build.log.
Personal tools