Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Nicely format build.xml #98

Open
rjkip opened this issue Feb 17, 2017 · 1 comment
Open

Nicely format build.xml #98

rjkip opened this issue Feb 17, 2017 · 1 comment
Milestone

Comments

@rjkip
Copy link
Contributor

rjkip commented Feb 17, 2017

The build.xml that is currently written is not properly indented everywhere. Would be nice to put it through DOMDocument (for example) for some reformatting. Verify that this indeed creates more legible XML. When reformatting fails due to e.g. syntax errors, a rollback must occur.

@rjkip
Copy link
Contributor Author

rjkip commented Feb 17, 2017

@rpkamp wrote:

Code to pretty print XML:

$xml = simplexml_load_string($contents);
    
$dom = new DOMDocument();
$dom->formatOutput = true;
$dom->preserveWhiteSpace = false;
$dom->loadXML($xml->asXML());
$newContents = $dom->saveXML();
$contents = $newContents;

The idea was to insert it somewhere before this line:

$this->fileHandler->writeWithBackupTo($buildFile, $contents);

The question is how much tests will fail because if this. If too many break we may need to search for an alternative, like a separate task.

@rjkip rjkip added this to the 3.1.0 milestone Feb 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant