plistファイルをJUnitスタイルのXMLに変換しようとしています。plistをJUnit/ANTXMLに変換するxslスタイルシートがあります。
plistをXMLに変換するために実行するperlコードは次のとおりです。
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
my $stylesheet = $xslt->parse_stylesheet_file("\\\~/Hudson/build/workspace/ui-automation/automation\\\ test\\\ suite/plist2junit.xsl");
my $counter = 1;
my @plistFiles = glob('Logs/*/*.plist');
foreach (@plistFiles){
#Escape the file path and specify abosulte path
my $plistFile = $_;
$plistFile =~ s/([ ()])/\\$1/g;
$path2plist = "\\\~/Hudson/build/workspace/ui-automation/automation\\\ test\\\ suite/$plistFile";
#transform the plist file to xml
my $source = $parser->parse_file($path2plist);
my $results = $stylesheet->transform($source);
my $resultsFile = "\\\~/Hudson/build/workspace/ui-automation/automation\\\ test\\\ suite/JUnit/results$counter.xml";
#create the output file
unless(open FILE, '>'.$resultsFile) {
# Die with error message
die "\nUnable to create $file\n";
}
# Write results to the file.
$stylesheet->output_file($results, FILE);
close FILE;
$counter++;
}
Hudson / Jenkinsでperlスクリプトを実行すると、次のエラーメッセージが出力されます。
〜/ Hudson / build / worksheet / ui-automation / Automation \ test \ suite / Logs / Run \ 1 / Automation \ Results.plistを開けませんでした:そのようなファイルまたはディレクトリはありません
エラーの原因my $source = $parser->parse_file($path2plist);
はコード内です。ファイルが見つからない/読み取れない理由がわかりません。
エラーの原因を知っている人はいますか?