Merge pull request #4488 from dcbaker/java-fixes

Java fixes
pull/4497/head
Dylan Baker 6 years ago committed by GitHub
commit 470b3b5121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      mesonbuild/backend/ninjabackend.py
  2. 2
      mesonbuild/environment.py
  3. 2
      test cases/java/8 codegen custom target/com/mesonbuild/meson.build

@ -877,6 +877,10 @@ int dummy;
def generate_single_java_compile(self, src, target, compiler, outfile):
deps = [os.path.join(self.get_target_dir(l), l.get_filename()) for l in target.link_targets]
generated_sources = self.get_target_generated_sources(target)
for rel_src, gensrc in generated_sources.items():
if rel_src.endswith('.java'):
deps.append(rel_src)
args = []
args += compiler.get_buildtype_args(self.get_option_for_target('buildtype', target))
args += self.build.get_global_args(compiler, target.is_cross)

@ -803,8 +803,8 @@ class Environment:
p, out, err = Popen_safe(exelist + ['-version'])
except OSError:
raise EnvironmentException('Could not execute Java compiler "%s"' % ' '.join(exelist))
version = search_version(err)
if 'javac' in out or 'javac' in err:
version = search_version(err if 'javac' in err else out)
return JavaCompiler(exelist, version)
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')

@ -4,5 +4,5 @@ config_file = custom_target('confgen',
input : 'Config.java.in',
output : 'Config.java',
command : [python, '-c',
'import shutil; import sys; shutil.copy(sys.argv[1], sys.argv[2])',
'import shutil, sys, time; time.sleep(1); shutil.copy(sys.argv[1], sys.argv[2])',
'@INPUT@', '@OUTPUT@'])

Loading…
Cancel
Save