summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2019-12-06 23:11:07 (GMT)
committerGitHub <noreply@github.com>2019-12-06 23:11:07 (GMT)
commit0bb6513283d109447974d907617bb31c3fa763b3 (patch)
treee91acdc8b77919c48cb4681092645abb7c451340 /src
parent714d2c0baf5573c32bf709f3d252496c2359b345 (diff)
parent16f42198ba3afe2e40b21c5627274fec48c8611e (diff)
downloadSCons-0bb6513283d109447974d907617bb31c3fa763b3.zip
SCons-0bb6513283d109447974d907617bb31c3fa763b3.tar.gz
SCons-0bb6513283d109447974d907617bb31c3fa763b3.tar.bz2
Merge pull request #3129 from dragon512/update-command
Allow Command to take more builder options
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 e24555d..a5a37b8 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 Edoardo Bezzeccheri
- Added debug option "action_timestamps" which outputs to stdout the absolute start and end time for each target.
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 1296f54..4a9cf11 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -1987,9 +1987,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 516505c..48cf3ae 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>