-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Port GenFacades, Microsft.Cci.Extensions to Arcade (#477)
* Port GenFacade to Arcade * Convert jsons into csprojs * Move files to correct directories, fix errors * Fix naming * Microsoft.Cci.Extensions -> Microsoft.DotNet.Cci.Extensions * Change csproj name * use Microsoft.Cci where needed & add to SignToolData * Microsoft.DotNet.Cci.Extensions -> Microsoft.Cci.Extensions * Add netstandard2.0 to cci.extensions * Spacing * Fix mismatched property tag * Add notsupported.targets & remove NoWarn from .csproj * Remove dnxcore50, add NoWarn back * Remove net461 & Disable Implicit AssetTargetFallback * Bump System.Diag.Contracts to 4.3.0 * Don't port GenFacades.exe, fix overflow * Add overflow fix to FileVersion as well * Resolve conflicts * Address feedback
- Loading branch information
Showing
117 changed files
with
13,107 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,62 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project> | ||
<PropertyGroup> | ||
<!-- This repo version --> | ||
<VersionPrefix>1.0.0</VersionPrefix> | ||
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel> | ||
<!-- Opt-out repo features --> | ||
<UsingToolXliff>false</UsingToolXliff> | ||
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies> | ||
<MicrosoftNetFrameworkReferenceAssembliesVersion>1.0.0-alpha-004</MicrosoftNetFrameworkReferenceAssembliesVersion> | ||
<!-- Libs --> | ||
<CommandLineParserVersion>2.2.1</CommandLineParserVersion> | ||
<CredentialManagementVersion>1.0.2</CredentialManagementVersion> | ||
<LibGit2SharpVersion>0.25.2</LibGit2SharpVersion> | ||
<log4netVersion>2.0.8</log4netVersion> | ||
<SystemNetHttpVersion>4.3.3</SystemNetHttpVersion> | ||
<MicrosoftBuildVersion>15.7.179</MicrosoftBuildVersion> | ||
<MicrosoftBuildFrameworkVersion>15.7.179</MicrosoftBuildFrameworkVersion> | ||
<MicrosoftBuildTasksCoreVersion>15.7.179</MicrosoftBuildTasksCoreVersion> | ||
<MicrosoftBuildUtilitiesCoreVersion>15.7.179</MicrosoftBuildUtilitiesCoreVersion> | ||
<MicrosoftDotNetVersionToolsVersion>2.2.0-preview1-02815-01</MicrosoftDotNetVersionToolsVersion> | ||
<MicrosoftIdentityModelClientsActiveDirectoryVersion>3.19.8</MicrosoftIdentityModelClientsActiveDirectoryVersion> | ||
<MicrosoftRestClientRuntimeVersion>3.0.3</MicrosoftRestClientRuntimeVersion> | ||
<MicrosoftExtensionsFileSystemGlobbingVersion>2.0.0</MicrosoftExtensionsFileSystemGlobbingVersion> | ||
<MicrosoftNetTestSdkVersion>15.7.2</MicrosoftNetTestSdkVersion> | ||
<MoqVersion>4.8.3</MoqVersion> | ||
<NewtonsoftJsonVersion>9.0.1</NewtonsoftJsonVersion> | ||
<NuGetVersioningVersion>4.4.0</NuGetVersioningVersion> | ||
<OctokitVersion>0.30.0</OctokitVersion> | ||
<DotNetSleetLibVersion>2.2.73</DotNetSleetLibVersion> | ||
<SystemCollectionsImmutableVersion>1.3.1</SystemCollectionsImmutableVersion> | ||
<SystemIOCompressionVersion>4.3.0</SystemIOCompressionVersion> | ||
<SystemIOPackagingVersion>4.5.0</SystemIOPackagingVersion> | ||
<SystemIOFileSystemPrimitivesVersion>4.3.0</SystemIOFileSystemPrimitivesVersion> | ||
<SystemReflectionMetadataVersion>1.4.2</SystemReflectionMetadataVersion> | ||
<SystemValueTupleVersion>4.4.0</SystemValueTupleVersion> | ||
<WindowsAzureStorageVersion>8.5.0</WindowsAzureStorageVersion> | ||
<XUnitVersion>2.4.1-pre.build.4059</XUnitVersion> | ||
<XUnitVSRunnerVersion>2.4.1-pre.build.4059</XUnitVSRunnerVersion> | ||
<!-- 3rd Part Packages Public Keys --> | ||
<DynamicProxyGenAsm2Key>0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</DynamicProxyGenAsm2Key> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<MicrosoftAzureDocumentDBVersion>1.22.0</MicrosoftAzureDocumentDBVersion> | ||
<MicrosoftAzureCosmosDBTableVersion>1.1.2</MicrosoftAzureCosmosDBTableVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<MicrosoftAspNetCoreAllVersion>2.0.0</MicrosoftAspNetCoreAllVersion> | ||
<MicrosoftDotNetGitHubIssueLabelerAssetsVersion>1.2.0</MicrosoftDotNetGitHubIssueLabelerAssetsVersion> | ||
<MicrosoftMLVersion>0.4.0</MicrosoftMLVersion> | ||
<MicrosoftVisualStudioWebCodeGenerationDesignVersion>2.0.4</MicrosoftVisualStudioWebCodeGenerationDesignVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<RestoreSources> | ||
$(RestoreSources); | ||
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; | ||
</RestoreSources> | ||
</PropertyGroup> | ||
<Project> | ||
<PropertyGroup> | ||
<!-- This repo version --> | ||
<VersionPrefix>1.0.0</VersionPrefix> | ||
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel> | ||
<!-- Opt-out repo features --> | ||
<UsingToolXliff>false</UsingToolXliff> | ||
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies> | ||
<MicrosoftNetFrameworkReferenceAssembliesVersion>1.0.0-alpha-004</MicrosoftNetFrameworkReferenceAssembliesVersion> | ||
<!-- Libs --> | ||
<CommandLineParserVersion>2.2.1</CommandLineParserVersion> | ||
<CredentialManagementVersion>1.0.2</CredentialManagementVersion> | ||
<LibGit2SharpVersion>0.25.2</LibGit2SharpVersion> | ||
<log4netVersion>2.0.8</log4netVersion> | ||
<SystemNetHttpVersion>4.3.3</SystemNetHttpVersion> | ||
<MicrosoftBuildVersion>15.7.179</MicrosoftBuildVersion> | ||
<MicrosoftBuildFrameworkVersion>15.7.179</MicrosoftBuildFrameworkVersion> | ||
<MicrosoftBuildTasksCoreVersion>15.7.179</MicrosoftBuildTasksCoreVersion> | ||
<MicrosoftBuildUtilitiesCoreVersion>15.7.179</MicrosoftBuildUtilitiesCoreVersion> | ||
<MicrosoftDotNetVersionToolsVersion>2.2.0-preview1-02815-01</MicrosoftDotNetVersionToolsVersion> | ||
<MicrosoftIdentityModelClientsActiveDirectoryVersion>3.19.8</MicrosoftIdentityModelClientsActiveDirectoryVersion> | ||
<MicrosoftRestClientRuntimeVersion>3.0.3</MicrosoftRestClientRuntimeVersion> | ||
<MicrosoftExtensionsFileSystemGlobbingVersion>2.0.0</MicrosoftExtensionsFileSystemGlobbingVersion> | ||
<MicrosoftNetTestSdkVersion>15.7.2</MicrosoftNetTestSdkVersion> | ||
<MoqVersion>4.8.3</MoqVersion> | ||
<NewtonsoftJsonVersion>9.0.1</NewtonsoftJsonVersion> | ||
<NuGetVersioningVersion>4.4.0</NuGetVersioningVersion> | ||
<OctokitVersion>0.30.0</OctokitVersion> | ||
<DotNetSleetLibVersion>2.2.73</DotNetSleetLibVersion> | ||
<SystemCollectionsImmutableVersion>1.3.1</SystemCollectionsImmutableVersion> | ||
<SystemIOCompressionVersion>4.3.0</SystemIOCompressionVersion> | ||
<SystemIOPackagingVersion>4.5.0</SystemIOPackagingVersion> | ||
<SystemIOFileSystemPrimitivesVersion>4.3.0</SystemIOFileSystemPrimitivesVersion> | ||
<SystemReflectionMetadataVersion>1.4.2</SystemReflectionMetadataVersion> | ||
<SystemValueTupleVersion>4.4.0</SystemValueTupleVersion> | ||
<WindowsAzureStorageVersion>8.5.0</WindowsAzureStorageVersion> | ||
<XUnitVersion>2.4.1-pre.build.4059</XUnitVersion> | ||
<XUnitVSRunnerVersion>2.4.1-pre.build.4059</XUnitVSRunnerVersion> | ||
<!-- 3rd Part Packages Public Keys --> | ||
<DynamicProxyGenAsm2Key>0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</DynamicProxyGenAsm2Key> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<MicrosoftAzureDocumentDBVersion>1.22.0</MicrosoftAzureDocumentDBVersion> | ||
<MicrosoftAzureCosmosDBTableVersion>1.1.2</MicrosoftAzureCosmosDBTableVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<MicrosoftAspNetCoreAllVersion>2.0.0</MicrosoftAspNetCoreAllVersion> | ||
<MicrosoftDotNetGitHubIssueLabelerAssetsVersion>1.2.0</MicrosoftDotNetGitHubIssueLabelerAssetsVersion> | ||
<MicrosoftMLVersion>0.4.0</MicrosoftMLVersion> | ||
<MicrosoftVisualStudioWebCodeGenerationDesignVersion>2.0.4</MicrosoftVisualStudioWebCodeGenerationDesignVersion> | ||
<MicrosoftDiaSymReaderConverterVersion>1.1.0-beta1-62810-01</MicrosoftDiaSymReaderConverterVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<RestoreSources> | ||
$(RestoreSources); | ||
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; | ||
https://dotnet.myget.org/F/symreader-converter/api/v3/index.json; | ||
https:%2F%2Fdotnet.myget.org/F/symreader/api/v3/index.json | ||
</RestoreSources> | ||
</PropertyGroup> | ||
</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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"tools": { | ||
"dotnet": "2.1.400-preview-009088" | ||
}, | ||
"msbuild-sdks": { | ||
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18461.2" | ||
} | ||
{ | ||
"tools": { | ||
"dotnet": "2.1.400-preview-009088" | ||
}, | ||
"msbuild-sdks": { | ||
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18461.2" | ||
} | ||
} |
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,159 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
using Microsoft.Cci.Extensions; | ||
|
||
namespace Microsoft.Cci.Comparers | ||
{ | ||
public sealed class ApiComparer<T> : IComparer<T> | ||
{ | ||
private readonly Func<T, ApiKind> _kindProvider; | ||
private readonly Func<T, string> _nameProvider; | ||
|
||
public ApiComparer(Func<T, ApiKind> kindProvider, Func<T, string> nameProvider) | ||
{ | ||
_kindProvider = kindProvider; | ||
_nameProvider = nameProvider; | ||
} | ||
|
||
public int Compare(T x, T y) | ||
{ | ||
var kindX = _kindProvider(x); | ||
var kindY = _kindProvider(y); | ||
var kindComparison = CompareKind(kindX, kindY); | ||
if (kindComparison != 0) | ||
return kindComparison; | ||
|
||
var nameX = _nameProvider(x); | ||
var nameY = _nameProvider(y); | ||
if (kindX == ApiKind.Namespace && kindY == ApiKind.Namespace) | ||
return CompareQualifiedNamespaceNames(nameX, nameY); | ||
|
||
return CompareNames(nameX, nameY); | ||
} | ||
|
||
private static int CompareKind(ApiKind x, ApiKind y) | ||
{ | ||
var xKindOrder = GetKindOrder(x); | ||
var yKindOrder = GetKindOrder(y); | ||
return xKindOrder.CompareTo(yKindOrder); | ||
} | ||
|
||
private static int CompareNames(string x, string y) | ||
{ | ||
var xNonGenericName = GetNonGenericName(x); | ||
var yNonGenericName = GetNonGenericName(y); | ||
|
||
var nameComparison = StringComparer.OrdinalIgnoreCase.Compare(xNonGenericName, yNonGenericName); | ||
if (nameComparison != 0) | ||
return nameComparison; | ||
|
||
return x.Length.CompareTo(y.Length); | ||
} | ||
|
||
private static int CompareQualifiedNamespaceNames(string nameX, string nameY) | ||
{ | ||
string beforeFirstDotX; | ||
string afterFirstDotX; | ||
SplitAtFirstDot(nameX, out beforeFirstDotX, out afterFirstDotX); | ||
|
||
string beforeFirstDotY; | ||
string afterFirstDotY; | ||
SplitAtFirstDot(nameY, out beforeFirstDotY, out afterFirstDotY); | ||
|
||
var firstComparison = CompareNamespaceNames(beforeFirstDotX, beforeFirstDotY); | ||
if (firstComparison != 0) | ||
return firstComparison; | ||
|
||
return StringComparer.OrdinalIgnoreCase.Compare(nameX, nameY); | ||
} | ||
|
||
private static int CompareNamespaceNames(string nameX, string nameY) | ||
{ | ||
var orderX = GetNamspaceOrder(nameX); | ||
var orderY = GetNamspaceOrder(nameY); | ||
|
||
var comparison = orderX.CompareTo(orderY); | ||
if (comparison != 0) | ||
return comparison; | ||
|
||
return StringComparer.OrdinalIgnoreCase.Compare(nameX, nameY); | ||
} | ||
|
||
private static int GetKindOrder(ApiKind kind) | ||
{ | ||
switch (kind) | ||
{ | ||
// Namespace -- no order | ||
case ApiKind.Namespace: | ||
return 0; | ||
|
||
// Types -- no order between types | ||
case ApiKind.Interface: | ||
case ApiKind.Delegate: | ||
case ApiKind.Enum: | ||
case ApiKind.Struct: | ||
case ApiKind.Class: | ||
return 1; | ||
|
||
// Members | ||
case ApiKind.EnumField: | ||
case ApiKind.Field: | ||
return 2; | ||
case ApiKind.Constructor: | ||
return 3; | ||
case ApiKind.Property: | ||
return 4; | ||
case ApiKind.Method: | ||
case ApiKind.PropertyAccessor: | ||
case ApiKind.EventAccessor: | ||
case ApiKind.DelegateMember: | ||
return 5; | ||
case ApiKind.Event: | ||
return 6; | ||
default: | ||
throw new ArgumentOutOfRangeException("kind"); | ||
} | ||
} | ||
|
||
private static int GetNamspaceOrder(string name) | ||
{ | ||
switch (name) | ||
{ | ||
case "System": | ||
return 0; | ||
case "Microsoft": | ||
return 1; | ||
case "Windows": | ||
return 2; | ||
default: | ||
return 3; | ||
} | ||
} | ||
|
||
private static string GetNonGenericName(string name) | ||
{ | ||
var i = name.IndexOf("<", StringComparison.OrdinalIgnoreCase); | ||
return i > -1 ? name.Substring(0, i) : name; | ||
} | ||
|
||
private static void SplitAtFirstDot(string qualifiedName, out string beforeFirstDot, out string afterFirstDot) | ||
{ | ||
var firstDot = qualifiedName.IndexOf('.'); | ||
if (firstDot < 0) | ||
{ | ||
beforeFirstDot = qualifiedName; | ||
afterFirstDot = string.Empty; | ||
} | ||
else | ||
{ | ||
beforeFirstDot = qualifiedName.Substring(0, firstDot); | ||
afterFirstDot = qualifiedName.Substring(firstDot + 1); | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Microsoft.Cci.Extensions/Comparers/AttributeComparer.cs
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,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using Microsoft.Cci.Extensions; | ||
using Microsoft.Cci.Filters; | ||
using Microsoft.Cci.Writers.CSharp; | ||
|
||
namespace Microsoft.Cci.Comparers | ||
{ | ||
public class AttributeComparer : StringKeyComparer<ICustomAttribute> | ||
{ | ||
private readonly CSDeclarationHelper _helper; | ||
|
||
public AttributeComparer() | ||
: this(new IncludeAllFilter(), false) | ||
{ | ||
} | ||
|
||
public AttributeComparer(ICciFilter filter, bool forCompilation) | ||
{ | ||
_helper = new CSDeclarationHelper(filter, forCompilation); | ||
} | ||
|
||
public override string GetKey(ICustomAttribute c) | ||
{ | ||
return _helper.GetString(c); | ||
} | ||
} | ||
} |
Oops, something went wrong.