Skip to content

Commit 607a18d

Browse files
committed
nix: Add and fix the phase hooks
1 parent a963735 commit 607a18d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

default.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,24 @@ pkgs.stdenvNoCC.mkDerivation rec {
4040
nativeBuildInputs = with pkgs; [maven];
4141

4242
buildPhase = ''
43+
runHook preBuild
44+
4345
mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:go-offline -Dmaven.repo.local="$out"
46+
47+
runHook postBuild
4448
'';
4549

4650
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside
4751
installPhase = ''
52+
runHook preInstall
53+
4854
find "$out" -type f \
4955
\( -name \*.lastUpdated -or \
5056
-name resolver-status.properties -or \
5157
-name _remote.repositories \) \
5258
-delete
59+
60+
runHook postInstall
5361
'';
5462

5563
dontFixup = true;
@@ -88,15 +96,15 @@ pkgs.stdenvNoCC.mkDerivation rec {
8896

8997
inherit doCheck;
9098
checkPhase = ''
91-
runHook postTest
99+
runHook preTest
92100
93101
mvn --offline -Dmaven.repo.local="$mavenRepo" test
94102
95103
runHook postTest
96104
'';
97105

98106
installPhase = ''
99-
runHook postInstall
107+
runHook preInstall
100108
101109
local jar="$out/share/java/DiffDetective/DiffDetective.jar"
102110
install -Dm644 "target/diffdetective-${version}-jar-with-dependencies.jar" "$jar"

0 commit comments

Comments
 (0)