Merge branch 'release/2.1' into dev

This commit is contained in:
John Luo 2018-02-01 14:48:34 -08:00
Родитель ba0abd2285 94cfac8ec6
Коммит bd9e53015d
18 изменённых файлов: 65 добавлений и 44 удалений

Просмотреть файл

@ -1,22 +1,19 @@
init:
- git config --global core.autocrlf true
init:
- git config --global core.autocrlf true
install:
- ps: Install-Product node 8 x64
- ps: Install-Product node 8 x64
branches:
only:
- master
- release
- dev
- /^rel\/.*/
- /^release\/.*/
- /^(.*\/)?ci-.*$/
- dev
- /^release\/.*$/
- /^(.*\/)?ci-.*$/
build_script:
- ps: .\build.cmd
- ps: .\build.cmd
clone_depth: 1
environment:
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
test: off
deploy: off
test: 'off'
deploy: 'off'
os: Visual Studio 2017

Просмотреть файл

@ -3,25 +3,27 @@ sudo: required
dist: trusty
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
- TRAVIS_NODE_VERSION: 8.9.3
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
- TRAVIS_NODE_VERSION: 8.9.3
addons:
apt:
packages:
- libunwind8
- libunwind8
mono: none
os:
- linux
- osx
- linux
- osx
osx_image: xcode9.2
branches:
only:
- dev
- /^release\/.*$/
- /^(.*\/)?ci-.*$/
- dev
- /^release\/.*$/
- /^(.*\/)?ci-.*$/
before_install:
- nvm install $TRAVIS_NODE_VERSION
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi
- nvm install $TRAVIS_NODE_VERSION
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
/usr/local/lib/; fi
script:
- ./build.sh
- ./build.sh

Просмотреть файл

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -10,7 +10,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">

Просмотреть файл

@ -13,8 +13,10 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqlitePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" PrivateAssets="All" Condition="'$(IndividualAuth)' == 'True'" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="${MicrosoftVisualStudioWebBrowserLinkPackageVersion}" Condition="'$(UseBrowserLink)' == 'True'" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="${MicrosoftVisualStudioWebCodeGenerationDesignPackageVersion}" PrivateAssets="All" Condition="'$(IndividualAuth)' == 'True'" />
</ItemGroup>

Просмотреть файл

@ -15,8 +15,10 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqlitePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" PrivateAssets="All" Condition="'$(IndividualAuth)' == 'True'" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="${MicrosoftVisualStudioWebBrowserLinkPackageVersion}" Condition="'$(UseBrowserLink)' == 'True'" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="${MicrosoftVisualStudioWebCodeGenerationDesignPackageVersion}" PrivateAssets="All" Condition="'$(IndividualAuth)' == 'True'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">

Просмотреть файл

@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />

Просмотреть файл

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="${MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">

Просмотреть файл

@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="${MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">

Просмотреть файл

@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
<PackageReference Include="Microsoft.AspNetCore.All" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="${MicrosoftAspNetCoreAllPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="${MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion}" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">

Просмотреть файл

@ -47,7 +47,7 @@ namespace Templates.Test
throw new NotImplementedException();
}
protected void RunDotNetNew(string templateName, string targetFrameworkOverride, string auth = null, string language = null)
protected void RunDotNetNew(string templateName, string targetFrameworkOverride, string auth = null, string language = null, bool useLocalDB = false)
{
var args = $"new {templateName}";
@ -66,6 +66,11 @@ namespace Templates.Test
args += $" -lang {language}";
}
if (useLocalDB)
{
args += $" -uld";
}
// Only run one instance of 'dotnet new' at once, as a workaround for
// https://github.com/aspnet/templating/issues/63
lock (DotNetNewLock)

Просмотреть файл

@ -65,16 +65,23 @@ namespace Templates.Test
public void MvcTemplate_IndividualAuth_Works_NetCore()
=> MvcTemplate_IndividualAuthImpl(null);
private void MvcTemplate_IndividualAuthImpl(string targetFrameworkOverride)
[Fact]
public void MvcTemplate_IndividualAuth_UsingLocalDB_Works_NetCore()
=> MvcTemplate_IndividualAuthImpl(null, true);
private void MvcTemplate_IndividualAuthImpl(string targetFrameworkOverride, bool useLocalDB = false)
{
RunDotNetNew("mvc", targetFrameworkOverride, auth: "Individual");
RunDotNetNew("mvc", targetFrameworkOverride, auth: "Individual", useLocalDB: useLocalDB);
AssertDirectoryExists("Extensions", false);
AssertFileExists("urlRewrite.config", false);
AssertFileExists("Controllers/AccountController.cs", false);
var projectFileContents = ReadFile($"{ProjectName}.csproj");
Assert.Contains(".db", projectFileContents);
if (!useLocalDB)
{
Assert.Contains(".db", projectFileContents);
}
Assert.Contains("Microsoft.EntityFrameworkCore.Tools", projectFileContents);
Assert.Contains("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents);
Assert.Contains("Microsoft.EntityFrameworkCore.Tools.DotNet", projectFileContents);

Просмотреть файл

@ -56,15 +56,21 @@ namespace Templates.Test
[Fact]
public void RazorPagesTemplate_IndividualAuth_Works_NetCore()
=> RazorPagesTemplate_IndividualAuthImpl(null);
[Fact]
public void RazorPagesTemplate_IndividualAuth_UsingLocalDB_Works_NetCore()
=> RazorPagesTemplate_IndividualAuthImpl(null, true);
private void RazorPagesTemplate_IndividualAuthImpl(string targetFrameworkOverride)
private void RazorPagesTemplate_IndividualAuthImpl(string targetFrameworkOverride, bool useLocalDB = false)
{
RunDotNetNew("razor", targetFrameworkOverride, auth: "Individual");
RunDotNetNew("razor", targetFrameworkOverride, auth: "Individual", useLocalDB: useLocalDB);
AssertFileExists("Pages/Shared/_LoginPartial.cshtml", true);
var projectFileContents = ReadFile($"{ProjectName}.csproj");
Assert.Contains(".db", projectFileContents);
if (!useLocalDB)
{
Assert.Contains(".db", projectFileContents);
}
Assert.Contains("Microsoft.EntityFrameworkCore.Tools", projectFileContents);
Assert.Contains("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents);
Assert.Contains("Microsoft.EntityFrameworkCore.Tools.DotNet", projectFileContents);