Skip to content

Commit

Permalink
Start migrating tests to .NET Core.
Browse files Browse the repository at this point in the history
  • Loading branch information
tintoy committed Sep 29, 2017
1 parent c63073a commit 2e97d67
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
<PackageReference Include="AutoMapper" Version="5.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461' OR '$(TargetFramework)' == 'net46' OR '$(TargetFramework)' == 'net452'">
<Reference Include="System.Web" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.DocAsCode.Build.Common\Microsoft.DocAsCode.Build.Common.csproj" />
<ProjectReference Include="..\..\src\Microsoft.DocAsCode.Common\Microsoft.DocAsCode.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@
<PackageReference Include="Microsoft.Composition" Version="1.0.31" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461' OR '$(TargetFramework)' == 'net46' OR '$(TargetFramework)' == 'net452'">
<Reference Include="System.Web" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
<PackageReference Include="Newtonsoft.Json.Schema" Version="2.0.10" />
</ItemGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<Folder Include="schemas\v1.0\" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,12 @@ private void ResolveCrefLink(XNode node, string nodeSelector, Action<string, str
// When see and seealso are top level nodes in triple slash comments, do not convert it into xref node
if (item.Parent?.Parent != null)
{
var replacement = XElement.Parse($"<xref href=\"{HttpUtility.UrlEncode(id)}\" data-throw-if-not-resolved=\"false\"></xref>");
// <xref href="id" data-throw-if-not-resolved="false"></xref>
XElement replacement = new XElement("xref",
new XAttribute("href", id),
new XAttribute("data-throw-if-not-resolved", "false"),
new XText(String.Empty)
);
item.ReplaceWith(replacement);
}

Expand Down
58 changes: 58 additions & 0 deletions src/Shared/base.netcoreapp.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<Project>
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssetTargetFallback>net461</AssetTargetFallback>

<!-- Note: by convention assembly should be named after the root namespace -->
<AssemblyName Condition=" '$(AssemblyName)' == '' ">$(MSBuildProjectName)</AssemblyName>
<AssemblyTitle Condition=" '$(AssemblyTitle)' == '' ">$(MSBuildProjectName)</AssemblyTitle>
<Product Condition=" '$(Product)' == '' ">$(MSBuildProjectName)</Product>
<PackageId Condition=" '$(PackageId)' == '' ">$(MSBuildProjectName)</PackageId>
<Company Condition=" '$(Company)' == '' ">Microsoft</Company>
<Copyright Condition=" '$(Copyright)' == '' ">Copyright © Microsoft docfx 2015-2017</Copyright>

<PackageProjectUrl Condition=" '$(PackageProjectUrl)' == '' ">https://github.com/dotnet/docfx</PackageProjectUrl>
<PackageLicenseUrl Condition=" '$(PackageLicenseUrl)' == '' ">https://github.com/dotnet/docfx/blob/dev/LICENSE</PackageLicenseUrl>

<VersionCSFile Condition="'$(VersionCSFile)' == ''">$(MSBuildThisFileDirectory)..\..\TEMP\version.cs</VersionCSFile>
<VersionFileExists Condition="Exists($(VersionCSFile))" >true</VersionFileExists>

<GenerateAssemblyVersionAttribute Condition=" '$(VersionFileExists)' == 'true' ">false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute Condition=" '$(VersionFileExists)' == 'true' ">false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute Condition=" '$(VersionFileExists)' == 'true' ">false</GenerateAssemblyInformationalVersionAttribute>

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<RootNamespace Condition=" '$(RootNamespace)' == '' ">$(AssemblyName)</RootNamespace>
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>

<!-- Note: unless explicitly specified, we will generate DLL -->
<Prefer32Bit>false</Prefer32Bit>
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>

<!-- Note: get rid of vshost.exe since we don't gain much benefits -->
<UseVSHostingProcess>false</UseVSHostingProcess>
<WarningLevel>4</WarningLevel>

</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Condition="Exists($(VersionCSFile))" Include="$(VersionCSFile)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp.0' ">
<!-- Common references -->
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Shared\test.base.props" />
<Import Project="..\Shared\test.base.netcoreapp.props" />
<ItemGroup>
<Compile Remove="TestData\snippets\dataflowdegreeofparallelism.cs" />
</ItemGroup>
Expand Down Expand Up @@ -30,6 +30,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.5.5" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Shared\test.base.props" />
<Import Project="..\Shared\test.base.netstandard.props" />

<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.DocAsCode.Common\Microsoft.DocAsCode.Common.csproj" />
Expand Down
21 changes: 21 additions & 0 deletions test/Shared/test.base.netcoreapp.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>

<PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

<Import Project="../../src/Shared/base.netcoreapp.props" />

<PropertyGroup>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3742" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3742" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions test/Shared/test.base.netstandard.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>

<PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

<Import Project="../../src/Shared/base.netstandard.props" />

<PropertyGroup>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3742" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3742" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions test/Shared/test.base.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<Import Project="../../src/Shared/base.props" />

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
<PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3742" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3742" />
</ItemGroup>

</Project>

0 comments on commit 2e97d67

Please sign in to comment.