Bazel: Build core plugins
Change-Id: Ic8ed6fcdb8cdab9cb7eaba436c5fdffc6670d1b4
This commit is contained in:
@@ -6,7 +6,6 @@ Bazel build is experimental. Major missing parts:
|
|||||||
* Documentation index
|
* Documentation index
|
||||||
* License tracking
|
* License tracking
|
||||||
* Version stamping
|
* Version stamping
|
||||||
* Core plugins
|
|
||||||
* Custom plugins
|
* Custom plugins
|
||||||
* Eclipse project generation.
|
* Eclipse project generation.
|
||||||
* Publishing to maven.
|
* Publishing to maven.
|
||||||
|
@@ -784,3 +784,9 @@ maven_jar(
|
|||||||
artifact = 'org.webjars:google-diff-match-patch:20121119-1',
|
artifact = 'org.webjars:google-diff-match-patch:20121119-1',
|
||||||
sha1 = '0cf1782dbcb8359d95070da9176059a5a9d37709',
|
sha1 = '0cf1782dbcb8359d95070da9176059a5a9d37709',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
maven_jar(
|
||||||
|
name = 'commons_io',
|
||||||
|
artifact = 'commons-io:commons-io:1.4',
|
||||||
|
sha1 = 'a8762d07e76cfde2395257a5da47ba7c1dbd3dce',
|
||||||
|
)
|
||||||
|
@@ -11,6 +11,45 @@ PLUGIN_API = [
|
|||||||
'//gerrit-sshd:sshd',
|
'//gerrit-sshd:sshd',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
EXPORTS = [
|
||||||
|
'//gerrit-antlr:query_exception',
|
||||||
|
'//gerrit-antlr:query_parser',
|
||||||
|
'//gerrit-common:annotations',
|
||||||
|
'//gerrit-common:server',
|
||||||
|
'//gerrit-extension-api:api',
|
||||||
|
'//gerrit-gwtexpui:server',
|
||||||
|
'//gerrit-reviewdb:server',
|
||||||
|
'//lib/commons:lang',
|
||||||
|
'//lib/dropwizard:dropwizard-core',
|
||||||
|
'//lib/guice:guice',
|
||||||
|
'//lib/guice:guice-assistedinject',
|
||||||
|
'//lib/guice:guice-servlet',
|
||||||
|
'//lib/guice:javax-inject',
|
||||||
|
'//lib/guice:multibindings',
|
||||||
|
'//lib/jgit/org.eclipse.jgit.http.server:jgit-servlet',
|
||||||
|
'//lib/jgit/org.eclipse.jgit:jgit',
|
||||||
|
'//lib/joda:joda-time',
|
||||||
|
'//lib/log:api',
|
||||||
|
'//lib/log:log4j',
|
||||||
|
'//lib/mina:sshd',
|
||||||
|
'//lib/ow2:ow2-asm',
|
||||||
|
'//lib/ow2:ow2-asm-analysis',
|
||||||
|
'//lib/ow2:ow2-asm-commons',
|
||||||
|
'//lib/ow2:ow2-asm-util',
|
||||||
|
'//lib:args4j',
|
||||||
|
'//lib:blame-cache',
|
||||||
|
'//lib:guava',
|
||||||
|
'//lib:gson',
|
||||||
|
'//lib:gwtorm',
|
||||||
|
'//lib:icu4j',
|
||||||
|
'//lib:jsch',
|
||||||
|
'//lib:mime-util',
|
||||||
|
'//lib:protobuf',
|
||||||
|
'//lib:servlet-api-3_1',
|
||||||
|
'//lib:soy',
|
||||||
|
'//lib:velocity',
|
||||||
|
]
|
||||||
|
|
||||||
java_binary(
|
java_binary(
|
||||||
name = 'plugin-api',
|
name = 'plugin-api',
|
||||||
main_class = 'Dummy',
|
main_class = 'Dummy',
|
||||||
@@ -20,42 +59,14 @@ java_binary(
|
|||||||
|
|
||||||
java_library(
|
java_library(
|
||||||
name = 'lib',
|
name = 'lib',
|
||||||
exports = PLUGIN_API + [
|
exports = PLUGIN_API + EXPORTS,
|
||||||
'//gerrit-antlr:query_exception',
|
visibility = ['//visibility:public'],
|
||||||
'//gerrit-antlr:query_parser',
|
)
|
||||||
'//gerrit-common:annotations',
|
|
||||||
'//gerrit-common:server',
|
java_library(
|
||||||
'//gerrit-extension-api:api',
|
name = 'lib-neverlink',
|
||||||
'//gerrit-gwtexpui:server',
|
neverlink = 1,
|
||||||
'//gerrit-reviewdb:server',
|
exports = PLUGIN_API + EXPORTS,
|
||||||
'//lib/commons:lang',
|
|
||||||
'//lib/dropwizard:dropwizard-core',
|
|
||||||
'//lib/guice:guice',
|
|
||||||
'//lib/guice:guice-assistedinject',
|
|
||||||
'//lib/guice:guice-servlet',
|
|
||||||
'//lib/guice:javax-inject',
|
|
||||||
'//lib/guice:multibindings',
|
|
||||||
'//lib/jgit/org.eclipse.jgit.http.server:jgit-servlet',
|
|
||||||
'//lib/jgit/org.eclipse.jgit:jgit',
|
|
||||||
'//lib/joda:joda-time',
|
|
||||||
'//lib/log:api',
|
|
||||||
'//lib/mina:sshd',
|
|
||||||
'//lib/ow2:ow2-asm',
|
|
||||||
'//lib/ow2:ow2-asm-analysis',
|
|
||||||
'//lib/ow2:ow2-asm-commons',
|
|
||||||
'//lib/ow2:ow2-asm-util',
|
|
||||||
'//lib:args4j',
|
|
||||||
'//lib:blame-cache',
|
|
||||||
'//lib:guava',
|
|
||||||
'//lib:gwtorm',
|
|
||||||
'//lib:icu4j',
|
|
||||||
'//lib:jsch',
|
|
||||||
'//lib:mime-util',
|
|
||||||
'//lib:protobuf',
|
|
||||||
'//lib:servlet-api-3_1',
|
|
||||||
'//lib:soy',
|
|
||||||
'//lib:velocity',
|
|
||||||
],
|
|
||||||
visibility = ['//visibility:public'],
|
visibility = ['//visibility:public'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -243,3 +243,9 @@ java_library(
|
|||||||
exports = ['@postgresql//jar'],
|
exports = ['@postgresql//jar'],
|
||||||
visibility = ['//visibility:public'],
|
visibility = ['//visibility:public'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
java_library(
|
||||||
|
name = 'commons-io',
|
||||||
|
exports = ['@commons_io//jar'],
|
||||||
|
visibility = ['//visibility:public'],
|
||||||
|
)
|
||||||
|
34
tools/bzl/plugin.bzl
Normal file
34
tools/bzl/plugin.bzl
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
def gerrit_plugin(
|
||||||
|
name,
|
||||||
|
deps = [],
|
||||||
|
srcs = [],
|
||||||
|
resources = [],
|
||||||
|
manifest_entries = []):
|
||||||
|
# TODO(davido): Fix stamping: run git describe in plugin directory
|
||||||
|
# https://github.com/bazelbuild/bazel/issues/1758
|
||||||
|
manifest_lines = [
|
||||||
|
"Gerrit-ApiType: plugin",
|
||||||
|
"Implementation-Version: 1.0",
|
||||||
|
"Implementation-Vendor: Gerrit Code Review",
|
||||||
|
]
|
||||||
|
for line in manifest_entries:
|
||||||
|
manifest_lines.append(line.replace('$', '\$'))
|
||||||
|
|
||||||
|
native.java_library(
|
||||||
|
name = name + '__plugin',
|
||||||
|
srcs = srcs,
|
||||||
|
resources = resources,
|
||||||
|
deps = deps + ['//gerrit-plugin-api:lib-neverlink'],
|
||||||
|
visibility = ['//visibility:public'],
|
||||||
|
)
|
||||||
|
|
||||||
|
native.java_binary(
|
||||||
|
name = name,
|
||||||
|
deploy_manifest_lines = manifest_lines,
|
||||||
|
main_class = 'Dummy',
|
||||||
|
runtime_deps = [
|
||||||
|
':%s__plugin' % name,
|
||||||
|
],
|
||||||
|
visibility = ['//visibility:public'],
|
||||||
|
)
|
Reference in New Issue
Block a user