forked from openpnp/opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy-resources.sh
executable file
·55 lines (47 loc) · 2.48 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
VERSION=$1
SHORT_VERSION=`echo $VERSION | tr -d .`
BASE_DIR=opencv/opencv-$VERSION
echo "Version: $VERSION"
echo "Short Version: $SHORT_VERSION"
echo "Base Dir: $BASE_DIR"
# Java
echo "Cleaning up Java..."
rm upstream/*.jar
rm -rf upstream/res/*
echo "Copying Java..."
cp $BASE_DIR/target/osx/x86_64/bin/opencv-$SHORT_VERSION.jar upstream
cp $BASE_DIR/target/osx/x86_64/modules/java/pure_test/.build/build/jar/opencv-test.jar upstream
cp -r $BASE_DIR/target/osx/x86_64/modules/java/pure_test/.build/res/* upstream/res
# OSX
echo "Cleaning up OSX..."
rm src/main/resources/nu/pattern/opencv/osx/x86_64/cmake.log
rm src/main/resources/nu/pattern/opencv/osx/x86_64/*.dylib
echo "Copying OSX..."
cp $BASE_DIR/target/osx/x86_64/cmake.log src/main/resources/nu/pattern/opencv/osx/x86_64
cp $BASE_DIR/target/osx/x86_64/lib/libopencv_java$SHORT_VERSION.dylib src/main/resources/nu/pattern/opencv/osx/x86_64
# Linux
echo "Cleaning up Linux x86_32..."
rm src/main/resources/nu/pattern/opencv/linux/x86_32/cmake.log
rm src/main/resources/nu/pattern/opencv/linux/x86_32/*.so
echo "Copying Linux x86_32..."
cp $BASE_DIR/target/linux/x86_32/cmake.log src/main/resources/nu/pattern/opencv/linux/x86_32
cp $BASE_DIR/target/linux/x86_32/lib/libopencv_java$SHORT_VERSION.so src/main/resources/nu/pattern/opencv/linux/x86_32
echo "Cleaning up Linux x86_64..."
rm src/main/resources/nu/pattern/opencv/linux/x86_64/cmake.log
rm src/main/resources/nu/pattern/opencv/linux/x86_64/*.so
echo "Copying Linux x86_64..."
cp $BASE_DIR/target/linux/x86_64/cmake.log src/main/resources/nu/pattern/opencv/linux/x86_64
cp $BASE_DIR/target/linux/x86_64/lib/libopencv_java$SHORT_VERSION.so src/main/resources/nu/pattern/opencv/linux/x86_64
echo "Cleaning up Linux arm..."
rm src/main/resources/nu/pattern/opencv/linux/arm/cmake.log
rm src/main/resources/nu/pattern/opencv/linux/arm/*.so
echo "Copying Linux arm..."
cp $BASE_DIR/target/linux/arm/cmake.log src/main/resources/nu/pattern/opencv/linux/arm
cp $BASE_DIR/target/linux/arm/lib/libopencv_java$SHORT_VERSION.so src/main/resources/nu/pattern/opencv/linux/arm
# Windows
echo "Cleaning up Windows..."
rm src/main/resources/nu/pattern/opencv/windows/x86_32/*.dll
rm src/main/resources/nu/pattern/opencv/windows/x86_64/*.dll
echo "Copying Windows..."
cp $BASE_DIR/target/windows/opencv/build/java/x86/opencv_java$SHORT_VERSION.dll src/main/resources/nu/pattern/opencv/windows/x86_32
cp $BASE_DIR/target/windows/opencv/build/java/x64/opencv_java$SHORT_VERSION.dll src/main/resources/nu/pattern/opencv/windows/x86_64