forked from wilsonzlin/minify-html
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (35 loc) · 820 Bytes
/
build.sh
File metadata and controls
executable file
·43 lines (35 loc) · 820 Bytes
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
#!/usr/bin/env bash
set -e
# Build JAR with native module for current platform.
pushd "$(dirname "$0")"
if [ "$1" = "release" ]; then
rust_build_arg="--release"
rust_build_dir="release"
else
rust_build_arg=""
rust_build_dir="debug"
fi
if [[ "$OSTYPE" == "linux-gnu" ]]; then
os_name="linux"
ext="so"
elif [[ "$OSTYPE" == "darwin"* ]]; then
os_name="macos"
ext="dylib"
elif [[ "$OSTYPE" == "cygwin" ]]; then
os_name="windows"
ext="dll"
elif [[ "$OSTYPE" == "msys" ]]; then
os_name="windows"
ext="dll"
elif [[ "$OSTYPE" == "win32" ]]; then
os_name="windows"
ext="dll"
else
echo "Unknown OS"
exit 1
fi
cargo build $rust_build_arg
mkdir -p src/main/resources/
cp target/rust/$rust_build_dir/libminify_html_java.$ext src/main/resources/$os_name-x86_64.nativelib
mvn clean package
popd