Skip to content

Commit

Permalink
Build script update
Browse files Browse the repository at this point in the history
- Update *nix scripts to use the Net 4.6 framework
- Update *nix scripts to use 'msbuild' instead of 'xbuild' (Mono V5)
- Remove the 'NET_*' configuration option from scripts
- Update WebUtils.cs to define the option configuration directive  to use the .Net Http libraries as default
  • Loading branch information
greythane committed Dec 27, 2018
1 parent 49fb930 commit 0faf116
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
5 changes: 3 additions & 2 deletions WhiteCore/Framework/Utilities/WebUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define NET_HTTP // Use the .NET http service - .Net version 4.5+ required

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
#if NET_4_5
#if NET_HTTP
using System.Net.Http;
using System.Threading.Tasks;
#else
Expand All @@ -47,7 +48,7 @@ public static class WebUtils
{
const int m_defaultTimeout = 10000;

#if NET_4_5
#if NET_HTTP

/// <summary>
/// POST URL-encoded form data to a web service that returns LLSD or
Expand Down
16 changes: 9 additions & 7 deletions autobuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# March 2016
# Rowan Deppeler <greythane@gmail.com>
#
# Updated Dec 2018 to use NET 4.6 framework and msbuild (included in Mono V5+)

ARCH="x64"
CONFIG="Debug"
Expand Down Expand Up @@ -37,7 +39,7 @@ if [ $# -gt 0 ]; then
read -p "Configuration? (Release, Debug) [$CONFIG]: " conf
if [[ $conf == "Release" ]]; then CONFIG="Release"; fi
if [[ $conf == "release" ]]; then CONFIG="Release"; fi

bld="No"
if [[ $BUILD == true ]]; then bld="Yes"; fi

Expand Down Expand Up @@ -87,24 +89,24 @@ fi
# Configuring WhiteCore-Sim
if ! ${VERSIONONLY:=true}; then
echo "Configuring WhiteCore-Sim $ARCH $CONFIG build"
mono ./Prebuild.exe /target vs2010 /targetframework v4_5 /conditionals "LINUX;NET_4_5"
mono ./Prebuild.exe /target vs2015 /targetframework v4_6 /conditionals "LINUX"
fi

# Update version info
if [ -d ".git" ]; then
git log --pretty=format:"WhiteCore 0.9.4 (%cd.%h)" --date=short -n 1 > WhiteCoreSim/bin/.version;
if [ -d ".git" ]; then
git log --pretty=format:"WhiteCore 0.9.5 Dev (%cd.%h)" --date=short -n 1 > WhiteCoreSim/bin/.version;
echo "Version info updated"
fi

# Build WhiteCore-Sim
if $BUILD ; then
echo Building WhiteCore-Sim
xbuild WhiteCore.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
msbuild WhiteCore.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
echo Finished Building WhiteCore
echo Thank you for choosing WhiteCore-Sim
echo Please report any errors to our Github Issue Tracker https://github.com/WhiteCoreSim/WhiteCore-Dev/issues
else
echo "WhiteCore-Sim has been configured to compile with $ARCH $CONFIG options"
echo "To manually build, enter 'xbuild WhiteCore.sln' at the command prompt"
echo "To manually build, enter 'msbuild WhiteCore.sln' at the command prompt"

fi
fi
4 changes: 2 additions & 2 deletions runprebuild vs2015.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if exist Compile.*.bat (
pause

echo Calling Prebuild for target %vstudio% with framework %framework%...
Prebuild.exe /target vs2015 /targetframework v%framework% /conditionals ISWIN;NET_%framework%
Prebuild.exe /target vs2015 /targetframework v%framework% /conditionals ISWIN

echo.
echo Creating compile batch file for your convenience...
Expand All @@ -60,7 +60,7 @@ if %configuration%==release set cfg=/p:Configuration=Release
if %configuration%==debug set cfg=/p:Configuration=Debug
set filename=Compile.VS%vstudio%.net%framework%.%bits%.%configuration%.bat

echo %fpath% WhiteCore.sln %args% %cfg% > %filename% /p:DefineConstants="ISWIN;NET_%framework%"
echo %fpath% WhiteCore.sln %args% %cfg% > %filename% /p:DefineConstants="ISWIN"

echo.
set /p compile_at_end="Done, %filename% created. Compile now? (y,n) [%compile_at_end%]"
Expand Down
2 changes: 1 addition & 1 deletion runprebuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ if %configuration%==release set cfg=/p:Configuration=Release
if %configuration%==debug set cfg=/p:Configuration=Debug
set filename=Compile.VS%vstudio%.net%framework%.%bits%.%configuration%.bat

echo %fpath% WhiteCore.sln %args% %cfg% > %filename% /p:DefineConstants="ISWIN;NET_%framework%"
echo %fpath% WhiteCore.sln %args% %cfg% > %filename% /p:DefineConstants="ISWIN"

echo.
set /p compile_at_end="Done, %filename% created. Compile now? (y,n) [%compile_at_end%]"
Expand Down
8 changes: 5 additions & 3 deletions runprebuild.command
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# May 2016
# Rowan Deppeler <greythane@gmail.com>
#
# Updated Dec 2018 to use NET 4.6 framework and msbuild (included in Mono V5+)

# find and change to the current folder (bash does not start here by default)
WCSDIR="${0%/*}"
Expand Down Expand Up @@ -94,7 +96,7 @@ fi
# Configuring WhiteCore-Sim
if ! ${VERSIONONLY:=true}; then
echo "Configuring WhiteCore-Sim $ARCH $CONFIG build"
mono ./Prebuild.exe /target vs2015 /targetframework v4_6 /conditionals "LINUX;NET_4_7"
mono ./Prebuild.exe /target vs2015 /targetframework v4_6 /conditionals "LINUX"
fi

# Update version info
Expand All @@ -106,11 +108,11 @@ fi
# Build WhiteCore-Sim
if ${BUILD:=true} ; then
echo Building WhiteCore-Sim
xbuild WhiteCore.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
msbuild WhiteCore.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
echo Finished Building WhiteCore
echo Thank you for choosing WhiteCore-Sim
echo Please report any errors to our Github Issue Tracker https://github.com/WhiteCoreSim/WhiteCore-Dev/issues
else
echo "WhiteCore-Sim has been configured to compile with $ARCH $CONFIG options"
echo "To manually build, enter 'xbuild WhiteCore.sln' at the command prompt"
echo "To manually build, enter 'msbuild WhiteCore.sln' at the command prompt"
fi
8 changes: 5 additions & 3 deletions runprebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# November 2015
# Rowan Deppeler <greythane@gmail.com>
#
# Updated Dec 2018 to use NET 4.6 framework, msbuild (included in Mono V5+)

ARCH="x64"
CONFIG="Debug"
Expand Down Expand Up @@ -87,7 +89,7 @@ fi
# Configuring WhiteCore-Sim
if ! ${VERSIONONLY:=true}; then
echo "Configuring WhiteCore-Sim $ARCH $CONFIG build"
mono ./Prebuild.exe /target vs2015 /targetframework v4_6 /conditionals "LINUX;NET_4_7"
mono ./Prebuild.exe /target vs2015 /targetframework v4_6 /conditionals "LINUX"
fi

# Update version info
Expand All @@ -99,11 +101,11 @@ fi
# Build WhiteCore-Sim
if ${BUILD:=true} ; then
echo Building WhiteCore-Sim
xbuild WhiteCore.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
msbuild WhiteCore.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
echo Finished Building WhiteCore
echo Thank you for choosing WhiteCore-Sim
echo Please report any errors to our Github Issue Tracker https://github.com/WhiteCoreSim/WhiteCore-Dev/issues
else
echo "WhiteCore-Sim has been configured to compile with $ARCH $CONFIG options"
echo "To manually build, enter 'xbuild WhiteCore.sln' at the command prompt"
echo "To manually build, enter 'msbuild WhiteCore.sln' at the command prompt"
fi

0 comments on commit 0faf116

Please sign in to comment.