From b8b5b64dc2e65d2b5fbebe0104cee95806063e84 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 16 Jan 2017 12:05:38 +0100 Subject: [PATCH 01/26] Add XML output --- Documentation/doc/resources/1.8.13/BaseDoxyfile.in | 2 +- Documentation/doc/resources/1.8.4/BaseDoxyfile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 6121fdf771c..18a37b7f2ee 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -1960,7 +1960,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = NO +GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 972fb8ed031..2d0277784cc 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -1572,7 +1572,7 @@ MAN_LINKS = NO # generate an XML file that captures the structure of # the code including all documentation. -GENERATE_XML = NO +GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be From 82860688d12f6e8596626b9d83b7fac6c56eec44 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 24 Jan 2017 09:39:23 +0100 Subject: [PATCH 02/26] Fix the doc to avoid diffs between 1.8.4 and 1.8.13 outputs --- AABB_tree/include/CGAL/AABB_tree.h | 4 ++-- Documentation/doc/resources/1.8.13/BaseDoxyfile.in | 4 +++- Documentation/doc/resources/1.8.4/BaseDoxyfile.in | 3 ++- Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h | 4 ++-- Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h | 4 ++-- .../include/CGAL/Polygon_mesh_processing/fair.h | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 0e38064d066..60a0666fb55 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -1127,7 +1127,7 @@ public: this->traversal(query, traversal_traits); return traversal_traits.is_intersection_found(); } - +#ifndef DOXYGEN_RUNNING //To avoid doxygen to consider definition and declaration as 2 different functions (size_type causes problems) template template typename AABB_tree::size_type @@ -1146,7 +1146,7 @@ public: this->traversal(query, traversal_traits); return counter; } - +#endif template template OutputIterator diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 18a37b7f2ee..9a4fdcb9d51 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -931,7 +931,9 @@ EXCLUDE_SYMBOLS = Tr \ Cb \ Fb \ K \ - Traits + Traits \ + internal \ + internal::* \ # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 2d0277784cc..3bb890c3213 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -816,7 +816,8 @@ EXCLUDE_SYMBOLS = Tr \ Cb \ Fb \ K \ - Traits + Traits \ + internal # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h index 756fd985a1a..42fad7a69a0 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h @@ -31,9 +31,9 @@ #include namespace CGAL { - +#ifndef DOXYGEN_RUNNING //to avoid conflicts template class Polygon_2; - +#endif template class Polygon_2_const_edge_circulator { public: diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h index e2d0c8d01f5..a0fe9b716d1 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h @@ -29,9 +29,9 @@ #include namespace CGAL { - +#ifndef DOXYGEN_RUNNING //to avoid conflicts template class Polygon_2; - +#ifndef template class Polygon_2__Segment_ptr { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index 8d6de21215a..3a9166b4725 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -67,7 +67,7 @@ namespace internal { based on solving a linear bi-Laplacian system with boundary constraints, described in \cgalCite{Botsch2008OnLinearVariational}. The optional parameter `fairing_continuity` gives the ability to control the tangential - continuity C\a n of the output mesh. + continuity C\a n of the output mesh. The region described by `vertices` might contain multiple disconnected components. Note that the mesh connectivity is not altered in any way, From 1a11ac07e7d9f13121b35f8c060cd0635b3f9a77 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 24 Jan 2017 10:55:17 +0100 Subject: [PATCH 03/26] Add scripts to compare cml outputs --- .../doc/scripts/compare_testsuites.sh | 37 ++++ .../doc/scripts/documentation_parser.py | 179 ++++++++++++++++++ 2 files changed, 216 insertions(+) create mode 100644 Documentation/doc/scripts/compare_testsuites.sh create mode 100644 Documentation/doc/scripts/documentation_parser.py diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh new file mode 100644 index 00000000000..c3ec9b43038 --- /dev/null +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -0,0 +1,37 @@ +#!/bin/bash +#Path to the CGAL_Documentation_build_directory/doc_output +PATH_TO_DOC="$1" +#path to the repository containing the output of this script for the reference documentation. +DOC_REF="$2" +#output in a new directory +mkdir -p doc_data +cd ./doc_data +for dir in $PATH_TO_DOC/* +do + OUTPUT=$(basename $dir) + python ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" + echo "$dir done" +done +cd .. +#diff the output and the reference output, ignoring the differences in whitespaces +diff -u -w ./doc_data $DOC_REF > ./diff.txt + +#generate an html page showing the status of the diff +echo "" > result.html +echo "" >> result.html +echo " " >> result.html +echo " " >> result.html +echo " Documentation Status" >> result.html +echo " " >> result.html +echo " " >> result.html + +#if there is a diff, give a link to show it +if [[ -s ./diff.txt ]] +then + echo " The documentation has changed ! See logs. " >> result.html +#else just say that everything is fine +else + echo " The documentation has not changed. " >> result.html +fi +echo " " >> result.html +echo "" >> result.html diff --git a/Documentation/doc/scripts/documentation_parser.py b/Documentation/doc/scripts/documentation_parser.py new file mode 100644 index 00000000000..4cbe52216bd --- /dev/null +++ b/Documentation/doc/scripts/documentation_parser.py @@ -0,0 +1,179 @@ +from pyquery import PyQuery as pq +from collections import defaultdict +from sys import argv +import os.path as op + +def check_type(_in, args): + res = False; + for arg in args: + res = res or _in == arg + return res + +root_path=argv[1] +d = pq(filename=root_path+'/index.xml', parser="xml") +compounds=[p.text() for p in d('compound').items()] +types=[p.attr('kind') for p in d('compound').items()] +type_map = defaultdict(list) #map +dict_map = defaultdict(dict)#map > +#FOREACH compounds : fill maps +for i in xrange(0,len(compounds)): + if check_type(types[i], "typedef"): + types[i]="type" + name=d('compound').children("name").eq(i).text() + members=[p.text() for p in d('compound').eq(i).children("member").items()] + m_types=[p.attr('kind') for p in d('compound').eq(i).children("member").items()] + if (not check_type(types[i], ['example', 'file', 'dir', 'page', 'group']) and + not (types[i] == "namespace" and len(members) == 0) and + not (types[i] == "enum" and len(members) == 0) ): + if (types[i] == "class"):#check if the class is a concept class + compound=d('compound').children("name").eq(i).text().replace('_', '__').replace('::', '_1_1') + filepath='class'+compound+'.xml' + if(op.isfile(root_path+filepath)): + e = pq(filename=root_path+filepath, parser="xml") + compoundnames=[p.text() for p in e('includes').items()] + if(compoundnames[0].find("Concept") != -1): + types[i] = 'Concept '+types[i].lower() + type_map[types[i]].append(name) + + mtype_map = defaultdict(list)# map + + #FOREACH member : + for j in xrange(0,len(members)): + if(check_type(types[i], ['class', 'Concept class']) + and m_types[j] == "function"): + m_types[j]="method" + if(m_types[j] == "typedef"): + m_types[j]="type" + mtype_map[m_types[j]].append(members[j]) + #end FOREACH member + dict_map[name]=mtype_map +#end FOREACH compound +indent="" + + + + +#print +#FOREACH type +for btype in type_map: + out=btype + if btype.endswith('s'): + out+='e' + print out.title()+'s' + indent+=" " + #FOREACH name + for name in type_map[btype]: + filepath="" + if check_type(btype, ['class', 'Concept class']): + filepath='/class'+name.replace('_', '__').replace('::', '_1_1')+'.xml' + elif btype == 'namespace': + filepath='/namespace'+name.replace('_', '__').replace('::', '_1_1')+'.xml' + templates=[] + if op.isfile(root_path+filepath): + f=pq(filename=root_path+filepath, parser="xml") + templateparams=f("compounddef").children("templateparamlist").eq(0).children("param").items() + for param in templateparams: + template_type="" + template_name="" + template_defval="" + template_type=param.children("type").text() + template_name=param.children("declname").text() + template_defval=param.children("defval").text() + complete_template="" + if not template_type is None: + complete_template+=template_type+' ' + if not template_name is None: + complete_template+=template_name + if not template_defval is None: + complete_template+=' = '+template_defval + templates.append(complete_template) + if templates==[]:#if no child was found, just take param.text() + templates=[t.text() for t in param.items()] + suffix="<" + #as template got type, defname and declname, name is twice in template. keep only one of them. + to_remove=[""] + for template in templates: + suffix+=template+', ' + if suffix == "<": + suffix="" + if suffix.endswith(', '): + suffix = suffix[:-2]+'>' + print indent+name+suffix + + indent+=" " + #FOREACH mtype + for mtype in (dict_map[name]): + out=mtype + if mtype.endswith('s'): + out+='e' + print indent+out.title()+'s' + indent+=" " + #FOREACH member + overload_map = defaultdict(int) #contains the number of times a member has appeared (to manage the overloads) + templateparams=[] + for member in dict_map[name][mtype]: + templates=[] + args="" # will contain the arguments of the methods and functions + return_type="" #will contain the return type of a function/method + + #look for arguments + if op.isfile(root_path+filepath): + f=pq(filename=root_path+filepath, parser="xml") + index=0 + memberdefs=[m.text() for m in f("memberdef").items()] + for i in xrange(0,len(memberdefs)): + member_names=[member_name.text() for member_name in f('memberdef').eq(i).children("name").items()] + if f('memberdef').eq(i).children("name").text() == member: + if (index < overload_map[member]): + index+=1 + elif (index == overload_map[member]): + if check_type(mtype, ['function', 'method']): + args=[f('memberdef').eq(i).children("argsstring").text()] + templateparams=f('memberdef').eq(i).children("templateparamlist").children("param").items() + if check_type(mtype, ['function', 'method', 'type', 'variable']): + return_type=[f('memberdef').eq(i).children("type").text()] + break; + #end foreach memberdef + arguments="" + for arg in args: + arguments+=arg + template_types=[] + template_names=[] + for param in templateparams: + template_type="" + template_name="" + template_defval="" + template_type=param.children("type").text() + template_name=param.children("declname").text() + template_defval=param.children("defval").text() + complete_template="" + if not template_type is None: + complete_template+=template_type+' ' + if not template_name is None: + complete_template+=template_name + if not template_defval is None: + complete_template+=' = '+template_defval + templates.append(complete_template) + if templates==[]:#if no child was found, just take param.text() + templates=[t.text() for t in param.items()] + + prefix="template <" + for template in templates: + prefix+=template+', ' + if prefix == "template <": + prefix="" + if prefix.endswith(', '): + prefix = prefix[:-2]+'>\n'+indent+" " + for definition in return_type: + prefix+=definition + if(prefix != ""): + prefix+=" " + print indent+prefix+member+arguments + overload_map[member]+=1 + #END foreach member + indent=indent[:-2] + #END foreach mtype + indent=indent[:-2] + #END foreach name + indent=indent[:-2] +#END foreach type From 60d0a39d42f3644205f5269f572567bee951097f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 24 Jan 2017 14:18:22 +0100 Subject: [PATCH 04/26] fixes --- .../doc/resources/1.8.13/BaseDoxyfile.in | 5 ++- .../doc/resources/1.8.4/BaseDoxyfile.in | 2 +- .../doc/scripts/compare_testsuites.sh | 36 ++++++++++++++++--- .../doc/scripts/documentation_parser.py | 27 +++++++------- .../CGAL/Polygon_2/Polygon_2_edge_iterator.h | 2 +- .../CGAL/Polygon_mesh_processing/fair.h | 2 +- 6 files changed, 52 insertions(+), 22 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 9a4fdcb9d51..73cb351a269 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -487,7 +487,7 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = #--------------------------------------------------------------------------- # Build related configuration options @@ -932,8 +932,7 @@ EXCLUDE_SYMBOLS = Tr \ Fb \ K \ Traits \ - internal \ - internal::* \ + internal # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 3bb890c3213..27f5dacb251 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -444,7 +444,7 @@ LOOKUP_CACHE_SIZE = 0 # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = YES +EXTRACT_ALL = # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index c3ec9b43038..1efcee73542 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -1,20 +1,43 @@ #!/bin/bash #Path to the CGAL_Documentation_build_directory/doc_output PATH_TO_DOC="$1" + +if ! [ -d "$PATH_TO_DOC" ] || [ $(basename $PATH_TO_DOC) != "doc_output" ]; then + echo "wrong path" + exit 1 +fi + #path to the repository containing the output of this script for the reference documentation. DOC_REF="$2" #output in a new directory mkdir -p doc_data cd ./doc_data +if [ $# -gt 2 ]; then + echo "too many arguments" + exit 1 + fi + +FAILURES=() for dir in $PATH_TO_DOC/* do OUTPUT=$(basename $dir) python ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" - echo "$dir done" + if [ $? -eq 0 ]; then + echo "$dir OK" + else + echo "$dir FAILED" + FAILURES+="$dir " + fi done cd .. +echo "Output generated" +if ! [ -d "$DOC_REF" ]; then + echo "No reference given. Script is finished." + exit 2 +fi + #diff the output and the reference output, ignoring the differences in whitespaces -diff -u -w ./doc_data $DOC_REF > ./diff.txt +diff -u -N -w ./doc_data $DOC_REF > ./diff.txt #generate an html page showing the status of the diff echo "" > result.html @@ -28,10 +51,15 @@ echo " " >> result.html #if there is a diff, give a link to show it if [[ -s ./diff.txt ]] then - echo " The documentation has changed ! See logs. " >> result.html + echo "

