Buck: Simplify root build file

Remove all proxy rules, that were introduced to allow to build Gerrit
with hijacked JGit cell. New approach suggested in: [1], that emulates
real JGit project structure in its own cell, makes them unnecessary.

Add :all rule, that build all artifacts and packages them in zip file.
Add shell binary :jgit_bin rule, that allows to execute JGit binary
from with buck run command, e.g.:

  $ buck run jgit_bin status
  $ buck run jgit_bin -- --version

* [1] https://gerrit-review.googlesource.com/74859

Change-Id: Idf9ecb783cbd2b9984d4118047968f1f5204d642
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
This commit is contained in:
David Ostrovsky 2016-02-14 11:36:25 +01:00
parent dcfcbfd8bf
commit 2d0fc6124d
2 changed files with 20 additions and 79 deletions

View File

@ -1,10 +1,11 @@
[alias]
jgit = //:jgit
jgit-servlet = //:jgit-servlet
jgit-archive = //:jgit-archive
jgit-lfs = //:jgit-lfs
jgit-lfs-server = //:jgit-lfs-server
all = //:all
jgit = //org.eclipse.jgit:jgit
jgit-archive = //org.eclipse.jgit.archive:jgit-archive
jgit_bin = //:jgit_bin
jgit-lfs = //org.eclipse.jgit.lfs:jgit-lfs
jgit-lfs-server = //org.eclipse.jgit.lfs.server:jgit-lfs-server
jgit-servlet = //org.eclipse.jgit.http.server:jgit-servlet
[buildfile]
includes = //tools/default.defs

88
BUCK
View File

@ -1,78 +1,18 @@
java_library(
name = 'jgit',
exported_deps = ['//org.eclipse.jgit:jgit'],
visibility = ['PUBLIC'],
DEPS = [
'//org.eclipse.jgit:jgit',
'//org.eclipse.jgit.archive:jgit-archive',
'//org.eclipse.jgit.http.server:jgit-servlet',
'//org.eclipse.jgit.lfs:jgit-lfs',
'//org.eclipse.jgit.lfs.server:jgit-lfs-server',
'//org.eclipse.jgit.pgm:jgit',
]
zip_file(
name = 'all',
srcs = DEPS,
)
genrule(
name = 'jgit_src',
cmd = 'ln -s $(location //org.eclipse.jgit:jgit_src) $OUT',
out = 'jgit_src.zip',
visibility = ['PUBLIC'],
)
java_library(
name = 'jgit-servlet',
exported_deps = [
':jgit',
'//org.eclipse.jgit.http.server:jgit-servlet'
],
visibility = ['PUBLIC'],
)
java_library(
name = 'jgit-archive',
exported_deps = [
':jgit',
'//org.eclipse.jgit.archive:jgit-archive'
],
visibility = ['PUBLIC'],
)
java_library(
name = 'jgit-lfs',
exported_deps = [
':jgit',
'//org.eclipse.jgit.lfs:jgit-lfs'
],
visibility = ['PUBLIC'],
)
genrule(
name = 'jgit-lfs_src',
cmd = 'ln -s $(location //org.eclipse.jgit.lfs:jgit-lfs_src) $OUT',
out = 'jgit-lfs_src.zip',
visibility = ['PUBLIC'],
)
java_library(
name = 'jgit-lfs-server',
exported_deps = [
':jgit',
':jgit-lfs',
'//org.eclipse.jgit.lfs.server:jgit-lfs-server'
],
visibility = ['PUBLIC'],
)
genrule(
name = 'jgit-lfs-server_src',
cmd = 'ln -s $(location //org.eclipse.jgit.lfs.server:jgit-lfs-server_src) $OUT',
out = 'jgit-lfs-server_src.zip',
visibility = ['PUBLIC'],
)
java_library(
name = 'junit',
exported_deps = [
':jgit',
'//org.eclipse.jgit.junit:junit'
],
visibility = ['PUBLIC'],
)
genrule(
sh_binary(
name = 'jgit_bin',
cmd = 'ln -s $(location //org.eclipse.jgit.pgm:jgit) $OUT',
out = 'jgit_bin',
main = '//org.eclipse.jgit.pgm:jgit',
)