Skip to content

Commit

Permalink
API doc builds working now. Generating SCons/__versioninfo.py but not…
Browse files Browse the repository at this point in the history
… yet using it
  • Loading branch information
bdbaddog committed Jun 30, 2020
1 parent 073c5a2 commit f2fb4bb
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 10 deletions.
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Version_values = [Value(command_line.version), Value(command_line.build_id)]

installed_local_files = create_local_packages(env)

update_init_file(env)
#
#
#
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DOCTREES = ../build/doc/api
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile rinoh
.PHONY: help Makefile


# Catch-all target: route all unknown targets to Sphinx using the new
Expand Down
7 changes: 4 additions & 3 deletions doc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -511,16 +511,17 @@ else:
if not skip_doc:
# Build API DOCS
# TODO: Better specify dependencies on source files
pdf_file = env.Command('#/build/doc/api/latex/SConsAPIDocs.pdf',
pdf_file = env.Command('#/build/doc/api/scons-api.pdf',
env.Glob('#/SCons/*'),
"cd doc && make latexpdf")
[Delete("#/build/doc/api"),
"cd doc && make pdf"])
pdf_install = os.path.join(build, 'PDF', 'scons-api.pdf')
env.InstallAs(pdf_install, pdf_file)
tar_deps.append(pdf_install)
tar_list.append(pdf_install)

htmldir = os.path.join(build, 'HTML', 'scons-api')
html_files = env.Command('#/build/doc/api/html/index.html',
html_files = env.Command('#/build/doc/HTML/scons-api/index.html',
env.Glob('#/SCons/*'),
"cd doc && make dirhtml BUILDDIR=${HTMLDIR}",
HTMLDIR=htmldir)
Expand Down
9 changes: 8 additions & 1 deletion doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
'rst2pdf.pdfbuilder',
]

autosummary_generate = True
Expand Down Expand Up @@ -142,7 +143,7 @@
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
'papersize': 'letterpaper',
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
Expand Down Expand Up @@ -201,3 +202,9 @@

# -- Options for Epub output -------------------------------------------------



# -- for PDF
# Grouping the document tree into PDF files. List of tuples
# (source start file, target name, title, author, options).
pdf_documents = [('index', u'scons-api', u'SCons API Docs', u'SCons Project'),]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ readme-renderer
sphinx
sphinx_rtd_theme
lxml==4.5.0
rst2pdf
1 change: 1 addition & 0 deletions site_scons/site_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# from epydoc import epydoc_cli, epydoc_commands
from BuildCommandLine import BuildCommandLine
from scons_local_package import install_local_package_files, create_local_packages
from update_build_info import update_init_file

gzip = whereis('gzip')
git = os.path.exists('.git') and whereis('git')
Expand Down
13 changes: 13 additions & 0 deletions site_scons/update_build_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def update_init_file(env):
substitutions = {
'__VERSION__': env['VERSION'],
"__COPYRIGHT__": env['COPYRIGHT'],
"__DEVELOPER__": env['DEVELOPER'],
"__DATE__": env['DATE'],
"__BUILDSYS__": env['BUILDSYS'],
"__REVISION__": env['REVISION'],
"__BUILD__": env['BUILD'],
}
env.Textfile('#SCons/__versioninfo.py',
["%s=%s"%(k,v) for k,v in substitutions.items()],
)
40 changes: 35 additions & 5 deletions template/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
"""${subst '/' '.' ${subst '^src/' '' ${subst '/[^/]*$' '' $filename}}}
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

"""SCons
XXX
The main package for the SCons software construction utility.
"""

#
# __COPYRIGHT__
#
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
Expand All @@ -27,9 +50,16 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"

__revision__ = "__REVISION__"
__version__ = "__VERSION__"
__build__ = "__BUILD__"
__buildsys__ = "__BUILDSYS__"
__date__ = "__DATE__"
__developer__ = "__DEVELOPER__"
__copyright__ = "__COPYRIGHT__"

# make sure compatibility is always in place
import SCons.compat

# Local Variables:
# tab-width:4
Expand Down

0 comments on commit f2fb4bb

Please sign in to comment.