forked from NordicID/nur_sample_java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_all.sh
48 lines (37 loc) · 1.46 KB
/
build_all.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
#!/bin/sh
# Build all examples
# usage:
# Execute in shell
# $> sh build_all.sh
# Compile transports
echo "Compiling NurApiSerialTransport"
mkdir -p transports/NurApiSerialTransport/bin
javac -d "transports/NurApiSerialTransport/bin" -cp "/usr/share/java/RXTXcomm.jar:import/NurApi.jar" transports/NurApiSerialTransport/src/com/nordicid/nurapi/*.java
cd transports/NurApiSerialTransport/bin
jar cf ../../jars/NurApiSerialTransport.jar com/nordicid/nurapi/*.class
cd ../../..
echo "Compiling NurApiSocketTransport"
mkdir -p transports/NurApiSocketTransport/bin
javac -d "transports/NurApiSocketTransport/bin" -cp "/usr/share/java/RXTXcomm.jar:import/NurApi.jar" transports/NurApiSocketTransport/src/com/nordicid/nurapi/*.java
cd transports/NurApiSocketTransport/bin
jar cf ../../jars/NurApiSocketTransport.jar com/nordicid/nurapi/*.class
cd ../../..
# Compile samples common
echo "Compiling SamplesCommon"
mkdir -p samples/SamplesCommon/bin
javac -d "samples/SamplesCommon/bin" -cp "transports/jars/*:/usr/share/java/RXTXcomm.jar:import/NurApi.jar" samples/SamplesCommon/src/com/nordicid/samples/common/*.java
compile_example()
{
echo "Compiling $1"
# Clean up bin dir
rm -rf "$1/bin"
# recreate bin dir
mkdir -p "$1/bin"
# compile
javac -d "$1/bin" -cp "samples/SamplesCommon/bin:transports/jars/*:/usr/share/java/RXTXcomm.jar:import/NurApi.jar" $1/src/com/nordicid/testapplication/*.java
}
# Compile all tests
for d in samples/*_*/ ; do
compile_example "$d"
done
exit 0