From d2ac0761b978215d2006c4bf892bfb8b2a42172d Mon Sep 17 00:00:00 2001 From: grbd Date: Sun, 15 Apr 2018 12:15:48 +0100 Subject: Added in support for Sconstruct.py --- doc/design/native.xml | 5 +++-- doc/man/scons.xml | 4 ++++ doc/scons.mod | 1 + src/CHANGES.txt | 2 +- src/engine/SCons/Script/Main.py | 2 +- test/SConstruct.py | 9 +++++++++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/doc/design/native.xml b/doc/design/native.xml index 1329817..97d5831 100644 --- a/doc/design/native.xml +++ b/doc/design/native.xml @@ -64,8 +64,9 @@ By default, the &SCons; utility searches for a file named - &SConstruct;, &Sconstruct;, &sconstruct;, &SConstruct.py or &sconstruct.py; (in that order) in the - current directory, and reads its configuration from the first file + &SConstruct;, &Sconstruct;, &sconstruct;, &SConstruct.py, &Sconstruct.py + or &sconstruct.py; (in that order) in the current directory, + and reads its configuration from the first file found. A command-line option exists to read a different file name. diff --git a/doc/man/scons.xml b/doc/man/scons.xml index cd6541b..abbed4f 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -107,6 +107,7 @@ searches for a file named Sconstruct, sconstruct, SConstruct.py +Sconstruct.py or sconstruct.py (in that order) in the current directory and reads its @@ -639,6 +640,7 @@ before searching for the Sconstruct, sconstruct, SConstruct.py +Sconstruct.py or sconstruct.py file, or doing anything @@ -655,6 +657,7 @@ except that it will search for Sconstruct, sconstruct, SConstruct.py +Sconstruct.py or sconstruct.py in the specified directory.) @@ -1667,6 +1670,7 @@ scons --tree=all,prune,status target Sconstruct , sconstruct , SConstruct.py +Sconstruct.py or sconstruct.py file is found, and uses that diff --git a/doc/scons.mod b/doc/scons.mod index 1d207c9..974ec02 100644 --- a/doc/scons.mod +++ b/doc/scons.mod @@ -138,6 +138,7 @@ Sconstruct"> sconstruct"> SConstruct.py"> +Sconstruct.py"> sconstruct.py"> .sconsign"> src"> diff --git a/src/CHANGES.txt b/src/CHANGES.txt index be4e0dd..093c628 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,7 +8,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Richard West: - - Add SConstruct.py and sconstruct.py to the search path for the root SConstruct file. + - Add SConstruct.py, Sconstruct.py, sconstruct.py to the search path for the root SConstruct file. Allows easier debugging within Visual Studio From Bernard Blackham: diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 18c493c..923ef1e 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -623,7 +623,7 @@ def _SConstruct_exists(dirname='', repositories=[], filelist=None): current directory. """ if not filelist: - filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'sconstruct.py'] + filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py'] for file in filelist: sfile = os.path.join(dirname, file) if os.path.isfile(sfile): diff --git a/test/SConstruct.py b/test/SConstruct.py index 3cf1c02..8bc8617 100644 --- a/test/SConstruct.py +++ b/test/SConstruct.py @@ -48,6 +48,15 @@ test.run(arguments = ".", stdout = test.wrap_stdout(read_str = 'sconstruct.py %s\n' % wpath, build_str = "scons: `.' is up to date.\n")) +test.write('Sconstruct.py', """ +import os +print("sconstruct.py "+os.getcwd()) +""") + +test.run(arguments = ".", + stdout = test.wrap_stdout(read_str = 'sconstruct.py %s\n' % wpath, + build_str = "scons: `.' is up to date.\n")) + test.write('SConstruct.py', """ import os print("SConstruct.py "+os.getcwd()) -- cgit v0.12