about summary refs log tree commit diff
path: root/third_party/gerrit
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-04-06T16·46+0100
committerlukegb <lukegb@tvl.fyi>2021-04-06T18·43+0000
commit79aa14278832be17c41ea179b92047454c511789 (patch)
treeaa300237bbe5fdd7500e014326878f3abe826fe5 /third_party/gerrit
parent0dba3ce13340a8787a170c6693b22c040103adb2 (diff)
feat(3p/gerrit): expose the Gerrit API in the output r/2451
Writing Gerrit plugins that don't use the in-tree build system is more
convenient if the API is actually exposed in the derivation's output.

Change-Id: I3408d35498ca879576d532b005e36fde8ff2ea61
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2871
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/gerrit')
-rw-r--r--third_party/gerrit/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/third_party/gerrit/default.nix b/third_party/gerrit/default.nix
index 1bc615fb38f0..8fe057748955 100644
--- a/third_party/gerrit/default.nix
+++ b/third_party/gerrit/default.nix
@@ -52,7 +52,7 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage {
     ./polygerrit-revert-typescript.patch
   ];
 
-  bazelTarget = "release";
+  bazelTarget = "release api-skip-javadoc";
   inherit bazel;
 
   bazelFlags = [
@@ -63,7 +63,7 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage {
   fetchConfigured = true;
 
   fetchAttrs = {
-    sha256 = "sha256:18grb9fghrh84a08f2jqv3wrbf37bk9v1iy2bcaj6xq2phdbkr10";
+    sha256 = "sha256:0xa2i4fjjnkxwxs33fjvcxsrrgfpnz72yb3vwpr1d0sy8z1fag1i";
     preBuild = ''
       rm .bazelversion
     '';
@@ -121,9 +121,14 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage {
       rm .bazelversion
     '';
     installPhase = ''
-      mkdir -p "$out"/webapps/
+      mkdir -p "$out"/webapps/ "$out"/share/api/
       cp bazel-bin/release.war "$out"/webapps/gerrit-${version}.war
+      unzip bazel-bin/api-skip-javadoc.zip -d "$out"/share/api
     '';
+
+    nativeBuildInputs = with pkgs; [
+      unzip
+    ];
   };
 
   passthru = {