Exemplo n.º 1
0
void
Project::UpdateResources(void)
{
	DPath targetpath(fPath.GetFolder());
	targetpath.Append(GetTargetName());
	
	BString resFileString;
	int32 resCount = 0;

	for (int32 i = 0; i < CountGroups(); i++)
	{
		SourceGroup *group = GroupAt(i);
		
		for (int32 j = 0; j < group->filelist.CountItems(); j++)
		{
			SourceFile *file = group->filelist.ItemAt(j);
			
			if (file->GetResourcePath(fBuildInfo).GetFullPath())
			{
				resFileString << "'" << file->GetResourcePath(fBuildInfo).GetFullPath() << "' ";
				resCount++;
			}
		}
	}
	
	if (resCount > 0)
	{
		BString resString = "xres -o ";
		resString << "'" << targetpath.GetFullPath() << "' " << resFileString;		
		BString errmsg;
		PipeCommand(resString.String(),errmsg);
		
		STRACE(1,("Resources for %s:\n%s\nErrors:%s\n",GetName(),resString.String(),errmsg.String()));
		
		if (errmsg.CountChars() > 0)
			printf("Resource errors: %s\n",errmsg.String());
	}
	else
	{
		STRACE(1,("Resources for %s: No resource files to add\n",GetName()));
	}
}