diff --git a/build.cmd b/build.cmd index 5f0c725..45666d6 100644 --- a/build.cmd +++ b/build.cmd @@ -1,40 +1,23 @@ @echo off cd %~dp0 -RMDIR /S /Q src\JabbR\wwwroot\lib\* +IF EXIST artifacts\ RMDIR /S /Q artifacts\ +IF EXIST src\JabbR\wwwroot\lib\ RMDIR /S /Q src\JabbR\wwwroot\lib\ SETLOCAL -SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe +SET CACHED_DNVM=%USERPROFILE%\.dnx\bin\dnvm.cmd +SET DNX_UNSTABLE_FEED=https://www.myget.org/F/aspnetrelease/api/v2 -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%'" +IF EXIST %CACHED_DNVM% GOTO dnvminstall +echo Installing dnvm +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}" -:copynuget -IF EXIST .nuget\nuget.exe goto restore -md .nuget -copy %CACHED_NUGET% .nuget\nuget.exe > nul +:dnvminstall +echo Installing dnx... +CALL dnvm install 1.0.0-beta5-11911 -u -:restore -IF EXIST packages\KoreBuild goto run -IF DEFINED BUILDCMD_RELEASE ( - .nuget\NuGet.exe install KoreBuild -version 0.2.1-%BUILDCMD_RELEASE% -ExcludeVersion -o packages -nocache -pre -) ELSE ( - .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre -source https://www.myget.org/F/aspnetmaster/api/v2 -) -.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion +echo Restoring... +CALL dnu restore src/JabbR -IF "%SKIP_DNX_INSTALL%"=="1" goto run -IF DEFINED BUILDCMD_RELEASE ( - CALL packages\KoreBuild\build\dnvm install 1.0.0-%BUILDCMD_RELEASE% -runtime CLR -arch x86 -a default -) ELSE ( - CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86 -) -CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86 - -:run -CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 -packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* - -CALL packages\KoreBuild\build\dnu publish src/JabbR --no-source --out artifacts/build/jabbr --runtime active \ No newline at end of file +echo Publishing... +CALL dnu publish src/JabbR --no-source --out artifacts/build/jabbr --runtime active diff --git a/build.sh b/build.sh index 1b48bf5..7b51a24 100755 --- a/build.sh +++ b/build.sh @@ -1,42 +1,15 @@ #!/bin/bash -rm -rf src/JabbR/wwwroot/lib - -if test `uname` = Darwin; then - cachedir=~/Library/Caches/KBuild -else - if [ -z $XDG_DATA_HOME ]; then - cachedir=$HOME/.local/share - else - cachedir=$XDG_DATA_HOME; - fi -fi -mkdir -p $cachedir - -url=https://www.nuget.org/nuget.exe - -if test ! -f $cachedir/nuget.exe; then - wget -O $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null -fi - -if test ! -e .nuget; then - mkdir .nuget - cp $cachedir/nuget.exe .nuget/nuget.exe -fi - -if test ! -d packages/KoreBuild; then - mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre - mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion -fi +rm -rf artifacts/* src/JabbR/wwwroot/lib/* if ! type dnvm > /dev/null 2>&1; then - source packages/KoreBuild/build/dnvm.sh -fi - -if ! type dnx > /dev/null 2>&1; then - dnvm upgrade + curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | sh && source ~/.dnx/dnvm/dnvm.sh fi +export DNX_UNSTABLE_FEED=https://www.myget.org/F/aspnetrelease/api/v2 +dnvm install 1.0.0-beta5-11911 -u +dnu restore src/JabbR -mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" +rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -dnu publish src/JabbR --no-source --out artifacts/build/jabbr --runtime active \ No newline at end of file +dnu publish src/JabbR --no-source --out artifacts/build/jabbr --runtime active 2>&1 | tee buildlog +grep "Build succeeded" buildlog \ No newline at end of file