AI 147143: Make sure parent directory exists when we
want to write out the XML test description.
If we are doing a massively parallel build,
this might not be the case (yet).
BUG=1800213
Automated import of CL 147143
diff --git a/tools/utils/DescriptionGenerator.java b/tools/utils/DescriptionGenerator.java
index e81e6d6..54dd7e9 100644
--- a/tools/utils/DescriptionGenerator.java
+++ b/tools/utils/DescriptionGenerator.java
@@ -250,8 +250,11 @@
t.setOutputProperty("indent", "yes");
t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","4");
+ File file = new File(mOutputPath);
+ file.getParentFile().mkdirs();
+
t.transform(new DOMSource(mDoc),
- new StreamResult(new FileOutputStream(new File(mOutputPath))));
+ new StreamResult(new FileOutputStream(file)));
}
/**