Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #790 from microsoft/apiportglobaltool
Browse files Browse the repository at this point in the history
Make ApiPort to be Global tool. Upgraded netstandard1.3 to 2.0 for all portability libs. Some clean up.
  • Loading branch information
Lxiamail authored Aug 23, 2019
2 parents a45fc2f + 8f73526 commit 69ed628
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion samples/SearchFxApi/SearchFxApi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net461</TargetFramework>
<RootNamespace>ApiPortVS</RootNamespace>
<DefineConstants>$(DefineConstants);VS2017</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net461</TargetFramework>
<RootNamespace>ApiPortVS</RootNamespace>
<DefineConstants>$(DefineConstants);VS2019</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net461</TargetFramework>
<RootNamespace>ApiPortVS</RootNamespace>
</PropertyGroup>

Expand Down
3 changes: 1 addition & 2 deletions src/ApiPort/ApiPort.VisualStudio/ApiPort.VisualStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ApiPortVS</RootNamespace>
<AssemblyName>ApiPort.VisualStudio</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
Expand Down Expand Up @@ -137,7 +137,6 @@
</ProjectReference>
<ProjectReference Include="..\..\lib\Microsoft.Fx.Portability\Microsoft.Fx.Portability.csproj">
<Project>{8d84ec23-9977-4cc8-b649-035ffae9664c}</Project>
<AdditionalProperties>TargetFramework=net46</AdditionalProperties>
<Name>Microsoft.Fx.Portability</Name>
</ProjectReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ApiPort/ApiPort.Vsix/ApiPort.Vsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ApiPort.Vsix</RootNamespace>
<AssemblyName>ApiPort.Vsix</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
Expand Down
1 change: 0 additions & 1 deletion src/ApiPort/ApiPort/ApiPort.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
<LastGenOutput>LocalizedStrings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
31 changes: 20 additions & 11 deletions src/ApiPort/ApiPort/ApiPort.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,29 @@
<OutputType>Exe</OutputType>
<AssemblyName>ApiPort</AssemblyName>
<RootNamespace>ApiPort</RootNamespace>
<!--
netcoreapp target must be first to avoid a ResXFileCodeGenerator issue
(tracked at https://github.com/dotnet/project-system/issues/1519)
-->
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
<DefineConstants>$(DefineConstants);FEATURE_SYSTEM_PROXY;FEATURE_NETWORK_CREDENTIAL</DefineConstants>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
<Choose>
<!-- build as global tool if GlobalTool is specified when targettting .NET Core-->
<When Condition="'$(GlobalTool)' == 'true'">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PackAsTool>true</PackAsTool>
<ToolCommandName>ApiPort</ToolCommandName>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>$(DefineConstants);FEATURE_SYSTEM_PROXY;FEATURE_NETWORK_CREDENTIAL</DefineConstants>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<!-- Projects default to being signed, but Microsoft.Configuration.* assemblies are not signed -->
Expand Down
3 changes: 2 additions & 1 deletion src/lib/Microsoft.Fx.Portability.Cci/DocIdExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public static string RefDocId(this IReference reference)
return assembly.DocId();
}

Contract.Assert(false, string.Format(CultureInfo.CurrentUICulture, LocalizedStrings.FellThroughCasesIn, "DocIdExtensions.RefDocId()", reference.GetType()));
Contract.Assert(false,
string.Format((IFormatProvider)CultureInfo.CurrentUICulture, LocalizedStrings.FellThroughCasesIn, "DocIdExtensions.RefDocId()", reference.GetType()));
return LocalizedStrings.UnknownReferenceType;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Microsoft.Fx.Portability.Cci</RootNamespace>
<Description>Metadata reader for binaries using Microsoft.CCI</Description>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Microsoft.Fx.Portability.Cci/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public static bool IsReferenceAssembly(this IAssembly assembly)
return assembly.AssemblyAttributes.Any(a => a.Type.FullName() == "System.Runtime.CompilerServices.ReferenceAssemblyAttribute");
}

private static readonly Dictionary<string, string> TokenNames = new Dictionary<string, string>()
private static readonly Dictionary<string, string> TokenNames = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
{ "b77a5c561934e089", "ECMA" },
{ "b03f5f7f11d50a3a", "DEVDIV" },
Expand All @@ -609,7 +609,7 @@ public static bool IsReferenceAssembly(this IAssembly assembly)

