980b51f64e
Force relative paths by passing the Prolog compiler only a relative name from within $SRCDIR. This avoids picking up the user's $HOME path as part of the generated class file names, and prevents build failures on filesystems where individual path components are limited to 256 bytes. Change-Id: I43f2a93daf857413401f4e1aeb24b9b2a8c741fe
83 lines
1.9 KiB
Python
83 lines
1.9 KiB
Python
java_library2(
|
|
name = 'init',
|
|
srcs = glob(['src/main/java/**/*.java']),
|
|
deps = [
|
|
'//gerrit-cache-h2:cache-h2',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-httpd:httpd',
|
|
'//gerrit-lucene:lucene',
|
|
'//gerrit-openid:openid',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-server:server',
|
|
'//gerrit-server/src/main/prolog:common',
|
|
'//gerrit-solr:solr',
|
|
'//gerrit-sshd:sshd',
|
|
'//lib:gwtorm',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-servlet',
|
|
'//lib/log:api',
|
|
'//lib/jgit:jgit',
|
|
],
|
|
compile_deps = ['//lib:servlet-api-3_0'],
|
|
visibility = [
|
|
'//:',
|
|
'//gerrit-gwtdebug:gwtdebug',
|
|
'//tools/eclipse:classpath',
|
|
],
|
|
)
|
|
|
|
genrule(
|
|
name = 'webapp_assets',
|
|
cmd = 'cd $SRCDIR/src/main/webapp; zip -qr $OUT .',
|
|
srcs = glob(['src/main/webapp/**/*']),
|
|
deps = [],
|
|
out = 'webapp_assets.zip',
|
|
visibility = ['//:'],
|
|
)
|
|
|
|
genrule(
|
|
name = 'log4j-config__jar',
|
|
cmd = 'jar cf $OUT -C $SRCDIR/src/main/resources .',
|
|
srcs = ['src/main/resources/log4j.properties'],
|
|
out = 'log4j-config.jar',
|
|
)
|
|
|
|
prebuilt_jar(
|
|
name = 'log4j-config',
|
|
binary_jar = genfile('log4j-config.jar'),
|
|
deps = [':log4j-config__jar'],
|
|
visibility = [
|
|
'//:',
|
|
'//tools/eclipse:classpath',
|
|
],
|
|
)
|
|
|
|
prebuilt_jar(
|
|
name = 'version',
|
|
binary_jar = genfile('version.jar'),
|
|
deps = [':gen_version'],
|
|
visibility = ['//:'],
|
|
)
|
|
|
|
# TODO(sop): Move git describe into an uncacheable genrule()
|
|
def git_describe():
|
|
import subprocess
|
|
cmd = ['git', 'describe', '--match', 'v[0-9].*', '--dirty']
|
|
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 = 'gen_version',
|
|
cmd = ';'.join([
|
|
'cd $TMP',
|
|
'mkdir -p com/google/gerrit/common',
|
|
'echo "%s" >com/google/gerrit/common/Version' % git_describe(),
|
|
'zip -9Dqr $OUT .',
|
|
]),
|
|
out = 'version.jar',
|
|
)
|