scalafmt: deprecate phases and use pname&version

This commit is contained in:
Felix Buehler 2021-07-25 01:21:45 +02:00
parent 2f9cf506dd
commit e66d3c1d56

View file

@ -17,21 +17,24 @@ let
}; };
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "${baseName}-${version}"; pname = baseName;
inherit version;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jdk deps ]; buildInputs = [ jdk deps ];
doCheck = true; dontUnpack = true;
phases = [ "installPhase" "checkPhase" ];
installPhase = '' installPhase = ''
runHook preInstall
makeWrapper ${jre}/bin/java $out/bin/${baseName} \ makeWrapper ${jre}/bin/java $out/bin/${baseName} \
--add-flags "-cp $CLASSPATH org.scalafmt.cli.Cli" --add-flags "-cp $CLASSPATH org.scalafmt.cli.Cli"
runHook postInstall
''; '';
checkPhase = '' installCheckPhase = ''
$out/bin/${baseName} --version | grep -q "${version}" $out/bin/${baseName} --version | grep -q "${version}"
''; '';