Make sure <?xml starts at the beginning of the file when creating an empty xml report

Review Request #1856 - Created March 4, 2015 and submitted

Information
Eric Ayers
pants
zundel/dedent-empty-xml
1196
0b00e32...
Reviewers
pants-reviews
jsirois, stuhood
  • Make sure <?xml starts at the beginning of the file when creating an empty xml report.
  • Create the empty report under a different name to avoid confusing it with real ivy output.
  • This change also raises an exception when the ivy report .xml file is not found. I'm not sure why it wouldn't be there, and the
    creation of ivy_jar_products now depends on it.

CI is green at https://travis-ci.org/pantsbuild/pants/builds/53264069

I don't think this code ever gets exercised, I forced it in a pdb session by setting a break point then moving the report aside.

 ls -l /Users/zundel/.ivy2/pants/internal-f8ecb12181375ea82eee7fdf81233ebfaed4d60f-default*
-rw-r--r--  1 zundel  zundel    409 Mar  5 17:17 /Users/zundel/.ivy2/pants/internal-f8ecb12181375ea82eee7fdf81233ebfaed4d60f-default-empty.xml
-rw-r--r--  1 zundel  zundel  24974 Mar  5 17:14 /Users/zundel/.ivy2/pants/internal-f8ecb12181375ea82eee7fdf81233ebfaed4d60f-default.xml.old

while running ./pants idea examples/src/java:: --resove-ivy-open

Before this change, if you do try to parse the file created by this function you get:

               FAILURE

Exception message: XML or text declaration not at start of entity: line 2, column 8
Stu Hood
Eric Ayers
Eric Ayers
John Sirois
Eric Ayers
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks for the reviews. Commit 6099e65

Loading...