Updating to use Dotnet-Cli build

This commit is contained in:
Pranav K 2016-01-11 16:10:34 -08:00
parent 1da673e0e2
commit 9c6e5f714a
10 changed files with 100 additions and 72 deletions

2
.gitattributes vendored
View File

@ -48,3 +48,5 @@
*.fsproj text=auto *.fsproj text=auto
*.dbproj text=auto *.dbproj text=auto
*.sln text=auto eol=crlf *.sln text=auto eol=crlf
*.sh eol=lf

7
.gitignore vendored
View File

@ -2,10 +2,13 @@
[Bb]in/ [Bb]in/
TestResults/ TestResults/
.nuget/ .nuget/
.build/
.testPublish/
*.sln.ide/ *.sln.ide/
_ReSharper.*/ _ReSharper.*/
packages/ packages/
artifacts/ artifacts/
.build/
PublishProfiles/ PublishProfiles/
*.user *.user
*.suo *.suo
@ -13,6 +16,7 @@ PublishProfiles/
*.docstates *.docstates
_ReSharper.* _ReSharper.*
nuget.exe nuget.exe
project.lock.json
*net45.csproj *net45.csproj
*net451.csproj *net451.csproj
*k10.csproj *k10.csproj
@ -24,5 +28,4 @@ nuget.exe
*.ncrunchsolution *.ncrunchsolution
*.*sdf *.*sdf
*.ipch *.ipch
project.lock.json .build/
.vs

View File

@ -13,11 +13,12 @@ addons:
before_install: before_install:
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install icu4c; fi - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install icu4c; fi
env: env:
- KOREBUILD_DNU_RESTORE_CORECLR=true MONO_THREADS_PER_CPU=2000 KOREBUILD_TEST_DNXCORE=true - MONO_THREADS_PER_CPU=2000
mono: mono:
- 4.0.5 - 4.0.5
os: os:
- linux - linux
- osx - osx
osx_image: xcode7.1
script: script:
- ./build.sh --quiet verify - ./build.sh --quiet verify

View File

