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

Commit 9cfd22f

Browse files
author
Victor Hurdugaci
committed
Build with dotnet
1 parent f4e4e53 commit 9cfd22f

File tree

19 files changed

+233
-124
lines changed

19 files changed

+233
-124
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ nuget.exe
2525
*.ipch
2626
*.sln.ide
2727
project.lock.json
28-
.vs
28+
.vs
29+
.build/
30+
.testPublish/

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ addons:
1010
- libssl-dev
1111
- libunwind8
1212
- zlib1g
13+
mono:
14+
- 4.0.5
1315
os:
1416
- linux
1517
- osx
16-
env:
17-
- KOREBUILD_DNU_RESTORE_CORECLR=true KOREBUILD_TEST_DNXCORE=true
18-
mono:
19-
- 4.0.5
18+
osx_image: xcode7.1
2019
script:
21-
- ./build.sh --quiet verify
20+
- ./build.sh verify

appveyor.yml

Lines changed: 1 addition & 1 deletion
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

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 "$@"

src/Microsoft.Extensions.Configuration.FileExtensions/FileConfigurationExtensions.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ public static string GetBasePath(this IConfigurationBuilder configurationBuilder
5050
}
5151

5252
#if NET451
53-
var stringBasePath =
54-
AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") as string ??
55-
AppDomain.CurrentDomain.BaseDirectory ??
56-
string.Empty;
53+
var stringBasePath = AppDomain.CurrentDomain.BaseDirectory ?? string.Empty;
5754

58-
// On Mono, the value of APP_CONTEXT_BASE_DIRECTORY is ".". We'll expand it to get the full base path.
5955
return Path.GetFullPath(stringBasePath);
6056
#else
6157
return AppContext.BaseDirectory ?? string.Empty;

src/Microsoft.Extensions.Configuration.FileProviderExtensions/ConfigurationRootExtensions.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@ public static IConfigurationRoot ReloadOnChanged(this IConfigurationRoot config,
2121
throw new ArgumentNullException(nameof(filename));
2222
}
2323
#if NET451
24-
var basePath =
25-
AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") as string ??
26-
AppDomain.CurrentDomain.BaseDirectory ??
27-
string.Empty;
28-
29-
// On Mono, the value of APP_CONTEXT_BASE_DIRECTORY is ".". We'll expand it to get the full base path.
30-
basePath = Path.GetFullPath(basePath);
24+
var basePath = AppDomain.CurrentDomain.BaseDirectory ?? string.Empty;
3125
#else
3226
var basePath = AppContext.BaseDirectory ?? string.Empty;
3327
#endif

test/Microsoft.Extensions.Configuration.Binder.Test/project.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@
66
"dependencies": {
77
"Microsoft.Extensions.Configuration.Binder": "1.0.0-*",
88
"Microsoft.Extensions.Configuration.Test.Common": "1.0.0-*",
9-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
9+
"xunit": "2.1.0"
1010
},
1111
"frameworks": {
12-
"dnx451": { },
13-
"dnxcore50": { }
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+
}
1426
},
27+
"testRunner": "xunit",
1528
"commands": {
1629
"test": "xunit.runner.aspnet"
1730
}

test/Microsoft.Extensions.Configuration.CommandLine.Test/project.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@
66
"dependencies": {
77
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0-*",
88
"Microsoft.Extensions.Configuration.Test.Common": "1.0.0-*",
9-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
9+
"xunit": "2.1.0"
1010
},
1111
"frameworks": {
12-
"dnx451": { },
13-
"dnxcore50": { }
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+
}
1426
},
27+
"testRunner": "xunit",
1528
"commands": {
1629
"test": "xunit.runner.aspnet"
1730
}

test/Microsoft.Extensions.Configuration.EnvironmentVariables.Test/project.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@
66
"dependencies": {
77
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-*",
88
"Microsoft.Extensions.Configuration.Test.Common": "1.0.0-*",
9-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
9+
"xunit": "2.1.0"
1010
},
1111
"frameworks": {
12-
"dnx451": { },
13-
"dnxcore50": {
12+
"dnx451": {
13+
"frameworkAssemblies": {
14+
"System.Runtime": "",
15+
"System.Threading.Tasks": ""
16+
},
1417
"dependencies": {
15-
"System.Runtime": "4.0.21-*"
18+
"xunit.runner.console": "2.1.0"
19+
}
20+
},
21+
"dnxcore50": {
22+
"dependencies": {
23+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
1624
}
1725
}
1826
},
27+
"testRunner": "xunit",
1928
"commands": {
2029
"test": "xunit.runner.aspnet"
2130
}

test/Microsoft.Extensions.Configuration.FileExtensions.Test/FileConfigurationBuilderExtensionsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void GetBasePath_ReturnBaseDirectoryIfNotSet()
5959
#if DNXCORE50
6060
expectedPath = AppContext.BaseDirectory;
6161
#else
62-
expectedPath = Path.GetFullPath((string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY"));
62+
expectedPath = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
6363
#endif
6464

6565
// Assert

test/Microsoft.Extensions.Configuration.FileExtensions.Test/project.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@
66
"dependencies": {
77
"Microsoft.Extensions.Configuration": "1.0.0-*",
88
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-*",
9-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
9+
"xunit": "2.1.0"
1010
},
1111
"frameworks": {
12-
"dnx451": { },
13-
"dnxcore50": {
12+
"dnx451": {
13+
"frameworkAssemblies": {
14+
"System.Runtime": "",
15+
"System.Threading.Tasks": ""
16+
},
1417
"dependencies": {
15-
"System.AppContext": "4.0.0-*"
18+
"xunit.runner.console": "2.1.0"
19+
}
20+
},
21+
"dnxcore50": {
22+
"dependencies": {
23+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
1624
}
1725
}
1826
},
27+
"testRunner": "xunit",
1928
"commands": {
2029
"test": "xunit.runner.aspnet"
2130
}

test/Microsoft.Extensions.Configuration.FileProviderExtensions.Test/project.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22
"dependencies": {
33
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-*",
44
"Microsoft.Extensions.Configuration.Test.Common": "1.0.0-*",
5-
"xunit.runner.aspnet": "2.0.0-aspnet-*"
5+
"xunit": "2.1.0"
66
},
77
"frameworks": {
8-
"dnx451": { },
9-
"dnxcore50": { }
8+
"dnx451": {
9+
"frameworkAssemblies": {
10+
"System.Runtime": "",
11+
"System.Threading.Tasks": ""
12+
},
13+
"dependencies": {
14+
"xunit.runner.console": "2.1.0"
15+
}
16+
},
17+
"dnxcore50": {
18+
"dependencies": {
19+
"xunit.runner.aspnet": "2.0.0-aspnet-*"
20+
}
21+
}
1022
},
23+
"testRunner": "xunit",
1124
"commands": {
1225
"test": "xunit.runner.aspnet"
1326
}

test/Microsoft.Extensions.Configuration.FunctionalTests/ConfigurationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public void GetDefaultBasePathForSources()
246246
#if DNXCORE50
247247
filePath = AppContext.BaseDirectory;
248248
#else
249-
filePath = Path.GetFullPath((string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY"));
249+
filePath = Path.GetFullPath((string)AppDomain.CurrentDomain.BaseDirectory);
250250
#endif
251251

252252
var jsonConfigFilePath = Path.Combine(filePath, "test.json");

0 commit comments

Comments
 (0)