forked from appcelerator-archive/kroll
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSConscript.docs
34 lines (30 loc) · 998 Bytes
/
SConscript.docs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
import os
import shutil
need_cygwin_hack = False
natural_docs = os.path.join(os.path.abspath('thirdparty'), 'all', 'NaturalDocs', 'NaturalDocs')
if not hasattr(os, 'uname'):
if os.path.exists('C:\\cygwin\\bin\\bash.exe'):
need_cygwin_hack = True
#cwd = os.path.abspath('.')
#cwd = cwd.replace('\\', '/')
natural_docs = '/'.join(['thirdparty', 'all', 'NaturalDocs', 'NaturalDocs'])
natural_docs = 'C:\\cygwin\\bin\\bash.exe -c "' + natural_docs
input_dirs = ['api']
output_dir = 'docs'
project_dir = '.naturalDocs'
def natural_docs_command(target,source,env):
args = [natural_docs]
args += ["-i"]
for d in source: args += [d.name]
args += ['-o', 'HTML', str(target[0])]
args += ['-p', project_dir]
print ' '.join(args), "\n"
os.mkdir('docs')
os.mkdir('.naturalDocs')
cmd = ' '.join(args)
if need_cygwin_hack: cmd += '"'
os.system(cmd)
shutil.rmtree('.naturalDocs')
env = Environment()
docs = env.Command(output_dir, input_dirs, natural_docs_command)