Buck: Tweak Eclipse project generation to include sources again

Ib3f22e70b7 upgraded to new Buck version but broke sources download
during Eclipse project creation. That's because the namespacing of
genrule() artifact. To rectify and to avoid querying the actual
location of source artifact from Buck for every source library with:

  $ buck targets --show_output //lib:foo__download_src | awk '{print $2}'

switch from using genrule() to prebuilt_jar() to induce the source from
binary artifact, because the location is stable for this rule.

Change-Id: I153d3e31b4f7098ddd5157b7b1bba17529c83b32
This commit is contained in:
David Ostrovsky
2015-10-15 04:42:16 +02:00
parent 33b0679b99
commit 805ef02aa3
3 changed files with 3 additions and 3 deletions

View File

@@ -123,7 +123,7 @@ def maven_jar(
else:
srcjar = None
genrule(
name = '%s__download_src' % name,
name = '%s_src' % name,
cmd = ':>$OUT',
out = '__%s__no_src' % name,
)

View File

@@ -32,7 +32,7 @@ for line in p.stdout:
if m:
n = m.group(1)
if args.src and n.endswith('__download_bin'):
n = n[:-4] + '_src'
n = n[:-13] + 'src'
targets.add(n)
r = p.wait()
if r != 0:

View File

@@ -169,7 +169,7 @@ 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):
s = None
if args.plugins: