bd5629718f
java_library() targets must now list every dependency they need for an import. This permits buck to run more targets in parallel as it has a better view of the dependency graph, and opens the door for buck to make even more optimizations in the future. Change-Id: I132bf47a725e44ba5950ba6ca76bfa72c3876906
69 lines
1.5 KiB
Python
69 lines
1.5 KiB
Python
SRC = 'src/main/java/com/google/gerrit/'
|
|
VER = 'resources/com/google/gerrit/common/Version'
|
|
|
|
gwt_module(
|
|
name = 'client',
|
|
srcs = glob([SRC + 'common/**/*.java']),
|
|
gwtxml = SRC + 'Common.gwt.xml',
|
|
deps = [
|
|
'//gerrit-patch-jgit:client',
|
|
'//gerrit-prettify:client',
|
|
'//gerrit-reviewdb:client',
|
|
'//lib:gwtjsonrpc',
|
|
'//lib:gwtorm',
|
|
'//lib:jsr305',
|
|
'//lib/jgit:jgit',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_library(
|
|
name = 'server',
|
|
srcs = glob([SRC + 'common/**/*.java']),
|
|
deps = [
|
|
'//gerrit-patch-jgit:server',
|
|
'//gerrit-prettify:server',
|
|
'//gerrit-reviewdb:server',
|
|
'//lib:gwtjsonrpc',
|
|
'//lib:gwtorm',
|
|
'//lib:jsr305',
|
|
'//lib/jgit:jgit',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_library(
|
|
name = 'version',
|
|
resources = [genfile(VER)],
|
|
deps = [':git_describe'],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
# TODO(sop): Move git describe into an uncacheable genrule()
|
|
def git_describe():
|
|
import subprocess
|
|
cmd = ['git', 'describe', 'HEAD']
|
|
p = subprocess.Popen(cmd, stdout = subprocess.PIPE)
|
|
v = p.communicate()[0].strip()
|
|
r = p.returncode
|
|
if r != 0:
|
|
raise subprocess.CalledProcessError(r, ' '.join(cmd))
|
|
return v
|
|
|
|
genrule(
|
|
name = 'git_describe',
|
|
cmd = 'mkdir -p $(dirname $OUT); echo "%s" >$OUT' % git_describe(),
|
|
srcs = [],
|
|
out = VER,
|
|
)
|
|
|
|
java_test(
|
|
name = 'client_tests',
|
|
srcs = glob(['src/test/java/**/*.java']),
|
|
deps = [
|
|
':client',
|
|
'//lib:junit',
|
|
],
|
|
source_under_test = [':client'],
|
|
)
|