The documentation has changed ! See logs.
" >> result.html #else just say that everything is fine else - echo " The documentation has not changed. " >> result.html + echo "

The documentation has not changed.

" >> result.html fi +if [ "${FAILURES[0]}" != "" ]; then + echo " Some packages encountered problems while being parsed :

" >> result.html + echo " ${FAILURE[*]}
">> result.html +fi +echo "

" >> result.html echo " " >> result.html echo "" >> result.html diff --git a/Documentation/doc/scripts/documentation_parser.py b/Documentation/doc/scripts/documentation_parser.py index 4cbe52216bd..187b175bf4f 100644 --- a/Documentation/doc/scripts/documentation_parser.py +++ b/Documentation/doc/scripts/documentation_parser.py @@ -3,14 +3,15 @@ from collections import defaultdict from sys import argv import os.path as op +# if _in is part of args, return true. def check_type(_in, args): - res = False; - for arg in args: - res = res or _in == arg - return res + if _in in args: + return True + else: + return False root_path=argv[1] -d = pq(filename=root_path+'/index.xml', parser="xml") +d = pq(filename=op.join(op.sep, root_path,'index.xml'), parser="xml") compounds=[p.text() for p in d('compound').items()] types=[p.attr('kind') for p in d('compound').items()] type_map = defaultdict(list) #map @@ -28,10 +29,12 @@ for i in xrange(0,len(compounds)): if (types[i] == "class"):#check if the class is a concept class compound=d('compound').children("name").eq(i).text().replace('_', '__').replace('::', '_1_1') filepath='class'+compound+'.xml' - if(op.isfile(root_path+filepath)): - e = pq(filename=root_path+filepath, parser="xml") + total_path=op.join(op.sep, root_path,filepath) + if(op.isfile(total_path)): + e = pq(filename=total_path, parser="xml") compoundnames=[p.text() for p in e('includes').items()] - if(compoundnames[0].find("Concept") != -1): + + if(len(compoundnames) > 1 and compoundnames[0].find("Concept") != -1): types[i] = 'Concept '+types[i].lower() type_map[types[i]].append(name) @@ -69,8 +72,8 @@ for btype in type_map: elif btype == 'namespace': filepath='/namespace'+name.replace('_', '__').replace('::', '_1_1')+'.xml' templates=[] - if op.isfile(root_path+filepath): - f=pq(filename=root_path+filepath, parser="xml") + if op.isfile(op.join(op.sep, root_path,filepath)): + f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") templateparams=f("compounddef").children("templateparamlist").eq(0).children("param").items() for param in templateparams: template_type="" @@ -117,8 +120,8 @@ for btype in type_map: return_type="" #will contain the return type of a function/method #look for arguments - if op.isfile(root_path+filepath): - f=pq(filename=root_path+filepath, parser="xml") + if op.isfile(op.join(op.sep, root_path,filepath)): + f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") index=0 memberdefs=[m.text() for m in f("memberdef").items()] for i in xrange(0,len(memberdefs)): diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h index a0fe9b716d1..fc282b7fa50 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h @@ -31,7 +31,7 @@ namespace CGAL { #ifndef DOXYGEN_RUNNING //to avoid conflicts template class Polygon_2; -#ifndef +#endif template class Polygon_2__Segment_ptr { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index 3a9166b4725..8978448be58 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -67,7 +67,7 @@ namespace internal { based on solving a linear bi-Laplacian system with boundary constraints, described in \cgalCite{Botsch2008OnLinearVariational}. The optional parameter `fairing_continuity` gives the ability to control the tangential - continuity C\a n of the output mesh. + continuity C n of the output mesh. The region described by `vertices` might contain multiple disconnected components. Note that the mesh connectivity is not altered in any way, From 477196c52d7c734c0005bb2577aa013eaab5fad0 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 6 Feb 2017 16:31:48 +0100 Subject: [PATCH 05/26] clean-up --- Documentation/doc/resources/1.8.13/BaseDoxyfile.in | 4 ++-- Documentation/doc/resources/1.8.4/BaseDoxyfile.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 73cb351a269..95c2d26b4fd 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -487,7 +487,7 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = +EXTRACT_ALL = YES #--------------------------------------------------------------------------- # Build related configuration options @@ -1961,7 +1961,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = YES +GENERATE_XML = # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 27f5dacb251..e91328518a0 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -444,7 +444,7 @@ LOOKUP_CACHE_SIZE = 0 # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. @@ -1573,7 +1573,7 @@ MAN_LINKS = NO # generate an XML file that captures the structure of # the code including all documentation. -GENERATE_XML = YES +GENERATE_XML = # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be From 18d523b0693b41049f07253fe68821ba3896bad3 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 6 Feb 2017 17:22:52 +0100 Subject: [PATCH 06/26] Add a cmake option for GENERATE_XML --- Documentation/doc/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 889a6d15a82..323ce63b498 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -78,6 +78,10 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) if(EXISTS "${CGAL_PACKAGE_DIR}/examples") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples\n") endif() + if(CGAL_GENERATE_XML) + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "GENERATE_XML = YES\n") + endif() + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "GENERATE_TAGFILE = ${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_NAME}.tag\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_PATH += ${CGAL_PACKAGE_DIR}/include/\n") From e4f65127c284826f5d6096695a5e488c360ae75a Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 13 Feb 2017 10:11:54 +0100 Subject: [PATCH 07/26] Add a script to compare to versions of doxygen --- .../doc/scripts/test_doxygen_versions.sh | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Documentation/doc/scripts/test_doxygen_versions.sh diff --git a/Documentation/doc/scripts/test_doxygen_versions.sh b/Documentation/doc/scripts/test_doxygen_versions.sh new file mode 100644 index 00000000000..ba5faa4fffd --- /dev/null +++ b/Documentation/doc/scripts/test_doxygen_versions.sh @@ -0,0 +1,56 @@ +#!/bin/bash +if [ "$1" == '--help' ]; then + echo "Usage: $0 [doxygen_2] " + echo "Compares the output of doxygen_1 and doxygen_2, " + echo "where doxygen_1 and doxygen_2 are valid paths to doxygen executables." + echo "If doxygen_2 is not specified, the master branch of doxygen will be cloned, built and used as doxygen_2." + exit 0 +fi +#build reference +PATH_TO_1=$1 +PATH_TO_2=$2 +IS_ARG2=1 +if [ -z $PATH_TO_2 ]; then + IS_ARG2=0 +fi + +if [ -z $PATH_TO_1 ] || [ $(basename $PATH_TO_1) != "doxygen" ] || [ ! -e $PATH_TO_1 ]; then + echo "Please specify a valid path to a doxygen executable." + echo "$0 --help for more information." + exit 0 +fi +mkdir ./build_doc +cd ./build_doc +cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null +make -j7 doc &> /dev/null +cd ../ +bash compare_testsuites.sh $PWD/build_doc/doc_output +mv ./doc_data ./doc_ref + +#download and build doxygen_master +if [ $IS_ARG2 == 0 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_TO_2 ]; then + echo "No path to doxygen master were detected. Cloning..." + mkdir doxygen_master + git clone https://github.com/doxygen/doxygen.git doxygen_master &> /dev/null + cd doxygen_master + mkdir build + cd build + cmake .. &> /dev/null + make &> /dev/null + cd ../.. + PATH_TO_2=../doxygen_master/build/bin/doxygen + echo "done." +fi +#build doc with doxygen master +cd ./build_doc +cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE=$PATH_TO_2 ../.. &> /dev/null +make -j7 doc &> /dev/null +cd ../ +bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_data +#clean-up +rm -rf ./build_doc +rm -rf ./doc_ref +rm -rf ./doc_data +if [ $IS_ARG2 == 0 ]; then + rm -rf ./doxygen_master +fi From 76553ec143f5a1df975677cd33b18fdf28085452 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 13 Feb 2017 16:39:00 +0100 Subject: [PATCH 08/26] Add date of creation in result.html --- Documentation/doc/scripts/compare_testsuites.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index 1efcee73542..79f6fcaf474 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -49,12 +49,13 @@ echo " " >> result.html echo " " >> result.html #if there is a diff, give a link to show it +DATE=`date +%Y-%m-%d` if [[ -s ./diff.txt ]] then - echo "

