Skip to content

Commit

Permalink
Add "hackingdoc" as proper action and remove non-working --hackingdoc…
Browse files Browse the repository at this point in the history
… option
  • Loading branch information
eht16 committed Aug 29, 2014
1 parent 15c2faf commit 985cd91
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions wscript
Expand Up @@ -343,9 +343,6 @@ def options(opt):
help='documentation root', dest='docdir')
opt.add_option('--libdir', type='string', default='',
help='object code libraries', dest='libdir')
# Actions
opt.add_option('--hackingdoc', action='store_true', default=False,
help='generate HTML documentation from HACKING file', dest='hackingdoc')


def build(bld):
Expand Down Expand Up @@ -690,6 +687,17 @@ def apidoc(ctx):
os.chdir('..')


def hackingdoc(ctx):
"""generate HACKING documentation"""
os.chdir('doc')
Logs.pprint('CYAN', 'Generating HACKING documentation')
cmd = _find_rst2html(ctx)
ret = ctx.exec_command('%s -stg --stylesheet=geany.css %s %s' % (cmd, '../HACKING', 'hacking.html'))

This comment has been minimized.

Copy link
@codebrainz

codebrainz Aug 29, 2014

Member

Won't these ../HACKING and geany.css paths cause problems without out-of-tree builds? I don't know if waf even supports that, but if so, I think this might break it. If it has a paths like $top_srcdir and $srcdir in Autotools, it could maybe use like:

ret = ctx.exec_command('%s -stg --stylesheet=%s %s %s' % (
    cmd,
    os.path.join(srcdir, 'geany.css'),
    os.path.join(top_srcdir, 'HACKING'),
    'hacking.html'))

This comment has been minimized.

Copy link
@eht16

eht16 Aug 29, 2014

Author Member

Probably, yeah.
I rewrote the code in f219ea1 a bit to use ctx.top_dir and ctx.out_dir which should be better. These attributes are resolved to absolute paths by Waf, so I'm tempted to rely on these :).

if ret != 0:
raise WafError('Generating HACKING documentation failed')
os.chdir('..')


def _find_program(ctx, cmd, **kw):
def noop(*args):
pass
Expand Down

0 comments on commit 985cd91

Please sign in to comment.