api.getLogger().info( "Preparing to execute si projectinfo for " + configPath );
Response infoRes = api.runCommand( siProjectInfoCmd );
// Get the only work item from the response
WorkItem wi = infoRes.getWorkItems().next();
// Get the metadata information about the project
Field pjNameFld = wi.getField( "projectName" );
Field pjTypeFld = wi.getField( "projectType" );
Field pjCfgPathFld = wi.getField( "fullConfigSyntax" );
Field pjChkptFld = wi.getField( "lastCheckpoint" );
// Convert to our class fields
// First obtain the project name field
if ( null != pjNameFld && null != pjNameFld.getValueAsString() )
{
projectName = pjNameFld.getValueAsString();
}
else
{
api.getLogger().warn( "Project info did not provide a value for the 'projectName' field!" );
projectName = "";
}
// Next, we'll need to know the project type
if ( null != pjTypeFld && null != pjTypeFld.getValueAsString() )
{
projectType = pjTypeFld.getValueAsString();
if ( isBuild() )
{
// Next, we'll need to know the current build checkpoint for this configuration
Field pjRevFld = wi.getField( "revision" );
if ( null != pjRevFld && null != pjRevFld.getItem() )
{
projectRevision = pjRevFld.getItem().getId();
}
else
{
projectRevision = "";
api.getLogger().warn( "Project info did not provide a vale for the 'revision' field!" );