Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch Roslyn and installer to remove Humanizer and dotnet-deb-tool prebuilts. #1766

Merged
merged 4 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From a9a817d04b13c1b92c96a9178d92170c7d9f68e0 Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Thu, 24 Sep 2020 13:39:47 -0500
Subject: [PATCH 6/6] Source-build doesn't use dotnet-debv-tool.

---
src/redist/targets/GenerateDebs.targets | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/redist/targets/GenerateDebs.targets b/src/redist/targets/GenerateDebs.targets
index 72305b0a7..f5a1baabd 100644
--- a/src/redist/targets/GenerateDebs.targets
+++ b/src/redist/targets/GenerateDebs.targets
@@ -3,7 +3,7 @@

<!-- dotnet deb-tool -->
<ItemGroup>
- <DotNetCliToolReference Include="dotnet-deb-tool" Version="$(DotnetDebToolVersion)" />
+ <DotNetCliToolReference Include="dotnet-deb-tool" Version="$(DotnetDebToolVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>

<Target Name="SetupDebProps"
--
2.18.0

124 changes: 124 additions & 0 deletions patches/roslyn/0007-Don-t-use-Humanizer-in-source-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
From 934071a675a089b67625ab9670d951981c0f4b7c Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Thu, 24 Sep 2020 13:45:50 -0500
Subject: [PATCH 7/7] Don't use Humanizer in source-build.
crummel marked this conversation as resolved.
Show resolved Hide resolved

---
.../Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj | 4 ++--
.../Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj | 4 ++--
.../Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj | 4 ++--
.../Microsoft.CodeAnalysis.CSharp.Workspaces.csproj | 4 ++--
.../Compiler/CSharp/Extensions/SemanticModelExtensions.cs | 6 +++---
5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj b/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj
index 2c7af08b354..18a263ff52a 100644
--- a/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj
+++ b/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj
@@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpFixedVersion)" />
- <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" />
+ <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Core\Analyzers\Microsoft.CodeAnalysis.CodeStyle.csproj" />
@@ -28,4 +28,4 @@
</ItemGroup>
<Import Project="..\..\..\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CSharpCompilerExtensions.projitems" Label="Shared" />
<Import Project="..\..\..\Analyzers\CSharp\Analyzers\CSharpAnalyzers.projitems" Label="Shared" />
-</Project>
\ No newline at end of file
+</Project>
diff --git a/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj b/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj
index 4ce5a872393..0ef4d309c9d 100644
--- a/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj
+++ b/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj
@@ -36,7 +36,7 @@
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisCSharpWorkspacesFixedVersion)" />
- <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" />
+ <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Core\Analyzers\Microsoft.CodeAnalysis.CodeStyle.csproj" />
@@ -55,4 +55,4 @@
</ItemGroup>
<Import Project="..\..\..\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CSharpWorkspaceExtensions.projitems" Label="Shared" />
<Import Project="..\..\..\Analyzers\CSharp\CodeFixes\CSharpCodeFixes.projitems" Label="Shared" />
-</Project>
\ No newline at end of file
+</Project>
diff --git a/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj b/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
index f41ffaa6a77..ad68fda9fea 100644
--- a/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
+++ b/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
@@ -64,9 +64,9 @@
<PublicAPI Include="PublicAPI.Unshipped.txt" />
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" />
+ <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>
<Import Project="..\..\..\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems" Label="Shared" />
<Import Project="..\..\..\Analyzers\CSharp\Analyzers\CSharpAnalyzers.projitems" Label="Shared" />
<Import Project="..\..\..\Analyzers\CSharp\CodeFixes\CSharpCodeFixes.projitems" Label="Shared" />
-</Project>
\ No newline at end of file
+</Project>
diff --git a/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj b/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj
index 097e06a5d12..eb316fc7d36 100644
--- a/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj
+++ b/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj
@@ -20,7 +20,7 @@
<ProjectReference Include="..\..\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj" />
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" />
+ <PackageReference Include="Humanizer.Core" Version="$(HumanizerCoreVersion)" PrivateAssets="compile" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.EditorFeatures" />
@@ -60,4 +60,4 @@
</ItemGroup>
<Import Project="..\..\..\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CSharpCompilerExtensions.projitems" Label="Shared" />
<Import Project="..\..\..\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CSharpWorkspaceExtensions.projitems" Label="Shared" />
-</Project>
\ No newline at end of file
+</Project>
crummel marked this conversation as resolved.
Show resolved Hide resolved
diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs
index 900b94ea7ac..82f25d6d9b1 100644
--- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs
+++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SemanticModelExtensions.cs
@@ -6,7 +6,6 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
-using Humanizer;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Shared.Extensions;
@@ -234,7 +233,7 @@ private static bool CanBindToken(SyntaxToken token)
else if (current.Parent is ForEachStatementSyntax foreachStatement &&
foreachStatement.Expression == expression)
{
- return foreachStatement.Identifier.ValueText.ToCamelCase().Pluralize();
+ return foreachStatement.Identifier.ValueText.ToCamelCase();
}
else
{
@@ -260,7 +259,8 @@ private static bool CanBindToken(SyntaxToken token)
var pluralize = Pluralize(semanticModel, type);

var parameterName = type.CreateParameterName(capitalize);
- return pluralize ? parameterName.Pluralize() : parameterName;
+ // return pluralize ? parameterName.Pluralize() : parameterName;
+ return parameterName;
}

private static bool Pluralize(SemanticModel semanticModel, ITypeSymbol type)
--
2.18.0

2 changes: 0 additions & 2 deletions tools-local/prebuilt-baseline-offline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
<PackageIdentity Id="XliffTasks" Version="1.0.0-beta.20420.1" />
</NeverRestoredTarballPrebuilts>
<Usages>
<Usage Id="dotnet-deb-tool" Version="2.0.0" IsDirectDependency="true" />
<Usage Id="Humanizer.Core" Version="2.2.0" />
<Usage Id="MicroBuild.Core" Version="0.3.0" IsDirectDependency="true" />
<Usage Id="Microsoft.AspNetCore.App.Ref" Version="5.0.0-preview.8.20414.8" />
<Usage Id="Microsoft.AspNetCore.App.Runtime.linux-musl-x64" Version="5.0.0-preview.8.20414.8" />
Expand Down