summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2020-06-30 19:33:34 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2020-06-30 19:33:34 (GMT)
commitf2fb4bb5449c1375c0cbde5d15f674a168f2b3bf (patch)
treeefd80e2bc07bcc19547a4d58eea5d4e8db8c9214
parent073c5a23eb8505f68c5d70b92e8a0098d03158d8 (diff)
downloadSCons-f2fb4bb5449c1375c0cbde5d15f674a168f2b3bf.zip
SCons-f2fb4bb5449c1375c0cbde5d15f674a168f2b3bf.tar.gz
SCons-f2fb4bb5449c1375c0cbde5d15f674a168f2b3bf.tar.bz2
API doc builds working now. Generating SCons/__versioninfo.py but not yet using it
-rw-r--r--SConstruct1
-rw-r--r--doc/Makefile2
-rw-r--r--doc/SConscript7
-rw-r--r--doc/sphinx/conf.py9
-rw-r--r--requirements.txt1
-rw-r--r--site_scons/site_init.py1
-rw-r--r--site_scons/update_build_info.py13
-rw-r--r--template/__init__.py40
8 files changed, 64 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct
index f7b4378..61c91d3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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)
#
#
#
diff --git a/doc/Makefile b/doc/Makefile
index 76f4228..87c9643 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -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
diff --git a/doc/SConscript b/doc/SConscript
index bc3fb19..cebb9bd 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -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)
diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py
index 7cbd208..91b511d 100644
--- a/doc/sphinx/conf.py
+++ b/doc/sphinx/conf.py
@@ -39,6 +39,7 @@ extensions = [
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
+ 'rst2pdf.pdfbuilder',
]
autosummary_generate = True
@@ -142,7 +143,7 @@ htmlhelp_basename = 'SConsAPIDocs'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
- 'papersize': 'letterpaper',
+ # 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
@@ -201,3 +202,9 @@ texinfo_documents = [
# -- 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'),]
diff --git a/requirements.txt b/requirements.txt
index 70308fd..cc94763 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,3 +7,4 @@ readme-renderer
sphinx
sphinx_rtd_theme
lxml==4.5.0
+rst2pdf \ No newline at end of file
diff --git a/site_scons/site_init.py b/site_scons/site_init.py
index 2205781..d55a9f8 100644
--- a/site_scons/site_init.py
+++ b/site_scons/site_init.py
@@ -7,6 +7,7 @@ from soe_utils import soelim, soscan, soelimbuilder
# 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')
diff --git a/site_scons/update_build_info.py b/site_scons/update_build_info.py
new file mode 100644
index 0000000..f1c5468
--- /dev/null
+++ b/site_scons/update_build_info.py
@@ -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()],
+ )
diff --git a/template/__init__.py b/template/__init__.py
index 1399f0b..56d6e4a 100644
--- a/template/__init__.py
+++ b/template/__init__.py
@@ -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
@@ -27,9 +50,16 @@ XXX
# 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