Skip to content

Commit 822096a

Browse files
committed
WIP toward fixing build breaks in test project
1 parent 9330ee8 commit 822096a

14 files changed

Lines changed: 36 additions & 23 deletions

File tree

src/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<CodeGenerationRoslynVersion>0.4.42</CodeGenerationRoslynVersion>
3+
<CodeGenerationRoslynVersion>0.4.74</CodeGenerationRoslynVersion>
44
</PropertyGroup>
55
<ItemGroup>
66
<PackageReference Update="CodeGeneration.Roslyn.Attributes" Version="$(CodeGenerationRoslynVersion)" />
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22
<PropertyGroup>
33
<RootNamespace>ImmutableObjectGraph.Generation</RootNamespace>
4-
<TargetFrameworks>netstandard1.0;portable-net45+win8+wpa81+wp8</TargetFrameworks>
4+
<TargetFrameworks>netstandard1.0</TargetFrameworks>
55
<Description>The runtime components behind the types generated with the ImmutableObjectGraph.Generation package.</Description>
6-
6+
77
<!-- This gets included in ImmutableObjectGraph.Generation -->
88
<IsPackable>false</IsPackable>
99
</PropertyGroup>
@@ -12,4 +12,4 @@
1212
<PackageReference Include="System.Collections.Immutable" />
1313
<PackageReference Include="CodeGeneration.Roslyn.Attributes" />
1414
</ItemGroup>
15-
</Project>
15+
</Project>

src/ImmutableObjectGraph.Generation.Tests/ImmutableObjectGraph.Generation.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
<PackageReference Include="Microsoft.Build" />
7777
<PackageReference Include="xunit" />
7878
<PackageReference Include="xunit.runner.visualstudio" />
79+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="all" />
80+
<PackageReference Include="CodeGeneration.Roslyn" PrivateAssets="all" />
81+
</ItemGroup>
82+
<ItemGroup>
83+
<DotNetCliToolReference Include="dotnet-codegen" />
7984
</ItemGroup>
8085
<ItemGroup>
8186
<ProjectReference Include="..\ImmutableObjectGraph.Generation.Attributes\ImmutableObjectGraph.Generation.Attributes.csproj" />

