Skip to content
This repository was archived by the owner on Dec 28, 2017. It is now read-only.

Commit 33f25ec

Browse files
author
moozzyk
committed
Moving build to dotnet
Fixes #23
1 parent 6de5f54 commit 33f25ec

File tree

6 files changed

+64
-61
lines changed

6 files changed

+64
-61
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ nuget.exe
2727

2828
*.sln.ide
2929
project.lock.json
30+
runtimes/
31+
.build/
32+
.testPublish/

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ addons:
1010
- libssl-dev
1111
- libunwind8
1212
- zlib1g
13-
env:
14-
- KOREBUILD_DNU_RESTORE_CORECLR=true
1513
mono:
1614
- 4.0.5
15+
os:
16+
- linux
17+
- osx
18+
osx_image: xcode7.1
1719
script:
18-
- ./build.sh --quiet verify
20+
- ./build.sh --quiet verify

build.cmd

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
@echo off
2-
cd %~dp0
3-
1+
@ECHO off
42
SETLOCAL
3+
4+
SET REPO_FOLDER=%~dp0
5+
CD "%REPO_FOLDER%"
6+
7+
SET BUILD_FOLDER=.build
8+
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
9+
SET KOREBUILD_VERSION=
10+
11+
SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
512
SET NUGET_VERSION=latest
613
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
7-
SET BUILDCMD_KOREBUILD_VERSION=
8-
SET BUILDCMD_DNX_VERSION=
9-
10-
IF EXIST %CACHED_NUGET% goto copynuget
11-
echo Downloading latest version of NuGet.exe...
12-
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
13-
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
14-
15-
:copynuget
16-
IF EXIST .nuget\nuget.exe goto restore
17-
md .nuget
18-
copy %CACHED_NUGET% .nuget\nuget.exe > nul
19-
20-
:restore
21-
IF EXIST packages\Sake goto getdnx
22-
IF "%BUILDCMD_KOREBUILD_VERSION%"=="" (
23-
.nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
24-
) ELSE (
25-
.nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
14+
15+
IF NOT EXIST %BUILD_FOLDER% (
16+
md %BUILD_FOLDER%
2617
)
27-
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
2818

29-
:getdnx
30-
IF "%BUILDCMD_DNX_VERSION%"=="" (
31-
SET BUILDCMD_DNX_VERSION=latest
19+
IF NOT EXIST %NUGET_PATH% (
20+
IF NOT EXIST %CACHED_NUGET% (
21+
echo Downloading latest version of NuGet.exe...
22+
IF NOT EXIST %LocalAppData%\NuGet (
23+
md %LocalAppData%\NuGet
24+
)
25+
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
26+
)
27+
28+
copy %CACHED_NUGET% %NUGET_PATH% > nul
3229
)
33-
IF "%SKIP_DNX_INSTALL%"=="" (
34-
CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
35-
CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
36-
) ELSE (
37-
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
30+
31+
IF NOT EXIST %KOREBUILD_FOLDER% (
32+
SET KOREBUILD_DOWNLOAD_ARGS=
33+
IF NOT "%KOREBUILD_VERSION%"=="" (
34+
SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
35+
)
36+
37+
%BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
3838
)
3939

40-
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*
40+
"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

build.sh

+21-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env bash
22

3+
buildFolder=.build
4+
koreBuildFolder=$buildFolder/KoreBuild-dotnet
5+
6+
nugetPath=$buildFolder/nuget.exe
7+
38
if test `uname` = Darwin; then
49
cachedir=~/Library/Caches/KBuild
510
else
@@ -11,33 +16,30 @@ else
1116
fi
1217
mkdir -p $cachedir
1318
nugetVersion=latest
14-
cachePath=$cachedir/nuget.$nugetVersion.exe
19+
cacheNuget=$cachedir/nuget.$nugetVersion.exe
1520

16-
url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe
21+
nugetUrl=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe
1722

18-
if test ! -f $cachePath; then
19-
wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null
23+
if test ! -d $buildFolder; then
24+
mkdir $buildFolder
2025
fi
2126

22-
if test ! -e .nuget; then
23-
mkdir .nuget
24-
cp $cachePath .nuget/nuget.exe
25-
fi
27+
if test ! -f $nugetPath; then
28+
if test ! -f $cacheNuget; then
29+
wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null
30+
fi
2631

27-
if test ! -d packages/Sake; then
28-
mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
29-
mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
32+
cp $cacheNuget $nugetPath
3033
fi
3134

32-
if ! type dnvm > /dev/null 2>&1; then
33-
source packages/KoreBuild/build/dnvm.sh
35+
if test ! -d $koreBuildFolder; then
36+
mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre
37+
chmod +x $koreBuildFolder/build/KoreBuild.sh
3438
fi
3539

36-
if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then
37-
dnvm install latest -runtime coreclr -alias default
38-
dnvm install default -runtime mono -alias default
39-
else
40-
dnvm use default -runtime mono
40+
makeFile=makefile.shade
41+
if [ ! -e $makeFile ]; then
42+
makeFile=$koreBuildFolder/build/makefile.shade
4143
fi
4244

43-
mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@"
45+
./$koreBuildFolder/build/KoreBuild.sh -n $nugetPath -m $makeFile "$@"

makefile.shade

-7
This file was deleted.

test/Microsoft.AspNet.SignalR.Redis.Tests/Microsoft.AspNet.SignalR.Redis.Tests.xproj

+3
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
<PropertyGroup>
1414
<SchemaVersion>2.0</SchemaVersion>
1515
</PropertyGroup>
16+
<ItemGroup>
17+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
18+
</ItemGroup>
1619
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
1720
</Project>

0 commit comments

Comments
 (0)