summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-02-08 16:45:15 (GMT)
committerMats Wichmann <mats@linux.com>2019-02-08 16:54:40 (GMT)
commitde01f7ea3cd258c893e1262800b96dd85ae89133 (patch)
tree2fccbc839f100a05c36c8c6660071d733b89c8cf
parent9f090132091e56c123262106f3563142787c2fcf (diff)
downloadSCons-de01f7ea3cd258c893e1262800b96dd85ae89133.zip
SCons-de01f7ea3cd258c893e1262800b96dd85ae89133.tar.gz
SCons-de01f7ea3cd258c893e1262800b96dd85ae89133.tar.bz2
Add textfile tool to defaults
PR #3242 added the Textfile and Substfile builders to the default builder list (for issue #3147), but didn't finish the job: the textfile tool needs to be added to the default list of tools as well. This time with a testcase that fails if the tool is not added. Minor doc tweak. Signed-off-by: Mats Wichmann <mats@linux.com>
-rw-r--r--doc/generated/builders.gen4
-rw-r--r--doc/generated/functions.gen4
-rwxr-xr-xsrc/CHANGES.txt1
-rw-r--r--src/engine/SCons/Tool/__init__.py2
-rw-r--r--src/engine/SCons/Tool/textfile.xml4
-rw-r--r--test/textfile.py4
6 files changed, 14 insertions, 5 deletions
diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen
index 6f03cd3..dc05443 100644
--- a/doc/generated/builders.gen
+++ b/doc/generated/builders.gen
@@ -2377,7 +2377,7 @@ and the result replaces the key.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
-env = Environment(tools = ['default', 'textfile'])
+env = Environment(tools=['default'])
env['prefix'] = '/usr/bin'
script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'}
@@ -2404,7 +2404,7 @@ env.Substfile('bar.in', SUBST_DICT = good_bar)
# the SUBST_DICT may be in common (and not an override)
substutions = {}
-subst = Environment(tools = ['textfile'], SUBST_DICT = substitutions)
+subst = Environment(tools=['textfile'], SUBST_DICT=substitutions)
substitutions['@foo@'] = 'foo'
subst['SUBST_DICT']['@bar@'] = 'bar'
subst.Substfile('pgm1.c', [Value('#include "@foo@.h"'),
diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen
index 617a0a4..9fc9d4b 100644
--- a/doc/generated/functions.gen
+++ b/doc/generated/functions.gen
@@ -1197,6 +1197,10 @@ Multiple calls to
<function xmlns="http://www.scons.org/dbxsd/v1.0">Default</function>
are legal,
and add to the list of default targets.
+As noted above, both forms of this call affect the
+same global list of default targets; the
+construction environment method applies
+construction variable expansion to the targets.
</para>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 8bdafe7..654b58c 100755
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -23,6 +23,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
From Mats Wichmann:
- Quiet open file ResourceWarnings on Python >= 3.6 caused by
not using a context manager around Popen.stdout
+ - Add the textfile tool to the default tool list
RELEASE 3.0.4 - Mon, 20 Jan 2019 22:49:27 +0000
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index f3f0630..74dba75 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -1305,6 +1305,8 @@ def tool_list(platform, env):
'tex', 'latex', 'pdflatex', 'pdftex',
# Archivers
'tar', 'zip',
+ # File builders (text)
+ 'textfile',
], env)
tools = ([linker, c_compiler, cxx_compiler,
diff --git a/src/engine/SCons/Tool/textfile.xml b/src/engine/SCons/Tool/textfile.xml
index 08bbb76..3b4a038 100644
--- a/src/engine/SCons/Tool/textfile.xml
+++ b/src/engine/SCons/Tool/textfile.xml
@@ -147,7 +147,7 @@ and the result replaces the key.
</para>
<example_commands>
-env = Environment(tools = ['default', 'textfile'])
+env = Environment(tools=['default'])
env['prefix'] = '/usr/bin'
script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'}
@@ -174,7 +174,7 @@ env.Substfile('bar.in', SUBST_DICT = good_bar)
# the SUBST_DICT may be in common (and not an override)
substutions = {}
-subst = Environment(tools = ['textfile'], SUBST_DICT = substitutions)
+subst = Environment(tools=['textfile'], SUBST_DICT=substitutions)
substitutions['@foo@'] = 'foo'
subst['SUBST_DICT']['@bar@'] = 'bar'
subst.Substfile('pgm1.c', [Value('#include "@foo@.h"'),
diff --git a/test/textfile.py b/test/textfile.py
index 46eee34..1d5b3c7 100644
--- a/test/textfile.py
+++ b/test/textfile.py
@@ -115,6 +115,8 @@ test.write('foo2a.txt', foo2aText)
test.write('bar2a.txt', foo2aText)
check_times()
+# now that textfile is part of default tool list, run one testcase
+# without adding it explicitly as a tool to make sure.
test.write('SConstruct', """
textlist = ['This line has no substitutions',
'This line has @subst@ substitutions',
@@ -125,7 +127,7 @@ sub1 = { '@subst@' : 'most' }
sub2 = { '%subst%' : 'many' }
sub3 = { '@subst@' : 'most' , '%subst%' : 'many' }
-env = Environment(tools = ['textfile'])
+env = Environment()
t = env.Textfile('text', textlist)
# no substitutions