@ -1,40 +1,40 @@
@echo off @ECHO off
cd %~dp0
SETLOCAL SETLOCAL
SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"
SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=
SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=
SET BUILDCMD_DNX_VERSION=
IF EXIST %CACHED_NUGET% goto copynuget IF NOT EXIST %BUILD_FOLDER% (
echo Downloading latest version of NuGet.exe... md %BUILD_FOLDER%
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul
:restore
IF EXIST packages\Sake goto getdnx
IF "%BUILDCMD_KOREBUILD_VERSION%"=="" (
.nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
.nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
:getdnx
IF "%BUILDCMD_DNX_VERSION%"=="" (
SET BUILDCMD_DNX_VERSION=latest
)
IF "%SKIP_DNX_INSTALL%"=="" (
CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
) )
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* IF NOT EXIST %NUGET_PATH% (
IF NOT EXIST %CACHED_NUGET% (
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://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
)
copy %CACHED_NUGET% %NUGET_PATH% > nul
)
IF NOT EXIST %KOREBUILD_FOLDER% (
SET KOREBUILD_DOWNLOAD_ARGS=
IF NOT "%KOREBUILD_VERSION%"=="" (
SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
)
%BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)
"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

View File

@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $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
done
repoFolder="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
buildFolder=.build
koreBuildFolder=$buildFolder/KoreBuild-dotnet
nugetPath=$buildFolder/nuget.exe
if test `uname` = Darwin; then if test `uname` = Darwin; then
cachedir=~/Library/Caches/KBuild cachedir=~/Library/Caches/KBuild
else else
@ -11,33 +24,25 @@ else
fi fi
mkdir -p $cachedir mkdir -p $cachedir
nugetVersion=latest nugetVersion=latest
cachePath=$cachedir/nuget.$nugetVersion.exe cacheNuget=$cachedir/nuget.$nugetVersion.exe
url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe nugetUrl=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe
if test ! -f $cachePath; then if test ! -d $buildFolder; then
wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null mkdir $buildFolder
fi fi
if test ! -e .nuget; then if test ! -f $nugetPath; then
mkdir .nuget if test ! -f $cacheNuget; then
cp $cachePath .nuget/nuget.exe wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null
fi
cp $cacheNuget $nugetPath
fi fi
if test ! -d packages/Sake; then if test ! -d $koreBuildFolder; then
mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre
mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
fi fi
if ! type dnvm > /dev/null 2>&1; then source $koreBuildFolder/build/KoreBuild.sh
source packages/KoreBuild/build/dnvm.sh
fi
if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then
dnvm install latest -runtime coreclr -alias default
dnvm install default -runtime mono -alias default
else
dnvm use default -runtime mono
fi
mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@"

View File

@ -16,7 +16,7 @@
} }
}, },
"frameworks": { "frameworks": {
"net451": {}, "net451": { },
"dotnet5.4": { "dotnet5.4": {
"dependencies": { "dependencies": {
"System.IO.FileSystem": "4.0.1-*", "System.IO.FileSystem": "4.0.1-*",

View File

@ -32,14 +32,15 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
// These test assemblies don't really exist. They are used to look up corresponding XML for a fake assembly // These test assemblies don't really exist. They are used to look up corresponding XML for a fake assembly
// which is based on the DocumentedTagHelper type. // which is based on the DocumentedTagHelper type.
public static readonly string TestRoot =
Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", ".."));
public static readonly string DocumentedAssemblyLocation = public static readonly string DocumentedAssemblyLocation =
Directory.GetCurrentDirectory() + Path.Combine(TestRoot, "TestFiles", "NotLocalized", "TagHelperDocumentation.dll");
string.Format("{0}TestFiles{0}NotLocalized{0}TagHelperDocumentation.dll", Path.DirectorySeparatorChar);
public static readonly string LocalizedDocumentedAssemblyLocation = public static readonly string LocalizedDocumentedAssemblyLocation =
Directory.GetCurrentDirectory() + Path.Combine(TestRoot, "TestFiles", "Localized", "TagHelperDocumentation.dll");
string.Format("{0}TestFiles{0}Localized{0}TagHelperDocumentation.dll", Path.DirectorySeparatorChar);
public static readonly string DocumentedAssemblyCodeBase = public static readonly string DocumentedAssemblyCodeBase =
"file:" + new string(Path.DirectorySeparatorChar, 3) + "file:" +
new string(Path.DirectorySeparatorChar, 3) +
DocumentedAssemblyLocation.TrimStart(Path.DirectorySeparatorChar); DocumentedAssemblyLocation.TrimStart(Path.DirectorySeparatorChar);
public static TheoryData OutputElementHintData public static TheoryData OutputElementHintData

View File

@ -13,8 +13,10 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{ {
public class XmlDocumentationProviderTest public class XmlDocumentationProviderTest
{ {
public static readonly string XmlTestFileLocation = private static readonly string TestRoot =
Directory.GetCurrentDirectory() + "/TestFiles/NotLocalized/TagHelperDocumentation.xml"; Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", ".."));
private static readonly string XmlTestFileLocation =
TestRoot + "/TestFiles/NotLocalized/TagHelperDocumentation.xml";
private static readonly TypeInfo DocumentedTagHelperTypeInfo = typeof(DocumentedTagHelper).GetTypeInfo(); private static readonly TypeInfo DocumentedTagHelperTypeInfo = typeof(DocumentedTagHelper).GetTypeInfo();
private static readonly PropertyInfo DocumentedTagHelperSummaryPropertyInfo = private static readonly PropertyInfo DocumentedTagHelperSummaryPropertyInfo =
DocumentedTagHelperTypeInfo.GetProperty(nameof(DocumentedTagHelper.SummaryProperty)); DocumentedTagHelperTypeInfo.GetProperty(nameof(DocumentedTagHelper.SummaryProperty));

View File

@ -12,19 +12,26 @@
}, },
"Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.AspNet.Testing": "1.0.0-*",
"Microsoft.Extensions.WebEncoders": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*",
"xunit.runner.aspnet": "2.0.0-aspnet-*" "xunit": "2.1.0"
}, },
"testRunner": "xunit",
"commands": { "commands": {
"test": "xunit.runner.aspnet" "test": "xunit.runner.aspnet"
}, },
"frameworks": { "frameworks": {
"dnx451": { "dnx451": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.Threading.Tasks": ""
},
"dependencies": { "dependencies": {
"Moq": "4.2.1312.1622" "Moq": "4.2.1312.1622",
"xunit.runner.console": "2.1.0"
} }
}, },
"dnxcore50": { "dnxcore50": {
"dependencies": { "dependencies": {
"xunit.runner.aspnet": "2.0.0-aspnet-*",
"Microsoft.Extensions.HashCodeCombiner.Sources": { "Microsoft.Extensions.HashCodeCombiner.Sources": {
"type": "build", "type": "build",
"version": "1.0.0-*" "version": "1.0.0-*"

View File

@ -8,20 +8,27 @@
"type": "build" "type": "build"
}, },
"Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.AspNet.Testing": "1.0.0-*",
"xunit.runner.aspnet": "2.0.0-aspnet-*" "xunit": "2.1.0"
}, },
"testRunner": "xunit",
"commands": { "commands": {
"test": "xunit.runner.aspnet" "test": "xunit.runner.aspnet"
}, },
"frameworks": { "frameworks": {
"dnx451": { "dnx451": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.Threading.Tasks": ""
},
"dependencies": { "dependencies": {
"Moq": "4.2.1312.1622" "Moq": "4.2.1312.1622",
"xunit.runner.console": "2.1.0"
} }
}, },
"dnxcore50": { "dnxcore50": {
"dependencies": { "dependencies": {
"moq.netcore": "4.4.0-beta8" "moq.netcore": "4.4.0-beta8",
"xunit.runner.aspnet": "2.0.0-aspnet-*"
} }
} }
}, },