summaryrefslogtreecommitdiff
path: root/engine/SCons/Tool/__init__.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-14 15:56:14 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-14 15:56:14 +0100
commit0d31d7cdc6ebdbaff868a8a03690afe1a8e8a4db (patch)
tree42e1a6f9b34cfcb4f2908d27506ebb78c1e36198 /engine/SCons/Tool/__init__.py
parent5ed7f9cf4e33468b3b75e057db461b30a81febe4 (diff)
parente18cb63b889697e54fe06be3eef8889b39f9fb4b (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'engine/SCons/Tool/__init__.py')
-rw-r--r--engine/SCons/Tool/__init__.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/engine/SCons/Tool/__init__.py b/engine/SCons/Tool/__init__.py
index 9265b81..2be4c57 100644
--- a/engine/SCons/Tool/__init__.py
+++ b/engine/SCons/Tool/__init__.py
@@ -35,7 +35,7 @@ tool definition.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Tool/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
import imp
import importlib
@@ -222,8 +222,10 @@ class Tool(object):
# Don't reload a tool we already loaded.
sys_modules_value = sys.modules.get(found_name,False)
+
+ found_module = None
if sys_modules_value and sys_modules_value.__file__ == spec.origin:
- return sys.modules[found_name]
+ found_module = sys.modules[found_name]
else:
# Not sure what to do in the case that there already
# exists sys.modules[self.name] but the source file is
@@ -235,7 +237,11 @@ class Tool(object):
# If we found it in SCons.Tool, then add it to the module
setattr(SCons.Tool, self.name, module)
- return module
+ found_module = module
+
+ if found_module is not None:
+ sys.path = oldpythonpath
+ return found_module
sys.path = oldpythonpath
@@ -907,8 +913,16 @@ def createCFileBuilders(env):
# Create common Java builders
def CreateJarBuilder(env):
+ """The Jar builder expects a list of class files
+ which it can package into a jar file.
+
+ The jar tool provides an interface for passing other types
+ of java files such as .java, directories or swig interfaces
+ and will build them to class files in which it can package
+ into the jar.
+ """
try:
- java_jar = env['BUILDERS']['Jar']
+ java_jar = env['BUILDERS']['JarFile']
except KeyError:
fs = SCons.Node.FS.get_default_fs()
jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')
@@ -917,7 +931,7 @@ def CreateJarBuilder(env):
src_suffix = '$JAVACLASSSUFFIX',
src_builder = 'JavaClassFile',
source_factory = fs.Entry)
- env['BUILDERS']['Jar'] = java_jar
+ env['BUILDERS']['JarFile'] = java_jar
return java_jar
def CreateJavaHBuilder(env):