Skip to content

Commit

Permalink
Update rpclib release to 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed May 8, 2021
1 parent a2df8ee commit 2362d76
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
27 changes: 14 additions & 13 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ if ERRORLEVEL 1 (

REM //---------- get rpclib ----------
IF NOT EXIST external\rpclib mkdir external\rpclib
IF NOT EXIST external\rpclib\rpclib-2.2.1 (

set RPC_VERSION_FOLDER=rpclib-2.3.0
IF NOT EXIST external\rpclib\%RPC_VERSION_FOLDER% (
REM //leave some blank lines because %powershell% shows download banner at top of console
ECHO(
ECHO(
Expand All @@ -74,9 +76,9 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 (
ECHO *****************************************************************************************
@echo on
if "%PWSHV7%" == "" (
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }"
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/rpclib/rpclib/archive/v2.3.0.zip -OutFile external\rpclib.zip }"
) else (
%powershell% -command "iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip"
%powershell% -command "iwr https://github.com/rpclib/rpclib/archive/v2.3.0.zip -OutFile external\rpclib.zip"
)
@echo off

Expand All @@ -86,18 +88,17 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 (
%powershell% -command "Expand-Archive -Path external\rpclib.zip -DestinationPath external\rpclib"
del external\rpclib.zip /q

REM //Don't fail the build if the high-poly car is unable to be downloaded
REM //Instead, just notify users that the gokart will be used.
IF NOT EXIST external\rpclib\rpclib-2.2.1 (
ECHO Unable to download high-polycount SUV. Your AirSim build will use the default vehicle.
REM //Fail the build if unable to download rpclib
IF NOT EXIST external\rpclib\%RPC_VERSION_FOLDER% (
ECHO Unable to download rpclib, stopping build
goto :buildfailed
)
)

REM //---------- Build rpclib ------------
ECHO Starting cmake to build rpclib...
IF NOT EXIST external\rpclib\rpclib-2.2.1\build mkdir external\rpclib\rpclib-2.2.1\build
cd external\rpclib\rpclib-2.2.1\build
IF NOT EXIST external\rpclib\%RPC_VERSION_FOLDER%\build mkdir external\rpclib\%RPC_VERSION_FOLDER%\build
cd external\rpclib\%RPC_VERSION_FOLDER%\build
cmake -G"Visual Studio 16 2019" ..

if "%buildMode%" == "" (
Expand All @@ -115,13 +116,13 @@ set RPCLIB_TARGET_LIB=AirLib\deps\rpclib\lib\x64
if NOT exist %RPCLIB_TARGET_LIB% mkdir %RPCLIB_TARGET_LIB%
set RPCLIB_TARGET_INCLUDE=AirLib\deps\rpclib\include
if NOT exist %RPCLIB_TARGET_INCLUDE% mkdir %RPCLIB_TARGET_INCLUDE%
robocopy /MIR external\rpclib\rpclib-2.2.1\include %RPCLIB_TARGET_INCLUDE%
robocopy /MIR external\rpclib\%RPC_VERSION_FOLDER%\include %RPCLIB_TARGET_INCLUDE%

if "%buildMode%" == "" (
robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug
robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release
robocopy /MIR external\rpclib\%RPC_VERSION_FOLDER%\build\Debug %RPCLIB_TARGET_LIB%\Debug
robocopy /MIR external\rpclib\%RPC_VERSION_FOLDER%\build\Release %RPCLIB_TARGET_LIB%\Release
) else (
robocopy /MIR external\rpclib\rpclib-2.2.1\build\%buildMode% %RPCLIB_TARGET_LIB%\%buildMode%
robocopy /MIR external\rpclib\%RPC_VERSION_FOLDER%\build\%buildMode% %RPCLIB_TARGET_LIB%\%buildMode%
)

REM //---------- get High PolyCount SUV Car Model ------------
Expand Down
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ done
function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; }

# check for rpclib
if [ ! -d "./external/rpclib/rpclib-2.2.1" ]; then
RPC_VERSION_FOLDER="rpclib-2.3.0"
if [ ! -d "./external/rpclib/$RPC_VERSION_FOLDER" ]; then
echo "ERROR: new version of AirSim requires newer rpclib."
echo "please run setup.sh first and then run build.sh again."
exit 1
Expand Down Expand Up @@ -108,7 +109,7 @@ cp $build_dir/output/lib/librpc.a AirLib/deps/rpclib/lib/librpc.a

# Update AirLib/lib, AirLib/deps, Plugins folders with new binaries
rsync -a --delete $build_dir/output/lib/ AirLib/lib/x64/$folder_name
rsync -a --delete external/rpclib/rpclib-2.2.1/include AirLib/deps/rpclib
rsync -a --delete external/rpclib/$RPC_VERSION_FOLDER/include AirLib/deps/rpclib
rsync -a --delete MavLinkCom/include AirLib/deps/MavLinkCom
rsync -a --delete AirLib Unreal/Plugins/AirSim/Source
rm -rf Unreal/Plugins/AirSim/Source/AirLib/src
Expand Down
8 changes: 4 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,19 @@ fi # End USB setup, CMake install


# Download rpclib
if [ ! -d "external/rpclib/rpclib-2.2.1" ]; then
if [ ! -d "external/rpclib/rpclib-2.3.0" ]; then
echo "*********************************************************************************************"
echo "Downloading rpclib..."
echo "*********************************************************************************************"

wget https://github.com/madratman/rpclib/archive/v2.2.1.zip
wget https://github.com/rpclib/rpclib/archive/v2.3.0.zip

# remove previous versions
rm -rf "external/rpclib"

mkdir -p "external/rpclib"
unzip -q v2.2.1.zip -d external/rpclib
rm v2.2.1.zip
unzip -q v2.3.0.zip -d external/rpclib
rm v2.3.0.zip
fi

# Download high-polycount SUV model
Expand Down

0 comments on commit 2362d76

Please sign in to comment.