b8336f176a
Bouncy Castle is still an optional dependency for Gerrit, so we want to avoid accidentally attempting to load Bouncy Castle classes when they might not be available. Rather than try to guard every org.bouncycastle.* reference with a hasPGP() check, reduce the surface area of calls that actually require Bouncy Castle. Move almost all code that calls Bouncy Castle into a new module, gerrit-gpg. Callers need only interact with this module by installing the GpgModule, which is careful to protect all Bouncy Castle class loading with the appropriate havePGP() check. Moreover, this module doesn't need to be installed in the gerrit-server package at all, so we can break the compile-time dependency between gerrit-server and Bouncy Castle, so accidentally introducing a dependency on Bouncy Castle results in a compile error. The REST API and extension APIs dealing with GPG keys only refer to the GpgKeyInfo POJO, and don't need to actually refer to Bouncy Castle classes. Add a shim interface, GpgApiAdapter, that is used by AccountApiImpl to process GPG keys. GpgModule binds this interface to either the Bouncy Castle enabled implementation, or a not-implemented implementation. Since there are various places in the server code where we want to inspect whether signed push is enabled at the server level, but we don't want to have to call into gerrit-gpg code to do this, bind a boolean with @EnableSignedPush from GpgModule. Change-Id: Idbab00a52d86216cae73d02876d56be54aef6581
78 lines
1.6 KiB
Python
78 lines
1.6 KiB
Python
include_defs('//tools/git.defs')
|
|
|
|
java_library(
|
|
name = 'init',
|
|
srcs = glob(['src/main/java/**/*.java']),
|
|
deps = [
|
|
'//gerrit-cache-h2:cache-h2',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-gpg:gpg',
|
|
'//gerrit-httpd:httpd',
|
|
'//gerrit-lucene:lucene',
|
|
'//gerrit-oauth:oauth',
|
|
'//gerrit-openid:openid',
|
|
'//gerrit-pgm:http',
|
|
'//gerrit-pgm:init',
|
|
'//gerrit-pgm:init-api',
|
|
'//gerrit-pgm:util',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-server:server',
|
|
'//gerrit-server/src/main/prolog:common',
|
|
'//gerrit-sshd:sshd',
|
|
'//lib:guava',
|
|
'//lib:gwtorm',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-servlet',
|
|
'//lib/log:api',
|
|
'//lib/jgit:jgit',
|
|
],
|
|
provided_deps = ['//lib:servlet-api-3_1'],
|
|
visibility = [
|
|
'//:',
|
|
'//gerrit-gwtdebug:gwtdebug',
|
|
'//tools/eclipse:classpath',
|
|
],
|
|
)
|
|
|
|
genrule(
|
|
name = 'webapp_assets',
|
|
cmd = 'cd 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 src/main/resources .',
|
|
srcs = ['src/main/resources/log4j.properties'],
|
|
out = 'log4j-config.jar',
|
|
)
|
|
|
|
prebuilt_jar(
|
|
name = 'log4j-config',
|
|
binary_jar = ':log4j-config__jar',
|
|
visibility = [
|
|
'//:',
|
|
'//tools/eclipse:classpath',
|
|
],
|
|
)
|
|
|
|
prebuilt_jar(
|
|
name = 'version',
|
|
binary_jar = ':gen_version',
|
|
visibility = ['//:'],
|
|
)
|
|
|
|
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',
|
|
)
|