depot/third_party/tvl/ops/gerrit-tvl/default.nix
Default email a291c8690a Project import generated by Copybara.
GitOrigin-RevId: e6e19f3d81a982a62e1bba08f0b4f7fdc21b4ea0
2022-05-19 16:39:52 +02:00

33 lines
709 B
Nix

{ depot, pkgs, lib, ... }:
let
classPath = lib.concatStringsSep ":" [
"${depot.third_party.gerrit}/share/api/extension-api_deploy.jar"
];
in
pkgs.stdenvNoCC.mkDerivation rec {
name = "${pname}-${version}.jar";
pname = "gerrit-tvl";
version = "0.0.1";
src = ./.;
nativeBuildInputs = with pkgs; [
jdk
];
buildPhase = ''
mkdir $NIX_BUILD_TOP/build
# Build Java components.
export JAVAC="javac -cp ${classPath} -d $NIX_BUILD_TOP/build --release 11"
$JAVAC ./HttpModule.java
# Install static files.
cp -R static $NIX_BUILD_TOP/build/static
'';
installPhase = ''
jar --create --file $out --manifest $src/MANIFEST.MF -C $NIX_BUILD_TOP/build .
'';
}