summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Kenny <dragon512@live.com>2019-12-04 21:30:42 (GMT)
committerJason Kenny <dragon512@live.com>2019-12-04 21:30:54 (GMT)
commit3e039f1b101f7d52b333e1c5d7f75d3984ff0551 (patch)
treea9edbf594f870a3154c3724494b1d68c6c469843 /src
parenteb73aacd6c0beeb77a9e07c17dfbaef7fb54c42a (diff)
downloadSCons-3e039f1b101f7d52b333e1c5d7f75d3984ff0551.zip
SCons-3e039f1b101f7d52b333e1c5d7f75d3984ff0551.tar.gz
SCons-3e039f1b101f7d52b333e1c5d7f75d3984ff0551.tar.bz2
Allow Command to take more builder options
add to change log add documentation update test
Diffstat (limited to 'src')
-rwxr-xr-xsrc/CHANGES.txt3
-rw-r--r--src/engine/SCons/Environment.py13
-rw-r--r--src/engine/SCons/Environment.xml22
3 files changed, 32 insertions, 6 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 617b3d0..b42dd0a 100755
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -5,6 +5,9 @@
Change Log
RELEASE VERSION/DATE TO BE FILLED IN LATER
+ From Jason Kenny
+ - Update Command() function to accept target_scanner, source_factory, and target_factory arguments.
+ This make Command act more like a one-off builder.
From Philipp Maierhöfer:
- Avoid crash with UnicodeDecodeError on Python 3 when a Latex log file in
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 0e1102e..17d3250 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -1984,9 +1984,22 @@ class Base(SubstitutionEnvironment):
'target_factory' : self.fs.Entry,
'source_factory' : self.fs.Entry,
}
+ # source scanner
try: bkw['source_scanner'] = kw['source_scanner']
except KeyError: pass
else: del kw['source_scanner']
+ #target scanner
+ try: bkw['target_scanner'] = kw['target_scanner']
+ except KeyError: pass
+ else: del kw['target_scanner']
+ #source factory
+ try: bkw['source_factory'] = kw['source_factory']
+ except KeyError: pass
+ else: del kw['source_factory']
+ #target factory
+ try: bkw['target_factory'] = kw['target_factory']
+ except KeyError: pass
+ else: del kw['target_factory']
bld = SCons.Builder.Builder(**bkw)
return bld(self, target, source, **kw)
diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml
index 829bf12..a32d43d 100644
--- a/src/engine/SCons/Environment.xml
+++ b/src/engine/SCons/Environment.xml
@@ -937,19 +937,29 @@ for a single special-case build.
</para>
<para>
-As a special case, the
-<varname>source_scanner</varname>
-keyword argument can
+&b-Command; builder accepts
+<varname>source_scanner</varname>,
+<varname>target_scanner</varname>,
+<varname>source_factory</varname>, and
+<varname>target_factory</varname>
+keyword arguments. The *_scanner args can
be used to specify
a Scanner object
-that will be used to scan the sources.
-(The global
+that will be used to apply a custom
+scanner for a source or target.
+For example, the global
<literal>DirScanner</literal>
object can be used
if any of the sources will be directories
that must be scanned on-disk for
changes to files that aren't
-already specified in other Builder of function calls.)
+already specified in other Builder of function calls.
+The *_factory args take a factory function that the
+Command will use to turn any sources or targets
+specified as strings into SCons Nodes.
+See the sections "Builder Objects"
+below, for more information about how these
+args work in a Builder.
</para>
<para>