Merge pull request #178 from Sridhar-MS/release-config

Add support to build release binaries in the repo.
This commit is contained in:
Sridhar Periyasamy 2015-11-11 20:06:00 -08:00
commit f029cb2734
2 changed files with 26 additions and 3 deletions

View file

@ -2,6 +2,13 @@
setlocal EnableDelayedExpansion
for %%a IN (%*) DO (
if /I "%%a"=="release" set CONFIGURATION=Release
if /I "%%a"=="debug" set CONFIGURATION=Debug
)
if "%CONFIGURATION%" equ "" set CONFIGURATION=Debug
REM UTC Timestamp of the last commit is used as the build number. This is for easy synchronization of build number between Windows, OSX and Linux builds.
REM Using powershell is way easier to retrive and format the timestamp in any way we want.
set LAST_COMMIT_TIMESTAMP=powershell -Command "& { $timestamp = git log -1 --format=%%ct ; $origin = New-Object -Type DateTime -ArgumentList 1970, 1, 1, 0, 0, 0, 0; $commitTime = $origin.AddSeconds($timestamp); echo $commitTime.ToString(\"yyyyMMdd-HHmmss\");}"
@ -17,7 +24,7 @@ if %ERRORLEVEL% neq 0 (
)
:continue
echo *** Building dotnet ***
echo *** Building dotnet - %CONFIGURATION% ***
call %~dp0scripts/bootstrap.cmd
if %errorlevel% neq 0 exit /b %errorlevel%

View file

@ -3,6 +3,22 @@
# $1 is passed to package to enable deb or pkg packaging
set -e
for i in "$@"
do
lowerI="$(echo $i | awk '{print tolower($0)}')"
case $lowerI in
release)
export CONFIGURATION=Release
;;
debug)
export CONFIGURATION=Debug
;;
*)
esac
done
[ -z "$CONFIGURATION" ] && CONFIGURATION=Debug
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
@ -20,7 +36,7 @@ else
export DOTNET_BUILD_VERSION=0.0.1-alpha-$(date -ud @$LAST_COMMIT_TIMESTAMP "+%Y%m%d-%H%M%S")
fi
echo Building dotnet tools verison - $DOTNET_BUILD_VERSION
echo Building dotnet tools verison - $DOTNET_BUILD_VERSION - $CONFIGURATION
if [ ! -z "$BUILD_IN_DOCKER" ]; then
export BUILD_COMMAND="/opt/code/scripts/bootstrap.sh"
@ -34,4 +50,4 @@ if [ ! -z "$PACKAGE_IN_DOCKER" ]; then
$DIR/scripts/dockerbuild.sh
else
$DIR/scripts/package.sh
fi
fi