diff options
-rw-r--r-- | src/CHANGES.txt | 1 | ||||
-rw-r--r-- | src/engine/SCons/Tool/JavaCommon.py | 5 | ||||
-rw-r--r-- | test/Java/JAR.py | 4 | ||||
-rw-r--r-- | test/Java/JARCHDIR.py | 3 | ||||
-rw-r--r-- | test/Java/JARFLAGS.py | 4 | ||||
-rw-r--r-- | test/Java/source-files.py | 4 |
6 files changed, 20 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 62e0cea..162de48 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -51,6 +51,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - Fix Java tools to search reasonable default paths for Win32, Linux, macOS. Add required paths for swig and java native interface to JAVAINCLUDES. You should add these to your CPPPATH if you need to compile with them. This handles spaces in paths in default Java paths on windows. + - Fix new logic which populates JAVAINCLUDES to handle the case where javac is not found. - Fix GH Issue #3225 SCons.Util.Flatten() doesn't handle MappingView's produced by dictionary as return values from dict().{items(), keys(), values()}. diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py index 3a472a9..ba74386 100644 --- a/src/engine/SCons/Tool/JavaCommon.py +++ b/src/engine/SCons/Tool/JavaCommon.py @@ -437,7 +437,10 @@ def get_java_include_paths(env, javac, version): :return: """ paths = [] - if env['PLATFORM'] == 'win32': + if not javac: + # there are no paths if we've not detected javac. + pass + elif env['PLATFORM'] == 'win32': javac_bin_dir = os.path.dirname(javac) java_inc_dir = os.path.normpath(os.path.join(javac_bin_dir, '..', 'include')) paths = [java_inc_dir, os.path.join(java_inc_dir, 'win32')] diff --git a/test/Java/JAR.py b/test/Java/JAR.py index 1eae9eb..d5425af 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -32,6 +32,10 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() +# Keep this logic because it skips the test if javac or jar not found. +where_javac, java_version = test.java_where_javac() +where_jar = test.java_where_jar() + test.write('myjar.py', r""" import sys args = sys.argv[1:] diff --git a/test/Java/JARCHDIR.py b/test/Java/JARCHDIR.py index e602fad..59bf082 100644 --- a/test/Java/JARCHDIR.py +++ b/test/Java/JARCHDIR.py @@ -38,6 +38,9 @@ import os import TestSCons test = TestSCons.TestSCons() +# Keep this logic because it skips the test if javac or jar not found. +where_javac, java_version = test.java_where_javac() +where_jar = test.java_where_jar() test.write('SConstruct', """ DefaultEnvironment(tools=[]) diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py index e89d02b..39a0a6c 100644 --- a/test/Java/JARFLAGS.py +++ b/test/Java/JARFLAGS.py @@ -30,6 +30,10 @@ import TestSCons test = TestSCons.TestSCons() +# Keep this logic because it skips the test if javac or jar not found. +where_javac, java_version = test.java_where_javac() +where_jar = test.java_where_jar() + test.subdir('src') test.write('SConstruct', """ diff --git a/test/Java/source-files.py b/test/Java/source-files.py index ab395a0..e5cb8b6 100644 --- a/test/Java/source-files.py +++ b/test/Java/source-files.py @@ -35,6 +35,10 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() +# Keep this logic because it skips the test if javac or jar not found. +where_javac, java_version = test.java_where_javac() +where_jar = test.java_where_jar() + test.write('SConstruct', """ env = Environment(tools = ['javac', 'javah']) env.Java(target = 'class1', source = 'com/Example1.java') |