Build with dotnet

This commit is contained in:
Victor Hurdugaci 2016-02-04 16:29:04 -08:00
parent 6eb091052d
commit e9921a75a2
11 changed files with 79 additions and 86 deletions

1
.gitattributes vendored
View File

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

4
.gitignore vendored
View File

@ -25,4 +25,6 @@ project.lock.json
*.ncrunchsolution
*.*sdf
*.ipch
*.vs/
*.vs/
.testPublish/
.build/

View File

@ -1,42 +1,40 @@
@echo off
cd %~dp0
@ECHO off
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 CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=
SET BUILDCMD_DNX_VERSION=
IF EXIST %CACHED_NUGET% goto copynuget
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%'"
: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 CoreCLR -arch x64
CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x64
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
IF NOT EXIST %BUILD_FOLDER% (
md %BUILD_FOLDER%
)
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,10 @@
#!/usr/bin/env bash
buildFolder=.build
koreBuildFolder=$buildFolder/KoreBuild-dotnet
nugetPath=$buildFolder/nuget.exe
if test `uname` = Darwin; then
cachedir=~/Library/Caches/KBuild
else
@ -11,33 +16,30 @@ else
fi
mkdir -p $cachedir
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
wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null
if test ! -d $buildFolder; then
mkdir $buildFolder
fi
if test ! -e .nuget; then
mkdir .nuget
cp $cachePath .nuget/nuget.exe
if test ! -f $nugetPath; then
if test ! -f $cacheNuget; then
wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null
fi
cp $cacheNuget $nugetPath
fi
if test ! -d packages/Sake; then
mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
if test ! -d $koreBuildFolder; then
mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre
chmod +x $koreBuildFolder/build/KoreBuild.sh
fi
if ! type dnvm > /dev/null 2>&1; then
source packages/KoreBuild/build/dnvm.sh
makeFile=makefile.shade
if [ ! -e $makeFile ]; then
makeFile=$koreBuildFolder/build/makefile.shade
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 "$@"
./$koreBuildFolder/build/KoreBuild.sh -n $nugetPath -m $makeFile "$@"

View File

@ -51,8 +51,6 @@ namespace Microsoft.AspNetCore.IISPlatformHandler.FunctionalTests
var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
Command = delegateServer == ServerType.WebListener ? "weblistener" : "web",
PublishWithNoSource = true, // Always publish with no source, otherwise it can't build and sign IISPlatformHandler
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
ApplicationHostConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
SiteName = "HttpTestSite", // This is configured in the Http.config

View File

@ -38,7 +38,6 @@ namespace Microsoft.AspNetCore.IISPlatformHandler.FunctionalTests
var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
PublishWithNoSource = true, // Always publish with no source, otherwise it can't build and sign IISPlatformHandler
EnvironmentName = "HttpsHelloWorld", // Will pick the Start class named 'StartupHttpsHelloWorld',
ApplicationHostConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Https.config") : null,
SiteName = "HttpsTestSite", // This is configured in the Https.config
@ -107,7 +106,6 @@ namespace Microsoft.AspNetCore.IISPlatformHandler.FunctionalTests
var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
PublishWithNoSource = true, // Always publish with no source, otherwise it can't build and sign IISPlatformHandler
EnvironmentName = "HttpsHelloWorld", // Will pick the Start class named 'StartupHttpsHelloWorld',
ApplicationHostConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Https.config") : null,
SiteName = "HttpsTestSite", // This is configured in the Https.config

View File

@ -33,7 +33,6 @@ namespace Microsoft.AspNetCore.IISPlatformHandler.FunctionalTests
var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
PublishWithNoSource = true, // Always publish with no source, otherwise it can't build and sign IISPlatformHandler
EnvironmentName = "NtlmAuthentication", // Will pick the Start class named 'StartupNtlmAuthentication'
ApplicationHostConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("NtlmAuthentation.config") : null,
SiteName = "NtlmAuthenticationTestSite", // This is configured in the NtlmAuthentication.config

View File

@ -11,6 +11,8 @@
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
"dnxcore50": {
"imports": "portable-net451+win8"
}
}
}

View File

@ -1,5 +1,12 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"content": [
"wwwroot/**/*",
"hosting.json"
],
"dependencies": {
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
@ -8,32 +15,15 @@
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.NETCore.Platforms": "1.0.1-*",
"xunit.runner.aspnet": "2.0.0-aspnet-*"
"xunit": "2.1.0"
},
"frameworks": {
"dnx451": {},
"dnx451": { },
"dnxcore50": {
"imports": "portable-net451+win8",
"dependencies": {
"System.Net.Primitives": "4.0.11-*",
"System.Net.Primitives": "4.0.11-*"
}
}
},
"commands": {
"web": "TestSites"
},
"compilationOptions": {
"emitEntryPoint": true
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
]
}
}

View File

@ -1,6 +1,8 @@
<configuration>
<system.webServer>
<httpPlatform forwardWindowsAuthToken="true" />
<!-- This repository cannot use the iis publish tool because there's a bug in the installer if the tool package is a package reference -->
<!-- See https://github.com/dotnet/cli/issues/1215 -->
<httpPlatform forwardWindowsAuthToken="true" processPath="..\TestSites.exe" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600" />
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>

View File

@ -7,6 +7,7 @@
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8",
"dependencies": {
"xunit.runner.aspnet": "2.0.0-aspnet-*"
}