You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"Using Nix to build the DiffDetective demo jar."
8
+
nix-build &&
9
+
cp result/share/java/DiffDetective-Demo.jar .&&
10
+
echo"The jar has been built successfully. You can find it in $(realpath DiffDetective-Demo.jar)"&&
11
+
echo"You might want to remove the 'result' link ('rm result') to allow the Nix garbage collector to reclaim some space."
12
+
elifcommand -v docker &>/dev/null
13
+
then
14
+
echo"Using Docker to build the DiffDetective demo jar."
15
+
16
+
root=0
17
+
if! groups | grep -q docker
18
+
then
19
+
if [ "$(id -u)"-ne 0 ]
20
+
then
21
+
echo>&2"You don't seem to be able to run Docker as your user. Please start this script as root (e.g., using 'sudo') or ensure you are a member of the docker group."
22
+
exit 2
23
+
fi
24
+
fi
25
+
26
+
if! docker version &>/dev/null
27
+
then
28
+
echo>&2"Docker isn't running. You need to start the docker engine first."
29
+
echo>&2"On most Linux distributions you can do so using 'systemctl start docker'."
30
+
exit 3
31
+
fi
32
+
33
+
docker build . --tag diffdetective-demo:1.0.0 &&
34
+
docker run --volume "$(realpath .):/output:rw" diffdetective-demo:1.0.0 /bin/cp /DiffDetective/share/java/DiffDetective-Demo.jar /output
35
+
36
+
if [ "$?"-eq 0 ]
37
+
then
38
+
echo
39
+
echo"The jar has been built successfully. You can find it in $(realpath DiffDetective-Demo.jar)"
40
+
echo"You might want to remove the Docker image ('docker image rm diffdetective-demo:1.0.0')."
41
+
42
+
if [ "$(id -u)"-eq 0 ]
43
+
then
44
+
echo"You might want to change the owner of the jar ('chown username:group DiffDetective-Demo.jar') because it's current owner is root."
45
+
fi
46
+
fi
47
+
else
48
+
echo"Neither Nix nor Docker are installed. You need to compile the jar for yourselves. See INSTALL.md for instructions."
0 commit comments