static void DiabloGit(Args _args)
{
ProjName projName;
ProjectListNode list = infolog.projectRootNode().AOTfindChild("Shared");
TreeNodeIterator ir = list.AOTiterator();
ProjectNode pnProj;
ProjectNode pn;
struct prop;
str strFieldName;
Commaio file;
str filename;
container line,header;
Dialog dialog;
DialogField field;
#properties
void ExportTreeNodeasXpo(str _path, str _name, str _aotPath)
{
TreeNode treeNode;
FileIoPermission perm;
str exportFile;
#define.ExportMode("w")
;
if (!WinApi::pathExists(_path))
{
WinApi::createDirectoryPath(_path);
}
exportFile = _path + _name;
perm = new FileIoPermission(exportFile, #ExportMode);
if (perm == null)
{
return;
}
perm.assert();
_aotPath = _aotPath+SubStr(_name ,1 , strLen(_name)-4);
treeNode = TreeNode::findNode(_aotPath);
if (treeNode != null)
{
treeNode.treeNodeExport(exportFile);
}
CodeAccessPermission::revertAssert();
}
void searchAllObj(projectNode rootNode)
{
#TreeNodeSysNodeType
TreeNode childNode;
TreeNodeIterator rootNodeIterator;
utilelements result;
str objPath, objName, aotPath;
int start;
int end;
str root;
;
root = @'C:\Sources';
if (rootNode)
{
rootNodeIterator = rootNode.AOTiterator();
childNode = rootNodeIterator.next();
while (childnode)
{
if (childNode.AOTgetNodeType() == #NT_PROJECT_GROUP)
searchAllObj(childNode);
else
{
start = Strlen(childNode.treeNodePath()) - strLen(childNode.treeNodeName());
end = strLen(childNode.treeNodePath());
aotPath = subStr(childNode.treeNodePath(),1,start);
objPath = root+subStr(childNode.treeNodePath(),1,start);
objName = childNode.treeNodeName()+".xpo";
ExportTreeNodeasXpo(objPath, objName, aotPath);
}
childNode = rootNodeIterator.next();
}
}
}
;
dialog = new Dialog();
dialog.addText("Select Project:");
field = dialog.addField(typeid(ProjName));
dialog.run();
if (dialog.closedOk())
{
projName = field.value();
}
pn = list.AOTfindChild(projName);
if (pn)
{
pnProj = pn.loadForInspection();
searchAllObj(pnProj);
pnproj.treeNodeRelease();
}
else
error("Projet not found");
info("Terminato!");
}
Se Lanciato su un progettino così fatto:
Il job potrebbe essere usato come base di integrazione per sistemi di controllo di versione come TFS o GIT
Nessun commento:
Posta un commento