The documentation has changed ! See logs.
" >> result.html + echo "

$DATE : The documentation has changed ! See logs.
" >> result.html #else just say that everything is fine else - echo "

The documentation has not changed.

" >> result.html + echo "

$DATE : The documentation has not changed.

" >> result.html fi if [ "${FAILURES[0]}" != "" ]; then echo " Some packages encountered problems while being parsed :

" >> result.html From 98431f49971474fc2d1c34c589fec4967cbf038e Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 14 Feb 2017 12:26:53 +0100 Subject: [PATCH 09/26] Fix test_doxygen_versions.sh --- Documentation/doc/scripts/test_doxygen_versions.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/doc/scripts/test_doxygen_versions.sh b/Documentation/doc/scripts/test_doxygen_versions.sh index ba5faa4fffd..13fa8b93025 100644 --- a/Documentation/doc/scripts/test_doxygen_versions.sh +++ b/Documentation/doc/scripts/test_doxygen_versions.sh @@ -7,8 +7,8 @@ if [ "$1" == '--help' ]; then exit 0 fi #build reference -PATH_TO_1=$1 -PATH_TO_2=$2 +PATH_TO_1="$1" +PATH_TO_2="$2" IS_ARG2=1 if [ -z $PATH_TO_2 ]; then IS_ARG2=0 @@ -42,11 +42,13 @@ if [ $IS_ARG2 == 0 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_ echo "done." fi #build doc with doxygen master +rm -rf ./build_doc +mkdir build_doc cd ./build_doc -cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE=$PATH_TO_2 ../.. &> /dev/null +cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_2" ../.. &> /dev/null make -j7 doc &> /dev/null cd ../ -bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_data +bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref #clean-up rm -rf ./build_doc rm -rf ./doc_ref From 0be067d7c9781cdcd16e063a60ba67e7aaa761ee Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 15 Feb 2017 11:01:45 +0100 Subject: [PATCH 10/26] Add information about CGAL and doxygen versions. --- .../doc/scripts/compare_testsuites.sh | 13 ++++++---- .../doc/scripts/test_doxygen_versions.sh | 24 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index 79f6fcaf474..980c7900e51 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -12,7 +12,7 @@ DOC_REF="$2" #output in a new directory mkdir -p doc_data cd ./doc_data -if [ $# -gt 2 ]; then +if [ $# -gt 5 ]; then echo "too many arguments" exit 1 fi @@ -40,22 +40,25 @@ fi diff -u -N -w ./doc_data $DOC_REF > ./diff.txt #generate an html page showing the status of the diff +CGAL_VERSION=$3 +DATE=`date +%Y-%m-%d` echo "" > result.html echo "" >> result.html echo " " >> result.html echo " " >> result.html echo " Documentation Status" >> result.html echo " " >> result.html -echo " " >> result.html +echo " " >> result.html +echo "

