Add doxygen builder support

Change-Id: I5ebc0f3708cec121e2e514be1a340c82218d429d
This commit is contained in:
Brian Saville 2014-10-29 12:44:51 -06:00 committed by Dong Ma
parent 05e4ccb3ea
commit 7dc27e9868
8 changed files with 91 additions and 8 deletions

View File

@ -773,6 +773,38 @@ def artifact_resolver(parser, xml_parent, data):
XML.SubElement(ar, 'releaseChecksumPolicy').text = 'warn'
def doxygen(parser, xml_parent, data):
"""yaml: doxygen
Builds doxygen HTML documentation. Requires the Jenkins
:jenkins-wiki:`Doxygen plugin <Doxygen+Plugin>`.
:arg str doxyfile: The doxyfile path (required)
:arg str install: The doxygen installation to use (required)
:arg bool ignore-failure: Keep executing build even on doxygen generation
failure (default false)
:arg bool unstable-warning: Mark the build as unstable if warnings are
generated (default false)
Example:
.. literalinclude:: /../../tests/builders/fixtures/doxygen001.yaml
:language: yaml
"""
doxygen = XML.SubElement(xml_parent,
'hudson.plugins.doxygen.DoxygenBuilder')
try:
XML.SubElement(doxygen, 'doxyfilePath').text = str(data['doxyfile'])
XML.SubElement(doxygen, 'installationName').text = str(data['install'])
except KeyError as e:
raise MissingAttributeError(e.arg[0])
XML.SubElement(doxygen, 'continueOnBuildFailure').text = str(
data.get('ignore-failure', False)).lower()
XML.SubElement(doxygen, 'unstableIfWarnings').text = str(
data.get('unstable-warning', False)).lower()
def gradle(parser, xml_parent, data):
"""yaml: gradle
Execute gradle tasks. Requires the Jenkins :jenkins-wiki:`Gradle Plugin

View File

@ -3877,7 +3877,8 @@ def doxygen(parser, xml_parent, data):
Requires the Jenkins :jenkins-wiki:`Doxygen Plugin <Doxygen+Plugin>`.
:arg str doxyfile: The doxyfile path
:arg bool keepall: Retain doxygen generation for each successful build
:arg str slave: The node or label to pull the doxygen HTML files from
:arg bool keep-all: Retain doxygen generation for each successful build
(default: false)
:arg str folder: Folder where you run doxygen (default: '')
@ -3886,13 +3887,29 @@ def doxygen(parser, xml_parent, data):
.. literalinclude:: /../../tests/publishers/fixtures/doxygen001.yaml
:language: yaml
"""
logger = logging.getLogger(__name__)
p = XML.SubElement(xml_parent, 'hudson.plugins.doxygen.DoxygenArchiver')
if not data['doxyfile']:
raise JenkinsJobsException("The path to a doxyfile must be specified.")
XML.SubElement(p, 'doxyfilePath').text = str(data.get("doxyfile"))
XML.SubElement(p, 'keepAll').text = str(data.get("keepall", False)).lower()
XML.SubElement(p, 'folderWhereYouRunDoxygen').text = \
str(data.get("folder", ""))
if not data.get('doxyfile'):
raise JenkinsJobsException('The path to a doxyfile must be specified.')
XML.SubElement(p, 'doxyfilePath').text = str(data.get('doxyfile'))
XML.SubElement(p, 'runOnChild').text = str(data.get('slave', ''))
# backward compatibility
if 'keepall' in data:
if 'keep-all' in data:
XML.SubElement(p, 'keepAll').text = str(
data.get('keep-all', False)).lower()
logger.warn("The value of 'keepall' will be ignored "
"in preference to 'keep-all'.")
else:
XML.SubElement(p, 'keepAll').text = str(
data.get('keepall', False)).lower()
logger.warn("'keepall' is deprecated please use 'keep-all'")
else:
XML.SubElement(p, 'keepAll').text = str(
data.get('keep-all', False)).lower()
XML.SubElement(p, 'folderWhereYouRunDoxygen').text = str(
data.get('folder', ''))
def sitemonitor(parser, xml_parent, data):

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<builders>
<hudson.plugins.doxygen.DoxygenBuilder>
<doxyfilePath>Doxyfile</doxyfilePath>
<installationName>doxygen</installationName>
<continueOnBuildFailure>true</continueOnBuildFailure>
<unstableIfWarnings>true</unstableIfWarnings>
</hudson.plugins.doxygen.DoxygenBuilder>
</builders>
</project>

View File

@ -0,0 +1,6 @@
builders:
- doxygen:
doxyfile: Doxyfile
install: doxygen
ignore-failure: true
unstable-warning: true

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<builders>
<hudson.plugins.doxygen.DoxygenBuilder>
<doxyfilePath>Doxyfile</doxyfilePath>
<installationName>doxygen</installationName>
<continueOnBuildFailure>false</continueOnBuildFailure>
<unstableIfWarnings>false</unstableIfWarnings>
</hudson.plugins.doxygen.DoxygenBuilder>
</builders>
</project>

View File

@ -0,0 +1,4 @@
builders:
- doxygen:
doxyfile: Doxyfile
install: doxygen

View File

@ -3,6 +3,7 @@
<publishers>
<hudson.plugins.doxygen.DoxygenArchiver>
<doxyfilePath>Doxyfile</doxyfilePath>
<runOnChild>doxygen-slave</runOnChild>
<keepAll>false</keepAll>
<folderWhereYouRunDoxygen>build</folderWhereYouRunDoxygen>
</hudson.plugins.doxygen.DoxygenArchiver>

View File

@ -1,5 +1,6 @@
publishers:
- doxygen:
doxyfile: "Doxyfile"
keepall: false
slave: "doxygen-slave"
keep-all: false
folder: "build"