forked from nasa/fpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·76 lines (63 loc) · 1.53 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh -e
# ----------------------------------------------------------------------
# FPP installer
# ----------------------------------------------------------------------
# To pass flags to sbt, set the environment variable
# FPP_SBT_FLAGS
# ----------------------------------------------------------------------
scala_version="3.1.2"
if test $# -gt 1
then
echo 'usage: install dest-dir' 1>&2
echo ' install' 1>&2
exit 1
fi
if test -n "$1"
then
dest=$1
else
dest=bin
fi
wd=`dirname $0`
cd $wd
top=`pwd`
meta=$top/lib/src/main/resources/META-INF/native-image
dir=`dirname $dest`
dir=`cd $dir; pwd`
base=`basename $dest`
dest=$dir/$base
tools="
fpp-check
fpp-depend
fpp-filenames
fpp-format
fpp-syntax
fpp-from-xml
fpp-locate-defs
fpp-locate-uses
fpp-to-cpp
fpp-to-xml
"
version=`git describe --tags --always`
util=lib/src/main/scala/util
echo "Updating version to $version"
sed -i.bak -e "s/val v = .*/val v = \"$version\"/" \
$util/Version.scala
echo "Building jar files"
cmd="sbt $FPP_SBT_FLAGS assembly"
echo $cmd
$cmd
echo "Restoring Version.scala"
cp $util/Version.scala.bak $util/Version.scala
mkdir -p $dest
echo "Installing tools at $dest"
for tool in $tools
do
jar=`find tools/$tool -name "*$name*assembly*.jar" | grep "target/scala-$scala_version"`
echo " $jar"
cp $jar $dest/$tool.jar
echo '#!/bin/sh
# See https://www.graalvm.org/22.1/reference-manual/native-image/Agent/
java -agentlib:native-image-agent=config-merge-dir='$meta' -jar '$dest'/'$tool'.jar "$@"' > $dest/$tool
chmod +x $dest/$tool
done