src/ImmutableObjectGraph.Generation/CodeGen+DeltaGen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ protected MethodDeclarationSyntax CreateDiffPropertiesMethod()
451451
SyntaxFactory.InvocationExpression(
452452
Syntax.ThisDot(SyntaxFactory.IdentifierName(nameof(GetType))),
453453
SyntaxFactory.ArgumentList()),
454-
SyntaxFactory.IdentifierName(nameof(Type.IsEquivalentTo)))).AddArgumentListArguments(
454+
SyntaxFactory.IdentifierName("IsEquivalentTo"))).AddArgumentListArguments(
455455
SyntaxFactory.Argument(
456456
SyntaxFactory.InvocationExpression(
457457
SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, otherParam, SyntaxFactory.IdentifierName(nameof(GetType))),

src/ImmutableObjectGraph.Generation/CodeGen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private CodeGen(ClassDeclarationSyntax applyTo, SemanticModel semanticModel, IPr
8181
this.options = options ?? new Options();
8282
this.cancellationToken = cancellationToken;
8383

84-
this.PluralService = PluralizationService.CreateService(CultureInfo.GetCultureInfo("en-US"));
84+
this.PluralService = PluralizationService.CreateService(new CultureInfo("en-US"));
8585
}
8686

8787
public PluralizationService PluralService { get; set; }

src/ImmutableObjectGraph.Generation/DiagnosticsStrings.Designer.cs

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ImmutableObjectGraph.Generation/ImmutableObjectGraph.Generation.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<RootNamespace>ImmutableObjectGraph.Generation</RootNamespace>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFramework>netstandard1.6</TargetFramework>
5+
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
56
<Description>MSBuild-based code generator to transform simple mutable type definitions into fully functional immutable types with persistent characteristics.</Description>
67

78
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -28,21 +29,18 @@
2829
<LastGenOutput>DiagnosticsStrings.Designer.cs</LastGenOutput>
2930
</EmbeddedResource>
3031
</ItemGroup>
31-
<ItemGroup>
32-
<!-- TODO: Suppress this assembly from showing up as a frameworkAssembly dependency in our .nuspec file. -->
33-
<Reference Include="System.Data.Entity.Design" />
34-
</ItemGroup>
3532
<ItemGroup>
3633
<ProjectReference Include="..\ImmutableObjectGraph.Generation.Attributes\ImmutableObjectGraph.Generation.Attributes.csproj" PrivateAssets="all" />
3734
<ProjectReference Include="..\ImmutableObjectGraph\ImmutableObjectGraph.csproj" PrivateAssets="none" />
3835
</ItemGroup>
3936
<ItemGroup>
37+
<PackageReference Include="CG.Pluralization" Version="0.3000.5" PrivateAssets="all" />
4038
<PackageReference Include="CodeGeneration.Roslyn" PrivateAssets="all" />
4139
<PackageReference Include="CodeGeneration.Roslyn.BuildTime" PrivateAssets="none" />
4240
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="all" />
4341
</ItemGroup>
4442
<ItemGroup>
45-
<DotNetCliToolReference Include="dotnet-codegen" />
43+
<DotNetCliToolReference Include="dotnet-codegen" />
4644
</ItemGroup>
4745
<Target Name="PackBuildOutputs" DependsOnTargets="SatelliteDllsProjectOutputGroup;DebugSymbolsProjectOutputGroup">
4846
<ItemGroup>

src/ImmutableObjectGraph.Generation/StyleCop.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.Collections.Immutable;
66
using System.Linq;
7+
using System.Reflection;
78
using System.Text;
89
using System.Threading.Tasks;
910
using Microsoft.CodeAnalysis;
@@ -74,7 +75,7 @@ private static int GetMemberDeclarationTypeOrder(MemberDeclarationSyntax member)
7475
{
7576
for (int i = 0; i < MemberDeclarationOrder.Length; i++)
7677
{
77-
if (MemberDeclarationOrder[i].IsInstanceOfType(member))
78+
if (MemberDeclarationOrder[i].GetTypeInfo().IsInstanceOfType(member))
7879
{
7980
return i;
8081
}

src/ImmutableObjectGraph.Generation/Syntax.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.Collections.Immutable;
66
using System.Linq;
7+
using System.Reflection;
78
using System.Text;
89
using System.Threading;
910
using System.Threading.Tasks;
@@ -74,8 +75,8 @@ internal static NameSyntax GetTypeSyntax(Type type)
7475
{
7576
Requires.NotNull(type, nameof(type));
7677

77-
SimpleNameSyntax leafType = SyntaxFactory.IdentifierName(type.IsGenericType ? type.Name.Substring(0, type.Name.IndexOf('`')) : type.Name);
78-
if (type.IsGenericType)
78+
SimpleNameSyntax leafType = SyntaxFactory.IdentifierName(type.GetTypeInfo().IsGenericType ? type.Name.Substring(0, type.Name.IndexOf('`')) : type.Name);
79+
if (type.GetTypeInfo().IsGenericType)
7980
{
8081
leafType = SyntaxFactory.GenericName(
8182
((IdentifierNameSyntax)leafType).Identifier,

src/ImmutableObjectGraph.Generation/Utilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
internal static class Utilities
1313
{
14-
internal static readonly PluralizationService PluralizationService = PluralizationService.CreateService(CultureInfo.GetCultureInfo("en-US"));
14+
internal static readonly PluralizationService PluralizationService = PluralizationService.CreateService(new CultureInfo("en-US"));
1515

1616
internal static string ToPascalCase(this string name)
1717
{

0 commit comments

Comments
 (0)