diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 153569447..a518d7512 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -3249,6 +3249,33 @@ def description_setter(parser, xml_parent, data): XML.SubElement(descriptionsetter, 'setForMatrix').text = for_matrix +def doxygen(parser, xml_parent, data): + """yaml: doxygen + This plugin parses the Doxygen descriptor (Doxyfile) and provides a link to + the generated Doxygen documentation. + + Requires the Jenkins `Doxygen Plugin. + `_ + + :arg str doxyfile: The doxyfile path + :arg bool keepall: Retain doxygen generation for each successful build + (default: false) + :arg str folder: Folder where you run doxygen (default: '') + + Example: + + .. literalinclude:: /../../tests/publishers/fixtures/doxygen001.yaml + + """ + 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", "")) + + def sitemonitor(parser, xml_parent, data): """yaml: sitemonitor This plugin checks the availability of an url. diff --git a/setup.cfg b/setup.cfg index b3ee88ab0..0cf83e0cf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -110,6 +110,7 @@ jenkins_jobs.publishers = coverage=jenkins_jobs.modules.publishers:coverage cppcheck=jenkins_jobs.modules.publishers:cppcheck description-setter=jenkins_jobs.modules.publishers:description_setter + doxygen=jenkins_jobs.modules.publishers:doxygen email-ext=jenkins_jobs.modules.publishers:email_ext email=jenkins_jobs.modules.publishers:email emotional-jenkins=jenkins_jobs.modules.publishers:emotional_jenkins diff --git a/tests/publishers/fixtures/doxygen001.xml b/tests/publishers/fixtures/doxygen001.xml new file mode 100644 index 000000000..099e93ef2 --- /dev/null +++ b/tests/publishers/fixtures/doxygen001.xml @@ -0,0 +1,10 @@ + + + + + Doxyfile + false + build + + + diff --git a/tests/publishers/fixtures/doxygen001.yaml b/tests/publishers/fixtures/doxygen001.yaml new file mode 100644 index 000000000..b0be6de3c --- /dev/null +++ b/tests/publishers/fixtures/doxygen001.yaml @@ -0,0 +1,5 @@ +publishers: + - doxygen: + doxyfile: "Doxyfile" + keepall: false + folder: "build"