Fix SamlMetadataCreator runtime dependencies Update SamlMetadataCreator to use runtime_deps and depend on the already built saml__plugin target instead of compiling the plugin sources again. The tool only needs these dependencies at runtime, not at compile time. Also add the required runtime dependencies for the utility: Gerrit server, args4j, jgit, bcprov and dropwizard-core. A considered alternative was to use //plugins:plugin-lib instead of listing the individual dependencies explicitly. However, that would add unused dependencies and substantially increase the final artifact size. Change-Id: I564e798bb90c1e4afc0ff2b7528ed32cf87c1340
diff --git a/BUILD b/BUILD index 8e19948..05555f0 100644 --- a/BUILD +++ b/BUILD
@@ -31,12 +31,14 @@ java_binary( name = "SamlMetadataCreator", - srcs = glob([ - "src/main/java/com/googlesource/gerrit/plugins/saml/**/*.java", - ]), main_class = "com.googlesource.gerrit.plugins.saml.pgm.SamlMetadataCreator", - deps = SAML_DEPS + [ - "//plugins:plugin-lib-neverlink", + runtime_deps = SAML_DEPS + [ + ":saml__plugin", + "//java/com/google/gerrit/server", + "//lib:args4j", + "//lib:jgit", + "//lib/bouncycastle:bcprov", + "//lib/dropwizard:dropwizard-core", ], )