}
public static Map<String, Object> createScmResult( BuildContext buildContext )
{
Map<String, Object> result = new HashMap<String, Object>();
ScmResult scmResult = buildContext.getScmResult();
result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
if ( StringUtils.isEmpty( scmResult.getCommandLine() ) )
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_COMMAND_LINE, "" );
}
else
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_COMMAND_LINE, scmResult.getCommandLine() );
}
if ( StringUtils.isEmpty( scmResult.getCommandOutput() ) )
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_COMMAND_OUTPUT, "" );
}
else
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_COMMAND_OUTPUT, scmResult.getCommandOutput() );
}
if ( StringUtils.isEmpty( scmResult.getProviderMessage() ) )
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_PROVIDER_MESSAGE, "" );
}
else
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_PROVIDER_MESSAGE, scmResult.getProviderMessage() );
}
if ( StringUtils.isEmpty( scmResult.getException() ) )
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_EXCEPTION, "" );
}
else
{
result.put( ContinuumBuildAgentUtil.KEY_SCM_EXCEPTION, scmResult.getException() );
}
result.put( ContinuumBuildAgentUtil.KEY_SCM_SUCCESS, scmResult.isSuccess() );
result.put( ContinuumBuildAgentUtil.KEY_SCM_CHANGES, getScmChanges( scmResult ) );
return result;
}