Skip to content

Commit

Permalink
Removed download of local NuGet.exe copy and cleaned up formatting in…
Browse files Browse the repository at this point in the history
… build.cmd.
  • Loading branch information
alexmg committed Apr 12, 2015
1 parent 14eb27a commit c7e1bb8
Showing 1 changed file with 31 additions and 44 deletions.
75 changes: 31 additions & 44 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,72 +1,59 @@
@echo off
pushd %~dp0
@ECHO OFF

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto dnvminstall
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul
PUSHD %~dp0

:dnvminstall
set "DNX_NUGET_API_URL=https://www.nuget.org/api/v2"
setlocal EnableDelayedExpansion
SETLOCAL EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
IF %ERRORLEVEL% neq 0 (
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
set PATH=!PATH!;!userprofile!\.dnx\bin
set DNX_HOME=!USERPROFILE!\.dnx
goto install
SET PATH=!PATH!;!userprofile!\.dnx\bin
SET DNX_HOME=!USERPROFILE!\.dnx
GOTO install
)

:install
call dnvm install 1.0.0-beta5-11511 -r CoreCLR
call dnvm install 1.0.0-beta5-11511 -r CLR
CALL dnvm install 1.0.0-beta5-11511 -r CoreCLR
CALL dnvm install 1.0.0-beta5-11511 -r CLR

:restore
call dnu restore src\Autofac
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnu restore src\Autofac
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnu restore src\Autofac.Dnx
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnu restore src\Autofac.Dnx
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnu restore test\Autofac.Test
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnu restore test\Autofac.Test
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnu restore test\Autofac.Dnx.Test
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnu restore test\Autofac.Dnx.Test
IF %errorlevel% neq 0 EXIT /b %errorlevel%

:pack
SETLOCAL ENABLEEXTENSIONS
IF ERRORLEVEL 1 ECHO Unable to enable extensions
IF DEFINED APPVEYOR_BUILD_NUMBER (SET DNX_BUILD_VERSION=%APPVEYOR_BUILD_NUMBER%) ELSE (SET DNX_BUILD_VERSION=1)
ECHO DNX_BUILD_VERSION=%DNX_BUILD_VERSION%

call dnu pack src\Autofac --configuration Release --out artifacts\packages
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnu pack src\Autofac --configuration Release --out artifacts\packages
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnu pack src\Autofac.Dnx --configuration Release --out artifacts\packages
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnu pack src\Autofac.Dnx --configuration Release --out artifacts\packages
IF %errorlevel% neq 0 EXIT /b %errorlevel%

:test
call dnx test\Autofac.Test test
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnx test\Autofac.Test test
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnx test\Autofac.Dnx.Test test
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnx test\Autofac.Dnx.Test test
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnvm use 1.0.0-beta5-11511 -r CoreCLR
CALL dnvm use 1.0.0-beta5-11511 -r CoreCLR

call dnx test\Autofac.Test test
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnx test\Autofac.Test test
IF %errorlevel% neq 0 EXIT /b %errorlevel%

call dnx test\Autofac.Dnx.Test test
if %errorlevel% neq 0 exit /b %errorlevel%
CALL dnx test\Autofac.Dnx.Test test
IF %errorlevel% neq 0 EXIT /b %errorlevel%

popd
POPD

0 comments on commit c7e1bb8

Please sign in to comment.