String content;
try
{
VelocityContext context = new VelocityContext();
context.put( "includeTestSummary", includeTestSummary );
context.put( "includeOutput", includeBuildOutput );
if ( includeBuildOutput )
{
context.put( "buildOutput", getBuildOutput( project, build ) );
}
if ( includeBuildSummary )
{
context.put( "build", build );
ReportTestResult reportTestResult =
reportTestSuiteGenerator.generateReportTestResult( build.getId(), project.getId() );
context.put( "testResult", reportTestResult );
context.put( "project", project );
context.put( "changesSinceLastSuccess",
continuum.getChangesSinceLastSuccess( project.getId(), build.getId() ) );
context.put( "previousBuild", previousBuild );
// ----------------------------------------------------------------------
// Tools
// ----------------------------------------------------------------------
context.put( "formatter", formatterTool );
// TODO: Make the build host a part of the build
context.put( "buildHost", buildHost );
String osName = System.getProperty( "os.name" );
String osPatchLevel = System.getProperty( "sun.os.patch.level" );
if ( osPatchLevel != null )
{
osName = osName + "(" + osPatchLevel + ")";
}
context.put( "osName", osName );
context.put( "javaVersion",
System.getProperty( "java.version" ) + "(" + System.getProperty( "java.vendor" ) + ")" );
// TODO only in case of a java project ?
context.put( "javaHomeInformations", getJavaHomeInformations( buildDefinition ) );
context.put( "builderVersions", getBuilderVersion( buildDefinition, project ) );
}
// ----------------------------------------------------------------------
// Data objects
// ----------------------------------------------------------------------
context.put( "reportUrl", getReportUrl( project, build, configurationService ) );
// TODO put other profile env var could be a security if they provide passwords ?
// ----------------------------------------------------------------------
// Generate