2
2
"""
3
3
4
4
from os .path import dirname , join
5
+ from os import sep
5
6
6
7
import subprocess
7
8
@@ -12,6 +13,7 @@ def generate_documentation(dirs, output_dir):
12
13
dirs - the directories that doxygen should scan for documentation
13
14
output_dir - location of the documentation after the return of this function
14
15
"""
16
+ print dirs
15
17
with open (join (dirname (__file__ ), "Doxyfile" )) as doxyfile :
16
18
proc = subprocess .Popen (["doxygen" , "-" ], stdin = subprocess .PIPE )
17
19
proc .stdin .write (doxyfile .read ())
@@ -32,17 +34,20 @@ def generate_documentation(dirs, output_dir):
32
34
toolchain = GCC_ARM (TARGET_MAP ["Super_Target" ])
33
35
resources = toolchain .scan_resources ("." )
34
36
for src in resources .headers :
35
- with open (src ) as fd :
36
- contents = fd .read ()
37
- with open (src , "w+" ) as fd :
38
- fd .write ("/** \\ addtogroup feature_mbed_os */\n /** @{{*/\n {:s}\n /** @}}*/\n " .format (contents ))
37
+ if len (src .split (sep )) > 2 :
38
+ name = src .split (sep )[1 ]
39
+ if name == "features" :
40
+ name = src .split (sep )[2 ]
41
+ with open (src ) as fd :
42
+ contents = fd .read ()
43
+ with open (src , "w+" ) as fd :
44
+ fd .write ("/** \\ addtogroup {:s} */\n /** @{{*/\n {:s}\n /** @}}*/\n " .format (name ,contents ))
39
45
for name , res in resources .features .iteritems ():
40
46
for src in res .headers :
41
47
with open (src ) as fd :
42
48
contents = fd .read ()
43
49
with open (src , "w+" ) as fd :
44
- fd .write ("/** \\ addtogroup feature_ {:s} */\n /** @{{*/\n {:s}\n /** @}}*/\n " .format (name . lower () ,contents ))
50
+ fd .write ("/** \\ addtogroup FEATURE_ {:s} */\n /** @{{*/\n {:s}\n /** @}}*/\n " .format (name ,contents ))
45
51
46
- generate_documentation (sum (map (lambda x :x .headers , resources .features .values ()), resources .headers ),
52
+ generate_documentation (filter ( lambda x : "targets" not in x , sum (map (lambda x :x .headers , resources .features .values ()), resources .headers ) ),
47
53
join (dirname (dirname (__file__ )), "mbed-docs" ))
48
- print resources
0 commit comments