-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcopy-resources.sh
35 lines (29 loc) · 1.4 KB
/
copy-resources.sh
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
#!/usr/bin/env bash
# Check if destination directory exist
if [ ! -d "$2/target/lib" ]; then
echo "Creating directory $2/target/lib"
mkdir -p "$2/target/lib"
fi
if [ ! -d "$2/src/main/resources/lib" ]; then
echo "Creating directory $2/src/main/resources/lib"
mkdir -p "$2/src/main/resources/lib"
fi
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "[linux-gnu] copy resources from $1/joctomap-natives/ to $2/target/lib..."
# Copy to target
cp $1/joctomap-natives/lib/*.so* $2/target/lib
cp $1/joctomap-natives/build/libjoctomap_natives.so $2/target
echo "[linux-gnu] copy resources from $1/joctomap-natives/ to $2/src/main/resources..."
# Copy to /src/main/resources
cp $1/joctomap-natives/lib/*.so* $2/src/main/resources/lib
cp $1/joctomap-natives/build/libjoctomap_natives.so $2/src/main/resources
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "[darwin*] copy resources from $1/joctomap-natives/ to $2/target/lib..."
# Copy to target
cp $1/joctomap-natives/lib/*.dylib* $2/target/lib
cp $1/joctomap-natives/build/libjoctomap_natives.dylib $2/target/libjoctomap_natives.so
echo "[darwin*] copy resources from $1/joctomap-natives/ to $2/src/main/resources..."
# Copy to /src/main/resources
cp $1/joctomap-natives/lib/*.dylib* $2/src/main/resources/lib
cp $1/joctomap-natives/build/libjoctomap_natives.dylib $2/src/main/resources/libjoctomap_natives.so
fi