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

Commit e7bf0e7

Browse files
author
Victor Hurdugaci
committed
Build with dotnet
1 parent 05c476d commit e7bf0e7

File tree

12 files changed

+192
-93
lines changed

12 files changed

+192
-93
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@
4848
*.fsproj text=auto
4949
*.dbproj text=auto
5050
*.sln text=auto eol=crlf
51+
52+
*.sh eol=lf

.gitignore

Lines changed: 2 additions & 0 deletions
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

Lines changed: 5 additions & 3 deletions
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

Lines changed: 32 additions & 32 deletions
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

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/usr/bin/env bash
22

3+
SOURCE="${BASH_SOURCE[0]}"
4+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
5+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
6+
SOURCE="$(readlink "$SOURCE")"
7+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
8+
done
9+
repoFolder="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
10+
11+
buildFolder=.build
12+
koreBuildFolder=$buildFolder/KoreBuild-dotnet
13+
14+
nugetPath=$buildFolder/nuget.exe
15+
316
if test `uname` = Darwin; then
417
cachedir=~/Library/Caches/KBuild
518
else
@@ -11,33 +24,25 @@ else
1124
fi
1225
mkdir -p $cachedir
1326
nugetVersion=latest
14-
cachePath=$cachedir/nuget.$nugetVersion.exe
27+
cacheNuget=$cachedir/nuget.$nugetVersion.exe
1528

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

18-
if test ! -f $cachePath; then
19-
wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null
31+
if test ! -d $buildFolder; then
32+
mkdir $buildFolder
2033
fi
2134

22-
if test ! -e .nuget; then
23-
mkdir .nuget
24-
cp $cachePath .nuget/nuget.exe
25-
fi
35+
if test ! -f $nugetPath; then
36+
if test ! -f $cacheNuget; then
37+
wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null
38+
fi
2639

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
40+
cp $cacheNuget $nugetPath
3041
fi
3142

32-
if ! type dnvm > /dev/null 2>&1; then
33-
source packages/KoreBuild/build/dnvm.sh
43+
if test ! -d $koreBuildFolder; then
44+
mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre
3445
fi
3546

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
41-
fi
47+
source $koreBuildFolder/build/KoreBuild.sh
4248

43-
mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@"

test/Microsoft.AspNet.Http.Abstractions.Tests/project.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@
66
"dependencies": {
77
"Microsoft.AspNet.Http": "1.0.0-*",
88
"Microsoft.AspNet.Testing": "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+
},
17+
"dependencies": {
18+
"xunit.runner.console": "2.1.0"
19+
}
20+
},
21+
"dnxcore50": {
22+
"dependencies": {
23+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
24+
}
25+
}
26+
},
27+
"testRunner": "xunit",
1128
"commands": {
1229
"test": "xunit.runner.aspnet"
13-
},
14-
"frameworks": {
15-
"dnx451": { },
16-
"dnxcore50": { }
1730
}
1831
}

test/Microsoft.AspNet.Http.Extensions.Tests/project.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,26 @@
33
"Microsoft.AspNet.Http": "1.0.0-*",
44
"Microsoft.AspNet.Http.Extensions": "1.0.0-*",
55
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
6-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
6+
"xunit": "2.1.0"
77
},
8+
"frameworks": {
9+
"dnx451": {
10+
"frameworkAssemblies": {
11+
"System.Runtime": "",
12+
"System.Threading.Tasks": ""
13+
},
14+
"dependencies": {
15+
"xunit.runner.console": "2.1.0"
16+
}
17+
},
18+
"dnxcore50": {
19+
"dependencies": {
20+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
21+
}
22+
}
23+
},
24+
"testRunner": "xunit",
825
"commands": {
926
"test": "xunit.runner.aspnet"
10-
},
11-
"frameworks": {
12-
"dnx451": { },
13-
"dnxcore50": { }
1427
}
1528
}
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
{
22
"dependencies": {
33
"Microsoft.AspNet.Http.Features": "1.0.0-*",
4-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
4+
"xunit": "2.1.0"
55
},
6+
"frameworks": {
7+
"dnx451": {
8+
"frameworkAssemblies": {
9+
"System.Runtime": "",
10+
"System.Threading.Tasks": ""
11+
},
12+
"dependencies": {
13+
"xunit.runner.console": "2.1.0"
14+
}
15+
},
16+
"dnxcore50": {
17+
"dependencies": {
18+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
19+
}
20+
}
21+
},
22+
"testRunner": "xunit",
623
"commands": {
724
"test": "xunit.runner.aspnet"
8-
},
9-
"frameworks": {
10-
"dnx451": { },
11-
"dnxcore50": { }
1225
}
1326
}
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
{
22
"dependencies": {
33
"Microsoft.AspNet.Http": "1.0.0-*",
4-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
4+
"xunit": "2.1.0"
55
},
6+
"frameworks": {
7+
"dnx451": {
8+
"frameworkAssemblies": {
9+
"System.Runtime": "",
10+
"System.Threading.Tasks": ""
11+
},
12+
"dependencies": {
13+
"xunit.runner.console": "2.1.0"
14+
}
15+
},
16+
"dnxcore50": {
17+
"dependencies": {
18+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
19+
}
20+
}
21+
},
22+
"testRunner": "xunit",
623
"commands": {
724
"test": "xunit.runner.aspnet"
8-
},
9-
"frameworks": {
10-
"dnx451": { },
11-
"dnxcore50": { }
1225
}
1326
}

test/Microsoft.AspNet.Owin.Tests/project.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,26 @@
33
"Microsoft.AspNet.Http": "1.0.0-*",
44
"Microsoft.AspNet.Owin": "1.0.0-*",
55
"Microsoft.Extensions.DependencyInjection": "1.0.0-*",
6-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
6+
"xunit": "2.1.0"
77
},
8+
"frameworks": {
9+
"dnx451": {
10+
"frameworkAssemblies": {
11+
"System.Runtime": "",
12+
"System.Threading.Tasks": ""
13+
},
14+
"dependencies": {
15+
"xunit.runner.console": "2.1.0"
16+
}
17+
},
18+
"dnxcore50": {
19+
"dependencies": {
20+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
21+
}
22+
}
23+
},
24+
"testRunner": "xunit",
825
"commands": {
926
"test": "xunit.runner.aspnet"
10-
},
11-
"frameworks": {
12-
"dnx451": { },
13-
"dnxcore50": { }
1427
}
1528
}

0 commit comments

Comments
 (0)