public static string MapPublicKeyTokenToName(string publicKeyToken)
{
if (!TokenNames.TryGetValue(publicKeyToken.ToLower(), out var name))
if (!TokenNames.TryGetValue(publicKeyToken, out var name))
{
name = publicKeyToken;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public override int GetHashCode()
{
if (!_hashComputed)
{
_hashCode = ((DefinedInAssemblyIdentity?.ToString() ?? string.Empty) + (MemberDocId ?? string.Empty) + IsPrimitive.ToString()).GetHashCode() ^ CallingAssembly.GetHashCode();
_hashCode = ((DefinedInAssemblyIdentity?.ToString() ?? string.Empty) + (MemberDocId ?? string.Empty) + IsPrimitive.ToString((IFormatProvider)CultureInfo.InvariantCulture)).GetHashCode() ^ CallingAssembly.GetHashCode();
_hashComputed = true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Metadata reader for binaries using System.Reflection.Metadata</Description>
<RootNamespace>Microsoft.Fx.Portability.Analyzer</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Microsoft.Fx.Portability.Offline/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static Stream OpenFileOrResource(string path)

if (stream == null)
{
throw new PortabilityAnalyzerException(string.Format(CultureInfo.CurrentUICulture, LocalizedStrings.DataFileNotFound, path));
throw new PortabilityAnalyzerException(string.Format((IFormatProvider)CultureInfo.CurrentUICulture, LocalizedStrings.DataFileNotFound, path));
}

return stream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>The core data structures for .NET Portability Analyzer in Offline mode</Description>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ private void GenerateBreakingChangesPage(Worksheet worksheet, IEnumerable<Breaki
breakingChange.DependantAssembly.ToString(),
breakingChange.Break.Title,
breakingChange.Break.ImpactScope.ToString(),
breakingChange.Break.IsQuirked.ToString(),
breakingChange.Break.IsRetargeting.ToString(),
breakingChange.Break.IsBuildTime.ToString(),
breakingChange.Break.IsQuirked.ToString((IFormatProvider)CultureInfo.CurrentUICulture),
breakingChange.Break.IsRetargeting.ToString((IFormatProvider)CultureInfo.CurrentUICulture),
breakingChange.Break.IsBuildTime.ToString((IFormatProvider)CultureInfo.CurrentUICulture),
breakingChange.Break.VersionBroken.ToString(),
breakingChange.Break.VersionFixed?.ToString() ?? string.Empty,
breakingChange.Break.Details,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>An Excel formatter for ApiPort reports</Description>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Description>An HTML formatter for ApiPort reports</Description>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
netstandard target must be first to avoid a ResXFileCodeGenerator issue
(tracked at https://github.com/dotnet/project-system/issues/1519)
-->
<TargetFrameworks>netstandard1.3;netstandard2.0;net46</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>The core data structures and network calls for .NET Portability Analyzer</Description>
<!-- Adding this to properly suppress CA3053. -->
<DefineConstants>$(DefineConstants);CODE_ANALYSIS</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'== 'net46' OR '$(TargetFramework)'== 'netstandard2.0' ">
<PropertyGroup Condition="'$(TargetFramework)'== 'netstandard2.0' ">
<DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_ASSEMBLY_LOCATION;FEATURE_XML_SCHEMA;FEATURE_SERVICE_POINT_MANAGER;FEATURE_WEBEXCEPTION</DefineConstants>
</PropertyGroup>

Expand All @@ -22,11 +22,6 @@
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'== 'netstandard1.3'">
<PackageReference Include="System.Linq.Parallel" Version="4.3.0" />
<PackageReference Include="System.Runtime" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources\LocalizedStrings.Designer.cs">
<AutoGen>True</AutoGen>
Expand Down
1 change: 1 addition & 0 deletions tests/ApiPort/ApiPort.Tests/ApiPort.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/ApiPort/ApiPortVS.Tests/ApiPortVS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net461</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<NonShipping>true</NonShipping>
Expand Down

0 comments on commit 69ed628

Please sign in to comment.