Skip to content

Commit

Permalink
Add net461 build target for common libararies (dotnet#2482)
Browse files Browse the repository at this point in the history
* Add net461 build for docfx.csproj

* fix build failure
  • Loading branch information
vicancy authored Mar 5, 2018
1 parent b847c75 commit 01f70ee
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Shared/base.netstandard.props" />

<ItemGroup>
<ProjectReference Include="..\Microsoft.DocAsCode.Plugins\Microsoft.DocAsCode.Plugins.csproj" />
<ProjectReference Include="..\Microsoft.DocAsCode.YamlSerialization\Microsoft.DocAsCode.YamlSerialization.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.Web" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Shared/base.netstandard.props" />

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
<PackageReference Include="YamlDotNet.Signed" Version="4.2.2" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/Shared/base.netstandard.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>

<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<!-- Note: by convention assembly should be named after the root namespace -->
<AssemblyName Condition=" '$(AssemblyName)' == '' ">$(MSBuildProjectName)</AssemblyName>
<AssemblyTitle Condition=" '$(AssemblyTitle)' == '' ">$(MSBuildProjectName)</AssemblyTitle>
Expand Down
4 changes: 4 additions & 0 deletions src/docfx/docfx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@
<PackageReference Include="Microsoft.Owin.StaticFiles" Version="3.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Composition;
using System.IO;
using System.Linq;

using Microsoft.DocAsCode.Build.Engine;
using Microsoft.DocAsCode.Common;
using Microsoft.DocAsCode.Plugins;
Expand Down Expand Up @@ -324,7 +323,8 @@ I add a summary.
Assert.Contains("I update a summary", rawModel["summary"].ToString());
Assert.NotNull(listener.Items.FirstOrDefault(s => s.Message.StartsWith("There is no template processing document type(s): RESTMixedTest")));
Assert.NotNull(listener.Items.FirstOrDefault(s => s.Message.StartsWith("Can't find") && s.Message.EndsWith("/invalid.md.")));
(lastMessages, messages) = (messages, ClearLog(listener.Items));
lastMessages = messages;
messages = ClearLog(listener.Items);
Assert.True(messages.SequenceEqual(lastMessages));

// rebuild
Expand All @@ -338,7 +338,8 @@ I add a summary.
Assert.Contains("I update a summary", rawModel["summary"].ToString());
Assert.NotNull(listener.Items.FirstOrDefault(s => s.Message.StartsWith("There is no template processing document type(s): RESTMixedTest")));
Assert.NotNull(listener.Items.FirstOrDefault(s => s.Message.StartsWith("Can't find") && s.Message.EndsWith("/invalid.md.")));
(lastMessages, messages) = (messages, ClearLog(listener.Items));
lastMessages = messages;
messages = ClearLog(listener.Items);
Assert.True(messages.SequenceEqual(lastMessages));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Import Project="..\Shared\test.base.props" />

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

Expand Down

0 comments on commit 01f70ee

Please sign in to comment.