-
Notifications
You must be signed in to change notification settings - Fork 4
/
build_all.bat
57 lines (46 loc) · 2.08 KB
/
build_all.bat
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
@echo off
setlocal enabledelayedexpansion
REM Build all examples
REM usage:
REM Execute bat in command prompt
REM nur_sample_java>build_all.bat
REM manually set JAVA_HOME
SET JAVA_HOME=D:\Program Files\Amazon Corretto\jdk1.8.0_252
if "%JAVA_HOME%" == "" (
echo FAILED
echo JAVA_HOME Environment not set
echo Set JAVA_HOME to point java install dir in system environment
echo Or set JAVA_HOME in this bat file
exit /B 2
)
REM RXTX jar path
SET RXTXJAR=transports/NurApiSerialTransport/nrjavaserial-5.2.1.jar
REM Compile samples common
echo. Compiling NurApiSerialTransport
IF NOT EXIST transports\NurApiSerialTransport\bin (md transports\NurApiSerialTransport\bin)
"%JAVA_HOME%\bin\javac" -d "transports/NurApiSerialTransport/bin" -cp "%RXTXJAR%;import/NurApi.jar" transports/NurApiSerialTransport/src/com/nordicid/nurapi/*.java
cd transports\NurApiSerialTransport\bin
"%JAVA_HOME%\bin\jar" cf ../../jars/NurApiSerialTransport.jar com/nordicid/nurapi/*.class
cd ..\..\..
echo. Compiling NurApiSocketTransport
IF NOT EXIST transports\NurApiSocketTransport\bin (md transports\NurApiSocketTransport\bin)
"%JAVA_HOME%\bin\javac" -d "transports/NurApiSocketTransport/bin" -cp "import/NurApi.jar" transports/NurApiSocketTransport/src/com/nordicid/nurapi/*.java
cd transports\NurApiSocketTransport\bin
"%JAVA_HOME%\bin\jar" cf ../../jars/NurApiSocketTransport.jar com/nordicid/nurapi/*.class
cd ..\..\..
REM Compile samples common
echo. Compiling SamplesCommon
IF NOT EXIST samples\SamplesCommon\bin (md samples\SamplesCommon\bin)
"%JAVA_HOME%\bin\javac" -d "samples/SamplesCommon/bin" -cp "transports/jars/*;%RXTXJAR%;import/NurApi.jar" samples/SamplesCommon/src/com/nordicid/samples/common/*.java
REM Compile all tests
FOR /d %%I in (samples\*_*) DO call:compile_example %%I
goto:eof
:compile_example
echo. Compiling %~1
REM Clean up bin dir
IF EXIST %~1\bin (rmdir /s /q %~1\bin)
REM recreate bin dir
IF NOT EXIST %~1\bin (md %~1\bin)
REM compile
"%JAVA_HOME%\bin\javac" -d "%~1/bin" -cp "samples/SamplesCommon/bin;transports/jars/*;%RXTXJAR%;import/NurApi.jar" %~1/src/com/nordicid/testapplication/*.java
goto:eof