docs
DEPENDS docs-cpp docs-java docs-python gen-options
COMMAND
- ${SPHINX_EXECUTABLE} -b html -c ${CMAKE_CURRENT_BINARY_DIR}
+ ${SPHINX_EXECUTABLE} -v -b html -c ${CMAKE_CURRENT_BINARY_DIR}
# Tell Breathe where to find the Doxygen output
-Dbreathe_projects.cvc5=${CPP_DOXYGEN_XML_DIR}
-Dbreathe_projects.std=${CPP_DOXYGEN_XML_DIR} ${SPHINX_INPUT_DIR}
--source-path ${CMAKE_SOURCE_DIR}/src/api/java/
-d ${JAVADOC_OUTPUT_DIR}
-cp ${CMAKE_BINARY_DIR}/src/api/java/cvc5.jar
+ -notimestamp
DEPENDS cvc5jar ${SOURCES}
COMMENT "Generating javadocs"
)
Java API Documentation
======================
-This file is just a placeholder that is replaced by javadocs index.html
\ No newline at end of file
+This documentation was built while Java bindings were disabled. This part of the documentation is empty. Please enable :code:`BUILD_BINDINGS_JAVA` in :code:`cmake` and build the documentation again.
html_css_files = ['custom.css']
html_show_sourcelink = False
-html_extra_path = [
- "${CMAKE_BINARY_DIR}/docs/api/java/build/"
-]
+html_extra_path = []
-# -- Breathe configuration ---------------------------------------------------
+# -- C++ / Breathe configuration ---------------------------------------------
breathe_default_project = "cvc5"
breathe_domain_by_extension = {"h" : "cpp"}
cpp_index_common_prefix = ["cvc5::api::"]
# where to look for include-build-file
ibf_folders = ['${CMAKE_CURRENT_BINARY_DIR}']
+
+# -- Java configuration ------------------------------------------------------
+if tags.has('bindings_java'):
+ html_extra_path.append('${CMAKE_BINARY_DIR}/docs/api/java/build/')
+
+
# -- SMT-LIB syntax highlighting ---------------------------------------------
from smtliblexer import SmtLibLexer
from sphinx.highlighting import lexers
import os
from docutils import nodes
-from docutils.parsers.rst import Directive
from docutils.statemachine import StringList
+from sphinx.util import logging
+from sphinx.util.docutils import SphinxDirective
-class APIExamples(Directive):
+class APIExamples(SphinxDirective):
"""Add directive `api-examples` to be used as follows:
.. api-examples::
# The "arguments" are actually the content of the directive
has_content = True
+ logger = logging.getLogger(__name__)
+
def run(self):
+ self.state.document.settings.env.note_dependency(__file__)
# collect everything in a list of strings
content = ['.. tabs::', '']
+ remaining = set(self.exts.keys())
+ location = '{}:{}'.format(*self.get_source_info())
+
for file in self.content:
# detect file extension
_, ext = os.path.splitext(file)
if ext in self.exts:
title = self.exts[ext]['title']
lang = self.exts[ext]['lang']
+ remaining.remove(ext)
else:
+ self.logger.warning(f'{location} is using unknown file extension "{ext}"')
title = ext
lang = ext
content.append(f' :language: {lang}')
content.append(f' :linenos:')
+ for r in remaining:
+ self.logger.warning(f'{location} has no {r} example!')
+
# parse the string list
node = nodes.Element()
self.state.nested_parse(StringList(content), 0, node)
has_content = True
def run(self):
+ self.state.document.settings.env.note_dependency(__file__)
filename = ''.join(self.content)
for folder in self.env.config.ibf_folders:
candidate = os.path.join(folder, filename)
# Installation based on https://bloerg.net/2012/11/10/cmake-and-distutils.html
# Create a wrapper python directory and generate a distutils setup.py file
configure_file(setup.py.in setup.py)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pycvc5/__init__.py
-"import sys
-from .pycvc5 import *
-# fake a submodule for dotted imports, e.g. from pycvc5.kinds import *
-sys.modules['%s.%s'%(__name__, kinds.__name__)] = kinds")
+configure_file(__init__.py.in pycvc5/__init__.py)
# figure out if we're in a virtualenv
execute_process(OUTPUT_VARIABLE IN_VIRTUALENV
--- /dev/null
+import sys
+from .pycvc5 import *
+# fake a submodule for dotted imports, e.g. from pycvc5.kinds import *
+sys.modules['%s.%s'%(__name__, kinds.__name__)] = kinds
( get-unsat-core )
- Requires to enable option :ref:`produce-unsat-cores <lbl-produce-unsat-cores>`.
+ Requires to enable option :ref:`produce-unsat-cores <lbl-option-produce-unsat-cores>`.
:return: a set of terms representing the unsatisfiable core
"""