From 805ef02aa3a0247c3321a3dc80c07009df41b426 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Thu, 15 Oct 2015 04:42:16 +0200 Subject: [PATCH] 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 --- lib/maven.defs | 2 +- tools/download_all.py | 2 +- tools/eclipse/project.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/maven.defs b/lib/maven.defs index dd8097ec52..a16fda1281 100644 --- a/lib/maven.defs +++ b/lib/maven.defs @@ -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, ) diff --git a/tools/download_all.py b/tools/download_all.py index 3b2188289c..58316ca2ed 100755 --- a/tools/download_all.py +++ b/tools/download_all.py @@ -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: diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py index 63afd3d7f1..67ab138a5d 100755 --- a/tools/eclipse/project.py +++ b/tools/eclipse/project.py @@ -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: