diff options
author | Simon Warta <[email protected]> | 2017-04-01 15:15:10 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-04-02 21:51:55 +0200 |
commit | 0382427d0eeebbc46acb63389ba58f1ce710f133 (patch) | |
tree | 8c52ef8fa33bc22cc3e1d66ec6203be644b174ff | |
parent | d4a02ac3ccabeb7dfebc62ae855414643b405d3c (diff) |
Pull make_build_doc_commands out of BuildConfigurationInformation
-rwxr-xr-x | configure.py | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/configure.py b/configure.py index 34beec738..bfa2ca43c 100755 --- a/configure.py +++ b/configure.py @@ -155,31 +155,6 @@ class BuildConfigurationInformation(object): self.python_dir = os.path.join(options.src_dir, 'python') - def build_doc_commands(): - - def get_doc_cmd(): - if options.with_sphinx: - sphinx = 'sphinx-build -c $(SPHINX_CONFIG) $(SPHINX_OPTS) ' - if options.quiet: - sphinx += '-q ' - sphinx += '%s %s' - return sphinx - else: - return '$(COPY) %s' + os.sep + '*.rst %s' - - doc_cmd = get_doc_cmd() - - def cmd_for(src): - return doc_cmd % (os.path.join(self.doc_dir, src), - os.path.join(self.doc_output_dir, src)) - - yield cmd_for('manual') - - if options.with_doxygen: - yield 'doxygen %s%sbotan.doxy' % (self.build_dir, os.sep) - - self.build_doc_commands = '\n'.join(['\t' + s for s in build_doc_commands()]) - def build_dirs(self): out = [ self.libobj_dir, @@ -206,6 +181,25 @@ class BuildConfigurationInformation(object): return 'botan-%d.pc' % (Version.major) +def make_build_doc_commands(build_paths, options): + def build_manual_command(src_dir, dst_dir): + if options.with_sphinx: + sphinx = 'sphinx-build -c $(SPHINX_CONFIG) $(SPHINX_OPTS) ' + if options.quiet: + sphinx += '-q ' + sphinx += '%s %s' % (src_dir, dst_dir) + return sphinx + else: + return '$(COPY) %s%s*.rst %s' % (src_dir, os.sep, dst_dir) + + cmds = [ + build_manual_command(os.path.join(build_paths.doc_dir, 'manual'), build_paths.doc_output_dir_manual) + ] + if options.with_doxygen: + cmds += ['doxygen %s%sbotan.doxy' % (build_paths.build_dir, os.sep)] + return '\n'.join(['\t' + cmd for cmd in cmds]) + + def process_command_line(args): # pylint: disable=too-many-locals """ Handle command line options @@ -1648,7 +1642,7 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): 'doc_output_dir': build_config.doc_output_dir, - 'build_doc_commands': build_config.build_doc_commands, + 'build_doc_commands': make_build_doc_commands(build_config, options), 'python_dir': build_config.python_dir, 'sphinx_config_dir': os.path.join(options.build_data, 'sphinx'), |