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

Commit 10fdfcc

Browse files
author
Victor Hurdugaci
committed
Build with dotnet
1 parent 2e1a8b3 commit 10fdfcc

File tree

11 files changed

+128
-81
lines changed

11 files changed

+128
-81
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@
4848
*.fsproj text=auto
4949
*.dbproj text=auto
5050
*.sln text=auto eol=crlf
51+
*.sh eol=lf

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ nuget.exe
2525
*.ipch
2626
*.sln.ide
2727
project.lock.json
28+
.build/
29+
.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 KOREBUILD_TEST_DNXCORE=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 verify

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
init:
22
- git config --global core.autocrlf true
33
build_script:
4-
- build.cmd --quiet verify
4+
- build.cmd verify
55
clone_depth: 1
66
test: off
77
deploy: off

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.Authentication.Test/project.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,26 @@
1212
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-*",
1313
"Microsoft.AspNet.TestHost": "1.0.0-*",
1414
"Microsoft.AspNet.Testing": "1.0.0-*",
15-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
15+
"xunit": "2.1.0"
1616
},
17+
"frameworks": {
18+
"dnx451": {
19+
"frameworkAssemblies": {
20+
"System.Runtime": "",
21+
"System.Threading.Tasks": ""
22+
},
23+
"dependencies": {
24+
"xunit.runner.console": "2.1.0"
25+
}
26+
},
27+
"dnxcore50": {
28+
"dependencies": {
29+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
30+
}
31+
}
32+
},
33+
"testRunner": "xunit",
1734
"commands": {
1835
"test": "xunit.runner.aspnet"
19-
},
20-
"frameworks": {
21-
"dnx451": { },
22-
"dnxcore50": { }
2336
}
2437
}

test/Microsoft.AspNet.Authorization.Test/project.json

+17-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,27 @@
55
"dependencies": {
66
"Microsoft.AspNet.Authorization": "1.0.0-*",
77
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
8-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
9-
},
10-
"commands": {
11-
"test": "xunit.runner.aspnet"
8+
"Microsoft.Extensions.Logging": "1.0.0-*",
9+
"xunit": "2.1.0"
1210
},
1311
"frameworks": {
1412
"dnx451": {
13+
"frameworkAssemblies": {
14+
"System.Runtime": "",
15+
"System.Threading.Tasks": ""
16+
},
17+
"dependencies": {
18+
"xunit.runner.console": "2.1.0"
19+
}
1520
},
16-
"dnxcore50": {
21+
"dnxcore50": {
22+
"dependencies": {
23+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
24+
}
1725
}
26+
},
27+
"testRunner": "xunit",
28+
"commands": {
29+
"test": "xunit.runner.aspnet"
1830
}
1931
}

test/Microsoft.AspNet.CookiePolicy.Test/project.json

+20-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,28 @@
66
"Microsoft.AspNet.CookiePolicy": "1.0.0-*",
77
"Microsoft.AspNet.TestHost": "1.0.0-*",
88
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
9-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
9+
"xunit": "2.1.0"
1010
},
11+
"frameworks": {
12+
"dnx451": {
13+
"frameworkAssemblies": {
14+
"System.Runtime": "",
15+
"System.Threading.Tasks": "",
16+
"System.Xml.Linq": ""
17+
},
18+
"dependencies": {
19+
"xunit.runner.console": "2.1.0"
20+
}
21+
},
22+
"dnxcore50": {
23+
"dependencies": {
24+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
25+
}
26+
}
27+
},
28+
"testRunner": "xunit",
1129
"commands": {
1230
"test": "xunit.runner.aspnet"
13-
},
14-
"frameworks": {
15-
"dnx451": { },
16-
"dnxcore50": { }
1731
}
32+
1833
}

test/Microsoft.Owin.Security.Interop.Test/project.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@
88
"Microsoft.Owin.Security.Cookies": "3.0.1",
99
"Microsoft.Owin.Security.Interop": "1.0.0-*",
1010
"Microsoft.Owin.Testing": "3.0.1",
11-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
11+
"xunit": "2.1.0",
12+
"xunit.runner.console": "2.1.0"
1213
},
14+
"frameworks": {
15+
"dnx451": {
16+
"frameworkAssemblies": {
17+
"System.Runtime": "",
18+
"System.Threading.Tasks": ""
19+
}
20+
}
21+
},
22+
"testRunner": "xunit",
1323
"commands": {
1424
"test": "xunit.runner.aspnet"
15-
},
16-
"frameworks": {
17-
"dnx451": { }
1825
}
1926
}

0 commit comments

Comments
 (0)