Update scoverage to use convert xml

- Update docs for options to have default values
- Add plugin="scoverage" attribute
- Update documentation to use 4 space indentation

Change-Id: Ib12541a45f884770e8369f98b43d3b78cca7d8ec
Signed-off-by: Kien Ha <kienha9922@gmail.com>
This commit is contained in:
Kien Ha 2016-07-11 17:23:28 -04:00
parent d6add35e72
commit 62a349db4a
2 changed files with 11 additions and 7 deletions
jenkins_jobs/modules
tests/publishers/fixtures

@ -5151,9 +5151,9 @@ def scoverage(parser, xml_parent, data):
Requires the Jenkins :jenkins-wiki:`Scoverage Plugin <Scoverage+Plugin>`. Requires the Jenkins :jenkins-wiki:`Scoverage Plugin <Scoverage+Plugin>`.
:arg str report-directory: This is a directory that specifies the locations :arg str report-directory: This is a directory that specifies the locations
where the xml scoverage report is generated where the xml scoverage report is generated (required)
:arg str report-file: This is a file name that is given to the xml :arg str report-file: This is a file name that is given to the xml
scoverage report. scoverage report (required)
Example: Example:
@ -5163,10 +5163,14 @@ def scoverage(parser, xml_parent, data):
scoverage = XML.SubElement( scoverage = XML.SubElement(
xml_parent, xml_parent,
'org.jenkinsci.plugins.scoverage.ScoveragePublisher') 'org.jenkinsci.plugins.scoverage.ScoveragePublisher')
XML.SubElement(scoverage, 'reportDir').text = str( scoverage.set('plugin', 'scoverage')
data.get('report-directory', ''))
XML.SubElement(scoverage, 'reportFile').text = str( mappings = [
data.get('report-file', '')) ('report-directory', 'reportDir', None),
('report-file', 'reportFile', None),
]
helpers.convert_mapping_to_xml(
scoverage, data, mappings, fail_required=True)
def display_upstream_changes(parser, xml_parent, data): def display_upstream_changes(parser, xml_parent, data):

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<project> <project>
<publishers> <publishers>
<org.jenkinsci.plugins.scoverage.ScoveragePublisher> <org.jenkinsci.plugins.scoverage.ScoveragePublisher plugin="scoverage">
<reportDir>target/scala-2.10/scoverage-report/</reportDir> <reportDir>target/scala-2.10/scoverage-report/</reportDir>
<reportFile>scoverage.xml</reportFile> <reportFile>scoverage.xml</reportFile>
</org.jenkinsci.plugins.scoverage.ScoveragePublisher> </org.jenkinsci.plugins.scoverage.ScoveragePublisher>