forked from dotnet/docfx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Microsoft.DocAsCode.Common, Microsoft.DocAsCode.Plugins, and …
…Microsoft.DocAsCode.YamlSerialization projects to .NET Standard 2.0. dotnet#1963.
- Loading branch information
Showing
9 changed files
with
92 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Collections.Concurrent; | ||
using System.Threading; | ||
|
||
namespace Microsoft.DocAsCode.Common | ||
{ | ||
/// <summary> | ||
/// A NETStandard-friendly replacement for CallContext. | ||
/// </summary> | ||
public static class LogicalCallContext | ||
{ | ||
static readonly ConcurrentDictionary<string, AsyncLocal<object>> _data = new ConcurrentDictionary<string, AsyncLocal<object>>(); | ||
|
||
public static void SetData(string key, object data) => _data.GetOrAdd(key, _ => new AsyncLocal<object>()).Value = data; | ||
|
||
public static object GetData(string key) => _data.TryGetValue(key, out AsyncLocal<object> data) ? data.Value : null; | ||
public static void FreeData(string key) => _data.TryRemove(key, out _); | ||
} | ||
} |
8 changes: 2 additions & 6 deletions
8
src/Microsoft.DocAsCode.Common/Microsoft.DocAsCode.Common.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="../Shared/base.props" /> | ||
|
||
<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' OR '$(TargetFramework)' == 'net46' OR '$(TargetFramework)' == 'net452'"> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
</Project> |
2 changes: 1 addition & 1 deletion
2
src/Microsoft.DocAsCode.Plugins/Microsoft.DocAsCode.Plugins.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/Microsoft.DocAsCode.YamlSerialization/Microsoft.DocAsCode.YamlSerialization.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="../Shared/base.props" /> | ||
<Import Project="../Shared/base.netstandard.props" /> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="YamlDotNet.Signed" Version="4.1.0" /> | ||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" /> | ||
<PackageReference Include="YamlDotNet.Signed" Version="4.2.2" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
|
||
<!-- 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 --> | ||
<OutputType Condition=" '$(OutputType)' == '' ">Library</OutputType> | ||
<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)' == 'netstandard2.0' "> | ||
<!-- Common references --> | ||
</ItemGroup> | ||
</Project> |