Hello,
Just to let you know we added XFL support in Gaia Panel.
Easy patch : just add this code in GaiaProject.jsfl
function openAndPublish(projectPath, filePath)
{
var tmpArray = filePath.split('.');
var firstArray = filePath.split('/');
var secondArray = firstArray[firstArray.length - 1].split('.');
filePath = tmpArray[0] + '/' + secondArray[0] + '.xfl';
if (fl.fileExists(filePath))
{
fl.openDocument(filePath);
var success = true;
fl.getDocumentDOM().publish();
fl.compilerErrors.save(projectPath + "/errors.log");
var errors = FLfile.read(projectPath + "/errors.log");
if (errors.length > 0)
{
var errorIndex = errors.indexOf("Error(s)");
if (errorIndex > -1) success = errors.indexOf("0 Error(s)") > - 1;
else success = false;
}
FLfile.remove(projectPath + "/errors.log");
return success;
}
}
function publishSilently(projectPath, filePath)
{
var tmpArray = filePath.split('.');
var firstArray = filePath.split('/');
var secondArray = firstArray[firstArray.length - 1].split('.');
filePath = tmpArray[0] + '/' + secondArray[0] + '.xfl';
if (fl.fileExists(filePath))
{
var success = true;
fl.publishDocument(filePath);
fl.compilerErrors.save(projectPath + "/errors.log");
var errors = FLfile.read(projectPath + "/errors.log");
if (errors.length > 0)
{
var errorIndex = errors.indexOf("Error(s)");
if (errorIndex > -1) success = errors.indexOf("0 Error(s)") > - 1;
else success = false;
}
FLfile.remove(projectPath + "/errors.log");
return success;
}
}
We could easily handle both FLA and XFL but we are using SVN, so XFL all the way :-)
FLA is deprecated :-D at last !
Best regards.
PS: both fla/xfl code here :
function openAndPublish(projectPath, filePath)
{
if (fl.fileExists(filePath))
{
fl.openDocument(filePath);
var success = true;
fl.getDocumentDOM().publish();
fl.compilerErrors.save(projectPath + "/errors.log");
var errors = FLfile.read(projectPath + "/errors.log");
if (errors.length > 0)
{
var errorIndex = errors.indexOf("Error(s)");
if (errorIndex > -1) success = errors.indexOf("0 Error(s)") > - 1;
else success = false;
}
FLfile.remove(projectPath + "/errors.log");
return success;
}
else
{
var tmpArray = filePath.split('.');
var firstArray = filePath.split('/');
var secondArray = firstArray[firstArray.length - 1].split('.');
filePath = tmpArray[0] + '/' + secondArray[0] + '.xfl';
if (fl.fileExists(filePath))
{
fl.openDocument(filePath);
var success = true;
fl.getDocumentDOM().publish();
fl.compilerErrors.save(projectPath + "/errors.log");
var errors = FLfile.read(projectPath + "/errors.log");
if (errors.length > 0)
{
var errorIndex = errors.indexOf("Error(s)");
if (errorIndex > -1) success = errors.indexOf("0 Error(s)") > - 1;
else success = false;
}
FLfile.remove(projectPath + "/errors.log");
return success;
}
}
}
function publishSilently(projectPath, filePath)
{
if (fl.fileExists(filePath))
{
var success = true;
fl.publishDocument(filePath);
fl.compilerErrors.save(projectPath + "/errors.log");
var errors = FLfile.read(projectPath + "/errors.log");
if (errors.length > 0)
{
var errorIndex = errors.indexOf("Error(s)");
if (errorIndex > -1) success = errors.indexOf("0 Error(s)") > - 1;
else success = false;
}
FLfile.remove(projectPath + "/errors.log");
return success;
}
else
{
var tmpArray = filePath.split('.');
var firstArray = filePath.split('/');
var secondArray = firstArray[firstArray.length - 1].split('.');
filePath = tmpArray[0] + '/' + secondArray[0] + '.xfl';
if (fl.fileExists(filePath))
{
var success = true;
fl.publishDocument(filePath);
fl.compilerErrors.save(projectPath + "/errors.log");
var errors = FLfile.read(projectPath + "/errors.log");
if (errors.length > 0)
{
var errorIndex = errors.indexOf("Error(s)");
if (errorIndex > -1) success = errors.indexOf("0 Error(s)") > - 1;
else success = false;
}
FLfile.remove(projectPath + "/errors.log");
return success;
}
}
}
Could be better with another function for both but not sure it would work so here you go.
This code was not tested BTW !