Merge "Fix Eclipse classpath generation for source jars"

This commit is contained in:
David Pursehouse 2016-09-27 23:26:45 +00:00 committed by Gerrit Code Review
commit 6471515891

View File

@ -119,6 +119,7 @@ def gen_classpath():
# Classpath entries are absolute for cross-cell support
java_library = re.compile('.*/buck-out/gen/(.*)/lib__[^/]+__output/[^/]+[.]jar$')
srcs = re.compile('.*/(__.*__)/.*')
for p in _query_classpath(MAIN):
if p.endswith('-src.jar'):
# gwt_module() depends on -src.jar for Java to JavaScript compiles.
@ -175,8 +176,18 @@ def gen_classpath():
for j in sorted(libs):
s = None
if j.endswith('.jar'):
s = j[:-4] + '_src.jar'
s = j[:-4] + '-src.jar'
if not path.exists(s):
m = srcs.match(s)
if m:
l = m.group(1)
if l.endswith('__jar__'):
s = s.replace(l, l.replace('__jar__', '_src__'))
else:
s = s.replace(l, l[:-1] + 'src__')
if not path.exists(s):
s = None
else:
s = None
if args.plugins:
classpathentry('lib', j, s, exported=True)