Documentation Status of $CGAL_VERSION on $DATE

" >> result.html +echo "

Difference between Doxygen $4 and Doxygen $5: " >> result.html #if there is a diff, give a link to show it -DATE=`date +%Y-%m-%d` if [[ -s ./diff.txt ]] then - echo "

$DATE : The documentation has changed ! See logs.
" >> result.html + echo "

There are differences : See logs.
" >> result.html #else just say that everything is fine else - echo "

$DATE : The documentation has not changed.

" >> result.html + echo "

There is no difference.

" >> result.html fi if [ "${FAILURES[0]}" != "" ]; then echo " Some packages encountered problems while being parsed :

" >> result.html diff --git a/Documentation/doc/scripts/test_doxygen_versions.sh b/Documentation/doc/scripts/test_doxygen_versions.sh index 13fa8b93025..16726747786 100644 --- a/Documentation/doc/scripts/test_doxygen_versions.sh +++ b/Documentation/doc/scripts/test_doxygen_versions.sh @@ -1,14 +1,16 @@ #!/bin/bash if [ "$1" == '--help' ]; then - echo "Usage: $0 [doxygen_2] " - echo "Compares the output of doxygen_1 and doxygen_2, " + echo "Usage: $0 [doxygen_2] [CGAL_VERSION]" + echo "Compares the output of doxygen_1 and doxygen_2 of this CGAL version, " echo "where doxygen_1 and doxygen_2 are valid paths to doxygen executables." echo "If doxygen_2 is not specified, the master branch of doxygen will be cloned, built and used as doxygen_2." + echo "CGAL_VERSION is the name that will appear on the results page. Default is CGAL-{version in cmake generated VERSION}" exit 0 fi #build reference PATH_TO_1="$1" PATH_TO_2="$2" +CGAL_VERSION=$3 IS_ARG2=1 if [ -z $PATH_TO_2 ]; then IS_ARG2=0 @@ -19,6 +21,15 @@ if [ -z $PATH_TO_1 ] || [ $(basename $PATH_TO_1) != "doxygen" ] || [ ! -e $PATH_ echo "$0 --help for more information." exit 0 fi +#if no cgal version is specified, ask cmake" +if [ -n CGAL_VERSION ]; then + mkdir ./shallow_build + cd ./shallow_build + cmake ../../../.. &> /dev/null + CGAL_VERSION="CGAL-$(cat VERSION)" + cd .. + rm -rf ./shallow_build +fi mkdir ./build_doc cd ./build_doc cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null @@ -30,15 +41,14 @@ mv ./doc_data ./doc_ref #download and build doxygen_master if [ $IS_ARG2 == 0 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_TO_2 ]; then echo "No path to doxygen master were detected. Cloning..." - mkdir doxygen_master git clone https://github.com/doxygen/doxygen.git doxygen_master &> /dev/null cd doxygen_master mkdir build cd build cmake .. &> /dev/null - make &> /dev/null + make -j7 &> /dev/null cd ../.. - PATH_TO_2=../doxygen_master/build/bin/doxygen + PATH_TO_2="$PWD/doxygen_master/build/bin/doxygen" echo "done." fi #build doc with doxygen master @@ -48,7 +58,9 @@ cd ./build_doc cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_2" ../.. &> /dev/null make -j7 doc &> /dev/null cd ../ -bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref +DOXYGEN_1=$($PATH_TO_1 --version) +DOXYGEN_2=$($PATH_TO_2 --version) +bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref $CGAL_VERSION $DOXYGEN_1 $DOXYGEN_2 #clean-up rm -rf ./build_doc rm -rf ./doc_ref From a27436d393e6bdd54381fa5c6d87bafa92d3eac2 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 17 Feb 2017 17:07:52 +0100 Subject: [PATCH 11/26] Change testsuite.py to integrate a diff to the overview. --- Documentation/doc/scripts/testsuite.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Documentation/doc/scripts/testsuite.py b/Documentation/doc/scripts/testsuite.py index ffc64689fb6..6bdef902738 100755 --- a/Documentation/doc/scripts/testsuite.py +++ b/Documentation/doc/scripts/testsuite.py @@ -116,6 +116,7 @@ def main(): parser.add_argument('--publish', metavar='/path/to/publish', help='Specify this argument if the results should be published.') parser.add_argument('--doc-log-dir', default='.', metavar='/path/to/cgal/build/dir/doc_log', help='The path of the documentation logs.') parser.add_argument('--output-dir', default='.', metavar='/path/to/cgal/build/dir/doc_output', help='The path to the build documentation') + parser.add_argument('--diff', metavar='/path/to/diff', help='The path to the diff file.') parser.add_argument('--cgal-version', help='Path to a version.h file from the current release. If not specified use git hash instead.') parser.add_argument('--version-to-keep', help='indicates the number of release testsuites that should be kept at the publishing location.') parser.add_argument('--do-copy-results', action="store_true", help='Specify this argument if you want to copy the generated documentation into the publishing location.') @@ -135,7 +136,14 @@ def main(): title=d('#maintitle') title.text(title.text() + ' for ' + version_string) write_out_html(d, './index.html') - + + # does the diff exist ? + diff='n/a' + if args.diff: + diff_file=args.diff + if not os.path.isfile(diff_file): + sys.stderr.write('Diff file ' + diff_file + ' is not a file. Cannot diff.\n') + sys.exit(1) if args.publish: if args.publish.endswith('/'): publish_dir=args.publish @@ -156,6 +164,13 @@ def main(): with open(publish_dir + 'index.html') as f: pass except IOError as e: print('No index.html in the publish directory found. Writing a skeleton.') + shutil.copyfile(diff_file, publish_dir+'diff.txt') + with open(diff_file, 'r') as myfile: + diff=myfile.read() + if not diff: + diff='none' + else: + diff='See diff. ' with open(publish_dir + 'index.html', 'w') as f: f.write('''