def generate_version_specific_includes(app): print("Generating version-specific includes...") version_tmpdir = '{}/version_inc'.format(builddir) if os.system('python ../gen-version-specific-includes.py {} {}'.format( app.config.language, version_tmpdir)): raise RuntimeError('gen-version-specific-includes.py failed') copy_if_modified(version_tmpdir, '{}/inc'.format(builddir))
def generate_version_specific_includes(app): print("Generating version-specific includes...") version_tmpdir = '{}/version_inc'.format(builddir) call_with_python('../gen-version-specific-includes.py {} {}'.format( app.config.language, version_tmpdir)) copy_if_modified(version_tmpdir, '{}/inc'.format(builddir))
def call_with_python(cmd): # using sys.executable ensures that the scripts are called with the same Python interpreter if os.system('{} {}'.format(sys.executable, cmd)) != 0: raise RuntimeError('{} failed'.format(cmd)) # Call Doxygen to get XML files from the header files print("Calling Doxygen to generate latest XML files") if os.system("doxygen ../Doxyfile") != 0: raise RuntimeError('Doxygen call failed') # Doxygen has generated XML files in 'xml' directory. # Copy them to 'xml_in', only touching the files which have changed. copy_if_modified('xml/', 'xml_in/') # Generate 'api_name.inc' files using the XML files by Doxygen call_with_python('../gen-dxd.py') def find_component_files(parent_dir, target_filename): parent_dir = os.path.abspath(parent_dir) result = [] component_files = dict() for (dirpath, dirnames, filenames) in os.walk(parent_dir): try: # note: trimming "examples" dir as MQTT submodule # has its own examples directory in the submodule, not part of IDF
def call_with_python(cmd): # using sys.executable ensures that the scripts are called with the same Python interpreter if os.system('{} {}'.format(sys.executable, cmd)) != 0: raise RuntimeError('{} failed'.format(cmd)) # Call Doxygen to get XML files from the header files print("Calling Doxygen to generate latest XML files") if os.system("doxygen ../Doxyfile") != 0: raise RuntimeError('Doxygen call failed') # Doxygen has generated XML files in 'xml' directory. # Copy them to 'xml_in', only touching the files which have changed. copy_if_modified('xml/', 'xml_in/') # Generate 'api_name.inc' files using the XML files by Doxygen call_with_python('../gen-dxd.py') # http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format # suppress_warnings = ['image.nonlocal_uri'] # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) from local_util import run_cmd_get_output, copy_if_modified builddir = '_build' if 'BUILDDIR' in os.environ: builddir = os.environ['BUILDDIR'] # Call Doxygen to get XML files from the header files print "Calling Doxygen to generate latest XML files" os.system("doxygen ../Doxyfile") # Doxygen has generated XML files in 'xml' directory. # Copy them to 'xml_in', only touching the files which have changed. copy_if_modified('xml/', 'xml_in/') # Generate 'api_name.inc' files using the XML files by Doxygen os.system('python ../gen-dxd.py') # Generate 'kconfig.inc' file from components' Kconfig files kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir) os.system('python ../gen-kconfig-doc.py > ' + kconfig_inc_path + '.in') copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path) # http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format # suppress_warnings = ['image.nonlocal_uri'] # -- General configuration ------------------------------------------------
def generate_version_specific_includes(app): print("Generating version-specific includes...") version_tmpdir = '{}/version_inc'.format(builddir) call_with_python('../gen-version-specific-includes.py {} {}'.format(app.config.language, version_tmpdir)) copy_if_modified(version_tmpdir, '{}/inc'.format(builddir))
except KeyError: idf_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) def call_with_python(cmd): # using sys.executable ensures that the scripts are called with the same Python interpreter if os.system('{} {}'.format(sys.executable, cmd)) != 0: raise RuntimeError('{} failed'.format(cmd)) # Call Doxygen to get XML files from the header files print("Calling Doxygen to generate latest XML files") if os.system("doxygen ../Doxyfile") != 0: raise RuntimeError('Doxygen call failed') # Doxygen has generated XML files in 'xml' directory. # Copy them to 'xml_in', only touching the files which have changed. copy_if_modified('xml/', 'xml_in/') # Generate 'api_name.inc' files using the XML files by Doxygen call_with_python('../gen-dxd.py') # Generate 'kconfig.inc' file from components' Kconfig files print("Generating kconfig.inc from kconfig contents") kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir) temp_sdkconfig_path = '{}/sdkconfig.tmp'.format(builddir) # note: trimming "examples" dir from KConfig/KConfig.projbuild as MQTT submodule # has its own examples in the submodule. kconfigs = subprocess.check_output(["find", "../../components", "-name", "examples", "-prune", "-o", "-name", "Kconfig", "-print"]).decode() kconfig_projbuilds = subprocess.check_output(["find", "../../components", "-name", "examples", "-prune",
def call_with_python(cmd): # using sys.executable ensures that the scripts are called with the same Python interpreter if os.system('{} {}'.format(sys.executable, cmd)) != 0: raise RuntimeError('{} failed'.format(cmd)) # Call Doxygen to get XML files from the header files print("Calling Doxygen to generate latest XML files") if os.system("doxygen ../Doxyfile") != 0: raise RuntimeError('Doxygen call failed') # Doxygen has generated XML files in 'xml' directory. # Copy them to 'xml_in', only touching the files which have changed. copy_if_modified('xml/', 'xml_in/') # Generate 'api_name.inc' files using the XML files by Doxygen call_with_python('../gen-dxd.py') # Generate 'kconfig.inc' file from components' Kconfig files print("Generating kconfig.inc from kconfig contents") kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir) temp_sdkconfig_path = '{}/sdkconfig.tmp'.format(builddir) # note: trimming "examples" dir from KConfig/KConfig.projbuild as MQTT submodule # has its own examples in the submodule. kconfigs = subprocess.check_output([ "find", "../../components", "-name", "examples", "-prune", "-o", "-name", "Kconfig", "-print" ]).decode() kconfig_projbuilds = subprocess.check_output([