Kaydet (Commit) 4c6037df authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

CWS-TOOLING: integrate CWS bserver52

...@@ -160,45 +160,34 @@ ByteString SimpleConfig::GetNextLine() ...@@ -160,45 +160,34 @@ ByteString SimpleConfig::GetNextLine()
ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments ) ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments )
/*****************************************************************************/ /*****************************************************************************/
{ {
sal_Bool bStreamOk;
sal_Bool bReadNextLine = sal_True;
while (bReadNextLine)
{
bStreamOk = aFileStream.ReadLine ( aTmpStr );
if (!bStreamOk)
return ByteString();
aFileStream.ReadLine ( aTmpStr ); ByteString sTab = "\t";
if ( aTmpStr.Search( "#" ) == 0 ) ByteString sDoubleTab = "\t\t";
if (bReadComments ) ByteString sSpace = " ";
return aTmpStr; xub_StrLen nIndex = 0;
else
while ( aTmpStr.Search( "#" ) == 0 )
{
aFileStream.ReadLine ( aTmpStr );
}
aTmpStr = aTmpStr.EraseLeadingChars(); aTmpStr.SearchAndReplaceAll(sSpace, sTab);
aTmpStr = aTmpStr.EraseTrailingChars(); while ( (nIndex = aTmpStr.SearchAndReplace(sDoubleTab, sTab, nIndex )) != STRING_NOTFOUND );
// while ( aTmpStr.SearchAndReplace(String(' '),String('\t') ) != (USHORT)-1 );
int nLength = aTmpStr.Len(); aTmpStr = aTmpStr.EraseLeadingAndTrailingChars('\t'); // remove tabs
// USHORT nPos = 0;
ByteString aEraseString;
BOOL bFirstTab = TRUE;
for ( USHORT i = 0; i<= nLength; i++)
{
if ( aTmpStr.GetChar( i ) == 0x20 )
aTmpStr.SetChar( i, 0x09 );
if ( aTmpStr.GetChar( i ) == 0x09 ) if ( aTmpStr.Search( "#" ) == 0 )
{ {
if ( bFirstTab ) if (bReadComments )
bFirstTab = FALSE; return aTmpStr;
else
{
aTmpStr.SetChar( i, 0x20 );
}
} }
else else if (aTmpStr != ByteString::EmptyString())
bFirstTab = TRUE; bReadNextLine = sal_False;
} }
aTmpStr.EraseAllChars(' ');
return aTmpStr;
return aTmpStr;
} }
...@@ -824,7 +813,8 @@ Prj::Prj() : ...@@ -824,7 +813,8 @@ Prj::Prj() :
bVisited( FALSE ), bVisited( FALSE ),
bIsAvailable( TRUE ), bIsAvailable( TRUE ),
pTempCommandDataList (0), pTempCommandDataList (0),
bTempCommandDataListPermanent (FALSE) bTempCommandDataListPermanent (FALSE),
bError (FALSE)
/*****************************************************************************/ /*****************************************************************************/
{ {
} }
...@@ -841,7 +831,8 @@ Prj::Prj( ByteString aName ) : ...@@ -841,7 +831,8 @@ Prj::Prj( ByteString aName ) :
bVisited( FALSE ), bVisited( FALSE ),
bIsAvailable( TRUE ), bIsAvailable( TRUE ),
pTempCommandDataList (0), pTempCommandDataList (0),
bTempCommandDataListPermanent (FALSE) bTempCommandDataListPermanent (FALSE),
bError (FALSE)
/*****************************************************************************/ /*****************************************************************************/
{ {
} }
...@@ -1146,6 +1137,7 @@ Prj& Prj::operator>> ( SvStream& rStream ) ...@@ -1146,6 +1137,7 @@ Prj& Prj::operator>> ( SvStream& rStream )
rStream << bFixedDependencies; rStream << bFixedDependencies;
rStream << bSorted; rStream << bSorted;
rStream << bIsAvailable; rStream << bIsAvailable;
rStream << bError;
if (pPrjDepInfoList) if (pPrjDepInfoList)
{ {
...@@ -1178,6 +1170,7 @@ Prj& Prj::operator<< ( SvStream& rStream ) ...@@ -1178,6 +1170,7 @@ Prj& Prj::operator<< ( SvStream& rStream )
rStream >> bFixedDependencies; rStream >> bFixedDependencies;
rStream >> bSorted; rStream >> bSorted;
rStream >> bIsAvailable; rStream >> bIsAvailable;
rStream >> bError;
BOOL bDepList; BOOL bDepList;
rStream >> bDepList; rStream >> bDepList;
...@@ -1509,18 +1502,7 @@ void Star::Read( String &rFileName ) ...@@ -1509,18 +1502,7 @@ void Star::Read( String &rFileName )
while( aFileList.Count()) { while( aFileList.Count()) {
String ssFileName = *aFileList.GetObject(( ULONG ) 0 ); String ssFileName = *aFileList.GetObject(( ULONG ) 0 );
ByteString sFileName_l(ssFileName, RTL_TEXTENCODING_ASCII_US); StarFile* pFile = ReadBuildlist (ssFileName);
StarFile *pFile = new StarFile( ssFileName );
if ( pFile->Exists()) {
// if (sFileName_l.Len() >= RTL_CONSTASCII_LENGTH(XML_EXT) && ssFileName.EqualsAscii(XML_EXT, sFileName_l.Len() - RTL_CONSTASCII_LENGTH(XML_EXT), RTL_CONSTASCII_LENGTH(XML_EXT)))
// {
// ReadXmlBuildList(sFileName_l);
// } else {
SimpleConfig aSolarConfig( ssFileName );
while (( aString = aSolarConfig.GetNext()) != "" )
InsertToken (( char * ) aString.GetBuffer());
// }
}
aMutex.acquire(); aMutex.acquire();
ReplaceFileEntry (&aLoadedFilesList, pFile); ReplaceFileEntry (&aLoadedFilesList, pFile);
//aLoadedFilesList.Insert( pFile, LIST_APPEND ); //aLoadedFilesList.Insert( pFile, LIST_APPEND );
...@@ -1575,19 +1557,9 @@ void Star::Read( SolarFileList *pSolarFiles ) ...@@ -1575,19 +1557,9 @@ void Star::Read( SolarFileList *pSolarFiles )
ByteString aString; ByteString aString;
String ssFileName = *pSolarFiles->GetObject(( ULONG ) 0 ); String ssFileName = *pSolarFiles->GetObject(( ULONG ) 0 );
ByteString sFileName_l(ssFileName, RTL_TEXTENCODING_ASCII_US); StarFile *pFile = ReadBuildlist ( ssFileName);
StarFile *pFile = new StarFile( ssFileName );
if ( pFile->Exists()) { if ( pFile->Exists()) {
// if (sFileName_l.Len() >= RTL_CONSTASCII_LENGTH(XML_EXT) && ssFileName.EqualsAscii(XML_EXT, sFileName_l.Len() - RTL_CONSTASCII_LENGTH(XML_EXT), RTL_CONSTASCII_LENGTH(XML_EXT)))
// {
// ReadXmlBuildList(sFileName_l);
// } else {
SimpleConfig aSolarConfig( ssFileName );
while (( aString = aSolarConfig.GetNext()) != "" )
InsertToken (( char * ) aString.GetBuffer());
// }
DirEntry aEntry( pFile->GetName() ); DirEntry aEntry( pFile->GetName() );
DirEntry aEntryPrj = aEntry.GetPath().GetPath(); DirEntry aEntryPrj = aEntry.GetPath().GetPath();
if (aEntryPrj.GetExtension() != String::CreateFromAscii( "" )) if (aEntryPrj.GetExtension() != String::CreateFromAscii( "" ))
...@@ -1721,207 +1693,259 @@ void Star::Expand_Impl() ...@@ -1721,207 +1693,259 @@ void Star::Expand_Impl()
} }
/*****************************************************************************/ /*****************************************************************************/
void Star::InsertToken ( char *yytext ) StarFile* Star::ReadBuildlist (const String& rFilename, BOOL bReadComments, BOOL bExtendAlias)
/*****************************************************************************/
{
ByteString sFileName_l(rFilename, RTL_TEXTENCODING_ASCII_US);
StarFile *pFile = new StarFile( rFilename );
if ( pFile->Exists()) {
SimpleConfig aSolarConfig( rFilename );
DirEntry aEntry(rFilename);
ByteString sProjectName (aEntry.GetPath().GetPath().GetName(), RTL_TEXTENCODING_ASCII_US);
Prj* pPrj = GetPrj (sProjectName); // 0, if Prj not found
if (pPrj)
{
Remove(pPrj); // Project exist, remove old Project and read again
DELETEZ (pPrj); // delete and set pPrj to 0
}
ByteString aString;
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != ByteString::EmptyString() )
InsertTokenLine ( aString, &pPrj, sProjectName, bExtendAlias );
}
return pFile;
}
/*****************************************************************************/
void Star::InsertTokenLine ( const ByteString& rTokenLine, Prj** ppPrj, const ByteString& rProjectName, const sal_Bool bExtendAlias )
/*****************************************************************************/ /*****************************************************************************/
{ {
static int i = 0; int i = 0;
static ByteString aDirName, aWhat, aWhatOS, ByteString aWhat, aWhatOS,
sClientRestriction, aLogFileName, aProjectName, aPrefix, aCommandPara; sClientRestriction, aLogFileName, aProjectName, aPrefix, aCommandPara;
static BOOL bPrjDep = FALSE; ByteString aDirName;
static BOOL bHardDep = FALSE; BOOL bPrjDep = FALSE;
static BOOL bFixedDep = FALSE; BOOL bHardDep = FALSE;
static int nCommandType, nOSType; BOOL bFixedDep = FALSE;
BOOL bNewProject = FALSE;
int nCommandType=0, nOSType=0;
Prj* pPrj = *ppPrj;
CommandData* pCmdData; CommandData* pCmdData;
static SByteStringList *pStaticDepList; SByteStringList *pDepList = NULL;
Prj* pPrj; ByteString aCommentString;
ByteString sToken;
ByteString sStringBuffer = rTokenLine;
switch (i) while (sStringBuffer != ByteString::EmptyString())
{ {
case 0: ByteString sToken = sStringBuffer.GetToken(0,'\t');
aPrefix = yytext; sStringBuffer.Erase(0, sToken.Len()+1);
pStaticDepList = 0;
break;
case 1:
aDirName = yytext;
aProjectName = aDirName.GetToken ( 0, 0x5c);
break;
case 2:
if ( !strcmp( yytext, ":" ))
{
bPrjDep = TRUE;
bHardDep = FALSE;
bFixedDep = FALSE;
i = 9;
}
else if ( !strcmp( yytext, "::" ))
{
bPrjDep = TRUE;
bHardDep = TRUE;
bFixedDep = FALSE;
i = 9;
}
else if ( !strcmp( yytext, ":::" ))
{
bPrjDep = TRUE;
bHardDep = TRUE;
bFixedDep = TRUE;
i = 9;
}
else
{
bPrjDep = FALSE;
bHardDep = FALSE;
bFixedDep = FALSE;
aWhat = yytext; switch (i)
nCommandType = GetJobType(aWhat); {
} case 0:
if (bPrjDep) if ( sToken.Search( "#" ) == 0 )
{
if ( HasProject( aProjectName ))
{ {
RemovePrj(GetPrj(aProjectName)); i = -1;
// Projekt exist. schon, entfernen, spter neue anlegen aCommentString = sToken;
sStringBuffer = ByteString::EmptyString();
if ( Count() == 0 )
aDirName = "null_entry" ; //comments at begin of file
} }
} else
break;
case 3:
if ( !bPrjDep )
{
aWhat = yytext;
if ( aWhat == "-" )
{ {
aCommandPara = ByteString(); aPrefix = sToken;
pDepList = 0;
} }
else break;
aCommandPara = aWhat; case 1:
} aDirName = sToken;
break; aProjectName = aDirName.GetToken ( 0, 0x5c);
case 4: if (aProjectName != rProjectName)
if ( !bPrjDep ) sStringBuffer = ByteString::EmptyString(); // something is wrong, ignore line
{ break;
aWhatOS = yytext; case 2:
if ( aWhatOS.GetTokenCount( ',' ) > 1 ) { if ( sToken.CompareTo(":") == COMPARE_EQUAL )
sClientRestriction = aWhatOS.Copy( aWhatOS.GetToken( 0, ',' ).Len() + 1 ); {
aWhatOS = aWhatOS.GetToken( 0, ',' ); bPrjDep = TRUE;
bHardDep = FALSE;
bFixedDep = FALSE;
i = 9;
} }
nOSType = GetOSType (aWhatOS); else if ( sToken.CompareTo("::") == COMPARE_EQUAL )
}
break;
case 5:
if ( !bPrjDep )
{
aLogFileName = (ByteString(aProjectName).Append("_")).Append(yytext);
}
break;
default:
if ( !bPrjDep )
{
ByteString aItem = yytext;
if ( aItem == "NULL" )
{ {
// Liste zu Ende bPrjDep = TRUE;
i = -1; bHardDep = TRUE;
bFixedDep = FALSE;
i = 9;
}
else if ( sToken.CompareTo(":::") == COMPARE_EQUAL )
{
bPrjDep = TRUE;
bHardDep = TRUE;
bFixedDep = TRUE;
i = 9;
} }
else else
{ {
// ggfs. Dependency liste anlegen und ergaenzen bPrjDep = FALSE;
if ( !pStaticDepList ) bHardDep = FALSE;
pStaticDepList = new SByteStringList; bFixedDep = FALSE;
ByteString* pStr = new ByteString ((ByteString (aProjectName).Append("_")).Append(aItem));
pStaticDepList->PutString( pStr ); aWhat = sToken;
nCommandType = GetJobType(aWhat);
} }
} if (bPrjDep)
else
{
ByteString aItem = yytext;
if ( aItem == "NULL" )
{ {
// Liste zu Ende if (pPrj)
i = -1; sStringBuffer = ByteString::EmptyString(); // definition more than once or not first line, ignore line
bPrjDep= FALSE;
} }
else break;
case 3:
if ( !bPrjDep )
{ {
ByteString sMode; aWhat = sToken;
BOOL bHasModes = FALSE; if ( aWhat == "-" )
if (aItem.Search(":") != STRING_NOTFOUND)
{ {
sMode = aItem.GetToken ( 0, ':'); aCommandPara = ByteString();
aItem = aItem.GetToken ( 1, ':'); }
bHasModes = TRUE; else
aCommandPara = aWhat;
}
break;
case 4:
if ( !bPrjDep )
{
aWhatOS = sToken;
if ( aWhatOS.GetTokenCount( ',' ) > 1 ) {
sClientRestriction = aWhatOS.Copy( aWhatOS.GetToken( 0, ',' ).Len() + 1 );
aWhatOS = aWhatOS.GetToken( 0, ',' );
} }
nOSType = GetOSType (aWhatOS);
}
break;
case 5:
if ( !bPrjDep )
{
if (bExtendAlias)
aLogFileName = (ByteString(aProjectName).Append("_")).Append(sToken);
else
aLogFileName = sToken;
if ( HasProject( aProjectName )) }
break;
default:
if ( !bPrjDep )
{
ByteString aItem = sToken;
if ( aItem == "NULL" )
{ {
pPrj = GetPrj( aProjectName ); // Liste zu Ende
// Projekt exist. schon, neue Eintraege anhaengen i = -1;
} }
else else
{ {
// neues Project anlegen // ggfs. Dependency liste anlegen und ergaenzen
pPrj = new Prj ( aProjectName ); if ( !pDepList )
pPrj->SetPreFix( aPrefix ); pDepList = new SByteStringList;
Insert(pPrj,LIST_APPEND); ByteString* pStr;
if (bExtendAlias)
pStr = new ByteString ((ByteString (aProjectName).Append("_")).Append(aItem));
else
pStr = new ByteString (aItem);
pDepList->PutString( pStr );
}
}
else
{
ByteString aItem = sToken;
if ( aItem == "NULL" )
{
// Liste zu Ende
i = -1;
bPrjDep= FALSE;
} }
if (bHasModes)
pPrj->AddDependencies( aItem, sMode );
else else
pPrj->AddDependencies( aItem ); {
pPrj->HasHardDependencies( bHardDep ); ByteString sMode;
pPrj->HasFixedDependencies( bFixedDep ); BOOL bHasModes = FALSE;
if (aItem.Search(":") != STRING_NOTFOUND)
/* {
if ( nStarMode == STAR_MODE_RECURSIVE_PARSE ) { sMode = aItem.GetToken ( 0, ':');
String sItem( aItem, RTL_TEXTENCODING_ASCII_US ); aItem = aItem.GetToken ( 1, ':');
InsertSolarList( sItem ); bHasModes = TRUE;
}
if (!pPrj)
{
// neues Project anlegen
pPrj = new Prj ( aProjectName );
pPrj->SetPreFix( aPrefix );
bNewProject = TRUE;
}
if (bHasModes)
pPrj->AddDependencies( aItem, sMode );
else
pPrj->AddDependencies( aItem );
pPrj->HasHardDependencies( bHardDep );
pPrj->HasFixedDependencies( bFixedDep );
} }
*/
} }
} break;
break; }
if ( i == -1 )
break;
i++;
} }
/* Wenn dieses Project noch nicht vertreten ist, in die Liste /* Wenn dieses Project noch nicht vertreten ist, in die Liste
der Solar-Projekte einfuegen */ der Solar-Projekte einfuegen */
if ( i == -1 ) if ( i == -1 )
{ {
if ( HasProject( aProjectName )) if (!pPrj)
{
pPrj = GetPrj( aProjectName );
// Projekt exist. schon, neue Eintraege anhaengen
}
else
{ {
// neues Project anlegen // neues Project anlegen
pPrj = new Prj ( aProjectName ); pPrj = new Prj ( aProjectName );
pPrj->SetPreFix( aPrefix ); pPrj->SetPreFix( aPrefix );
Insert(pPrj,LIST_APPEND); bNewProject = TRUE;
} }
if (bNewProject)
Insert(pPrj,LIST_APPEND);
pCmdData = new CommandData; pCmdData = new CommandData;
pCmdData->SetPath( aDirName ); pCmdData->SetPath( aDirName );
pCmdData->SetCommandType( nCommandType ); pCmdData->SetCommandType( nCommandType );
pCmdData->SetCommandPara( aCommandPara ); pCmdData->SetCommandPara( aCommandPara );
pCmdData->SetOSType( nOSType ); pCmdData->SetOSType( nOSType );
pCmdData->SetLogFile( aLogFileName ); pCmdData->SetLogFile( aLogFileName );
pCmdData->SetComment( aCommentString );
pCmdData->SetClientRestriction( sClientRestriction ); pCmdData->SetClientRestriction( sClientRestriction );
if ( pStaticDepList ) if ( pDepList )
pCmdData->SetDependencies( pStaticDepList ); pCmdData->SetDependencies( pDepList );
pStaticDepList = 0; pDepList = 0;
pPrj->Insert ( pCmdData, LIST_APPEND ); pPrj->Insert ( pCmdData, LIST_APPEND );
aDirName ="";
aWhat ="";
aWhatOS = "";
sClientRestriction = "";
aLogFileName = "";
nCommandType = 0;
nOSType = 0;
}
i++;
// und wer raeumt die depLst wieder ab ? // und wer raeumt die depLst wieder ab ?
// CommandData macht das // CommandData macht das
}
else
{
if (!pPrj)
{
// new project to set the error flag
pPrj = new Prj ( rProjectName );
pPrj->SetPreFix( aPrefix );
bNewProject = TRUE;
}
if (pPrj)
{
pPrj->SetError();
if (bNewProject)
Insert(pPrj,LIST_APPEND); // add project even if there is a buildlist error
}
if ( pDepList )
delete pDepList;
}
*ppPrj = pPrj;
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -2572,19 +2596,7 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode ) ...@@ -2572,19 +2596,7 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode )
while( aFileList.Count()) { while( aFileList.Count()) {
String ssFileName = *aFileList.GetObject(( ULONG ) 0 ); String ssFileName = *aFileList.GetObject(( ULONG ) 0 );
ByteString sFileName_l(ssFileName, RTL_TEXTENCODING_ASCII_US); StarFile* pFile = ReadBuildlist (ssFileName, bReadComments, FALSE);
StarFile *pFile = new StarFile( ssFileName );
if ( pFile->Exists()) {
// if (sFileName_l.Len() >= RTL_CONSTASCII_LENGTH(XML_EXT) && ssFileName.EqualsAscii(XML_EXT, sFileName_l.Len() - RTL_CONSTASCII_LENGTH(XML_EXT), RTL_CONSTASCII_LENGTH(XML_EXT)))
// {
// ReadXmlBuildList(sFileName_l);
// } else {
SimpleConfig aSolarConfig( ssFileName );
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
InsertTokenLine ( aString );
}
// }
aMutex.acquire(); aMutex.acquire();
aLoadedFilesList.Insert( pFile, LIST_APPEND ); aLoadedFilesList.Insert( pFile, LIST_APPEND );
aMutex.release(); aMutex.release();
...@@ -2608,21 +2620,7 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments ) ...@@ -2608,21 +2620,7 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments )
while( pSolarFiles->Count()) { while( pSolarFiles->Count()) {
ByteString aString; ByteString aString;
String ssFileName = *pSolarFiles->GetObject(( ULONG ) 0 ); String ssFileName = *pSolarFiles->GetObject(( ULONG ) 0 );
ByteString sFileName_l(ssFileName, RTL_TEXTENCODING_ASCII_US); StarFile* pFile = ReadBuildlist(ssFileName, bReadComments, FALSE);
StarFile *pFile = new StarFile( ssFileName);
if ( pFile->Exists()) {
// if (sFileName_l.Len() >= RTL_CONSTASCII_LENGTH(XML_EXT) && ssFileName.EqualsAscii(XML_EXT, sFileName_l.Len() - RTL_CONSTASCII_LENGTH(XML_EXT), RTL_CONSTASCII_LENGTH(XML_EXT)))
// {
// ReadXmlBuildList(sFileName_l);
// }
// else
// {
SimpleConfig aSolarConfig( ssFileName );
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
InsertTokenLine ( aString );
// }
}
aMutex.acquire(); aMutex.acquire();
aLoadedFilesList.Insert( pFile, LIST_APPEND ); aLoadedFilesList.Insert( pFile, LIST_APPEND );
aMutex.release(); aMutex.release();
...@@ -2803,217 +2801,12 @@ USHORT StarWriter::WriteMultiple( String rSourceRoot ) ...@@ -2803,217 +2801,12 @@ USHORT StarWriter::WriteMultiple( String rSourceRoot )
} }
/*****************************************************************************/ /*****************************************************************************/
void StarWriter::InsertTokenLine ( ByteString& rString ) void StarWriter::InsertTokenLine ( const ByteString& rTokenLine )
/*****************************************************************************/ /*****************************************************************************/
{ {
int i = 0; ByteString sProjectName = rTokenLine.GetToken(1,'\t');
ByteString aWhat, aWhatOS, Prj* pPrj = GetPrj (sProjectName); // 0, if Prj not found;
sClientRestriction, aLogFileName, aProjectName, aPrefix, aCommandPara; Star::InsertTokenLine ( rTokenLine, &pPrj, sProjectName, sal_False );
static ByteString aDirName;
BOOL bPrjDep = FALSE;
BOOL bHardDep = FALSE;
BOOL bFixedDep = FALSE;
int nCommandType=0, nOSType=0;
CommandData* pCmdData;
SByteStringList *pDepList2 = NULL;
Prj* pPrj;
ByteString aEmptyString;
ByteString aToken = rString.GetToken( 0, '\t' );
ByteString aCommentString;
const char* yytext = aToken.GetBuffer();
while ( !( aToken == aEmptyString ) )
{
switch (i)
{
case 0:
if ( rString.Search( "#" ) == 0 )
{
i = -1;
aCommentString = rString;
rString = aEmptyString;
if ( Count() == 0 )
aDirName = "null_entry" ; //comments at begin of file
break;
}
aPrefix = yytext;
pDepList2 = NULL;
break;
case 1:
aDirName = yytext;
break;
case 2:
if ( !strcmp( yytext, ":" ))
{
bPrjDep = TRUE;
bHardDep = FALSE;
bFixedDep = FALSE;
i = 9;
}
else if ( !strcmp( yytext, "::" ))
{
bPrjDep = TRUE;
bHardDep = TRUE;
bFixedDep = FALSE;
i = 9;
}
else if ( !strcmp( yytext, ":::" ))
{
bPrjDep = TRUE;
bHardDep = TRUE;
bFixedDep = TRUE;
i = 9;
}
else
{
bPrjDep = FALSE;
bHardDep = FALSE;
bFixedDep = FALSE;
aWhat = yytext;
nCommandType = GetJobType(aWhat);
}
break;
case 3:
if ( !bPrjDep )
{
aWhat = yytext;
if ( aWhat == "-" )
{
aCommandPara = ByteString();
}
else
aCommandPara = aWhat;
}
break;
case 4:
if ( !bPrjDep )
{
aWhatOS = yytext;
if ( aWhatOS.GetTokenCount( ',' ) > 1 ) {
sClientRestriction = aWhatOS.Copy( aWhatOS.GetToken( 0, ',' ).Len() + 1 );
aWhatOS = aWhatOS.GetToken( 0, ',' );
}
nOSType = GetOSType (aWhatOS);
}
break;
case 5:
if ( !bPrjDep )
{
aLogFileName = yytext;
}
break;
default:
if ( !bPrjDep )
{
ByteString aItem = yytext;
if ( aItem == "NULL" )
{
// Liste zu Ende
i = -1;
}
else
{
// ggfs. Dependency liste anlegen und ergaenzen
if ( !pDepList2 )
pDepList2 = new SByteStringList;
pDepList2->PutString( new ByteString( aItem ));
}
}
else
{
ByteString aItem = yytext;
if ( aItem == "NULL" )
{
// Liste zu Ende
i = -1;
bPrjDep= FALSE;
}
else
{
ByteString sMode;
BOOL bHasModes = FALSE;
if (aItem.Search(":") != STRING_NOTFOUND)
{
sMode = aItem.GetToken ( 0, ':');
aItem = aItem.GetToken ( 1, ':');
bHasModes = TRUE;
}
aProjectName = aDirName.GetToken ( 0, 0x5c);
if ( HasProject( aProjectName ))
{
pPrj = GetPrj( aProjectName );
// Projekt exist. schon, neue Eintraege anhaengen
}
else
{
// neues Project anlegen
pPrj = new Prj ( aProjectName );
pPrj->SetPreFix( aPrefix );
Insert(pPrj,LIST_APPEND);
}
if (bHasModes)
pPrj->AddDependencies( aItem, sMode );
else
pPrj->AddDependencies( aItem );
pPrj->HasHardDependencies( bHardDep );
pPrj->HasFixedDependencies( bFixedDep );
/*
if ( nStarMode == STAR_MODE_RECURSIVE_PARSE ) {
String sItem( aItem, RTL_TEXTENCODING_ASCII_US );
InsertSolarList( sItem );
}
*/
}
}
break;
}
/* Wenn dieses Project noch nicht vertreten ist, in die Liste
der Solar-Projekte einfuegen */
if ( i == -1 )
{
aProjectName = aDirName.GetToken ( 0, 0x5c);
if ( HasProject( aProjectName ))
{
pPrj = GetPrj( aProjectName );
// Projekt exist. schon, neue Eintraege anhaengen
}
else
{
// neues Project anlegen
pPrj = new Prj ( aProjectName );
pPrj->SetPreFix( aPrefix );
Insert(pPrj,LIST_APPEND);
}
pCmdData = new CommandData;
pCmdData->SetPath( aDirName );
pCmdData->SetCommandType( nCommandType );
pCmdData->SetCommandPara( aCommandPara );
pCmdData->SetOSType( nOSType );
pCmdData->SetLogFile( aLogFileName );
pCmdData->SetComment( aCommentString );
pCmdData->SetClientRestriction( sClientRestriction );
if ( pDepList2 )
pCmdData->SetDependencies( pDepList2 );
pPrj->Insert ( pCmdData, LIST_APPEND );
}
i++;
rString.Erase(0, aToken.Len()+1);
aToken = rString.GetToken( 0, '\t' );
yytext = aToken.GetBuffer();
}
// und wer raeumt die depLst wieder ab ?
// macht CommandData selber
} }
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -287,6 +287,7 @@ private: ...@@ -287,6 +287,7 @@ private:
SDepInfoList* RemoveDepInfoList(SDepInfoList* pInfoList ); SDepInfoList* RemoveDepInfoList(SDepInfoList* pInfoList );
PrjList* pTempCommandDataList; PrjList* pTempCommandDataList;
BOOL bTempCommandDataListPermanent; BOOL bTempCommandDataListPermanent;
BOOL bError;
public: public:
Prj(); Prj();
Prj( ByteString aName ); Prj( ByteString aName );
...@@ -329,6 +330,9 @@ public: ...@@ -329,6 +330,9 @@ public:
void SetTempCommandDataListPermanent (BOOL bVar = TRUE) {bTempCommandDataListPermanent = bVar;} void SetTempCommandDataListPermanent (BOOL bVar = TRUE) {bTempCommandDataListPermanent = bVar;}
BOOL IsTempCommandDataListPermanent() {return bTempCommandDataListPermanent;} BOOL IsTempCommandDataListPermanent() {return bTempCommandDataListPermanent;}
void SetError (BOOL bVar = TRUE) {bError = bVar;}
BOOL HasError () {return bError;}
Prj& operator<< ( SvStream& rStream ); Prj& operator<< ( SvStream& rStream );
Prj& operator>> ( SvStream& rStream ); Prj& operator>> ( SvStream& rStream );
}; };
...@@ -396,6 +400,7 @@ protected: ...@@ -396,6 +400,7 @@ protected:
void Expand_Impl(); void Expand_Impl();
void ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj ); void ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj );
ULONG SearchFileEntry( StarFileList *pStarFiles, StarFile* pFile ); ULONG SearchFileEntry( StarFileList *pStarFiles, StarFile* pFile );
void InsertTokenLine (const ByteString& rToken, Prj** ppPrj, const ByteString& rProjectName, const sal_Bool bExtendAlias = sal_True);
public: public:
Star(); Star();
...@@ -421,7 +426,7 @@ public: ...@@ -421,7 +426,7 @@ public:
BOOL RemovePrj ( Prj* pPrj ); BOOL RemovePrj ( Prj* pPrj );
void RemoveAllPrj (); void RemoveAllPrj ();
void InsertToken( char *pChar ); StarFile* ReadBuildlist (const String& rFilename, BOOL bReadComments = FALSE, BOOL bExtendAlias = TRUE);
BOOL NeedsUpdate(); BOOL NeedsUpdate();
SolarFileList* NeedsFilesForUpdate(); SolarFileList* NeedsFilesForUpdate();
void ReplaceFileEntry( StarFileList *pStarFiles, StarFile* pFile ); void ReplaceFileEntry( StarFileList *pStarFiles, StarFile* pFile );
...@@ -472,7 +477,7 @@ public: ...@@ -472,7 +477,7 @@ public:
USHORT Write( String aFileName ); USHORT Write( String aFileName );
USHORT WriteMultiple( String rSourceRoot ); USHORT WriteMultiple( String rSourceRoot );
void InsertTokenLine( ByteString& rString ); void InsertTokenLine ( const ByteString& rTokenLine );
}; };
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment