Skip to content

Commit d89c18d

Browse files
authored
Merge pull request #1 from igor-tkachev/working
Update project structure
2 parents 23d2e1c + b49dc30 commit d89c18d

12 files changed

Lines changed: 87 additions & 117 deletions

.github/workflows/dotnet.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,21 @@ name: .NET
55

66
on:
77
push:
8-
branches: [ "master" ]
98
pull_request:
10-
branches: [ "master" ]
119

1210
jobs:
1311
build:
14-
1512
runs-on: ubuntu-latest
1613

1714
steps:
1815
- uses: actions/checkout@v3
1916
- name: Setup .NET
2017
uses: actions/setup-dotnet@v3
2118
with:
22-
dotnet-version: 8.0.x
19+
dotnet-version: 9.0.x
2320
- name: Restore dependencies
2421
run: dotnet restore
2522
- name: Build
2623
run: dotnet build --no-restore
2724
- name: Test
28-
run: dotnet test --no-build --verbosity normal
25+
run: dotnet test --no-build --verbosity detailed

Build.cmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
cd /d "%~dp0"
2-
"%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe" Linq.Expressions.Deconstruct.sln /p:Configuration=Release /t:Restore;Rebuild /v:m
3-
"%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe" Linq.Expressions.Deconstruct.sln /p:Configuration=Debug /t:Restore;Rebuild /v:m
1+
cd /d "%~dp0"
2+
dotnet restore
3+
dotnet build --no-restore
4+
dotnet test --no-build --verbosity normal
5+

Directory.Build.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<LangVersion>preview</LangVersion>
4+
<Nullable>enable</Nullable>
5+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
6+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="PolySharp">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageReference>
14+
</ItemGroup>
15+
</Project>

Directory.Packages.props

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
<ItemGroup>
3+
<PackageVersion Include="PolySharp" Version="1.15.0" />
4+
<PackageVersion Include="Appveyor.TestLogger" Version="2.0.0" />
5+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
6+
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" />
7+
<PackageVersion Include="NUnit" Version="4.3.2" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
9+
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0" />
10+
</ItemGroup>
11+
</Project>

Linq.Expressions.Deconstruct.sln

Lines changed: 0 additions & 53 deletions
This file was deleted.

Linq.Expressions.Deconstruct.slnx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Solution>
2+
<Folder Name="/.github/" />
3+
<Folder Name="/.github/workflows/">
4+
<File Path=".github/workflows/dotnet.yml" />
5+
</Folder>
6+
<Folder Name="/.root/">
7+
<File Path="Build.cmd" />
8+
<File Path="Directory.Build.props" />
9+
<File Path="Directory.Packages.props" />
10+
<File Path="LICENSE.TXT" />
11+
<File Path="README.md" />
12+
</Folder>
13+
<Project Path="Source/Linq.Expressions.Deconstruct.csproj" />
14+
<Project Path="SourceGenerators/SourceGenerators.csproj" />
15+
<Project Path="Tests/Linq.Expressions.Deconstruct.Tests.csproj" />
16+
</Solution>

Source/Expr.tt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ namespace Linq.Expressions.Deconstruct
9191

9292
foreach (var item in new []
9393
{
94-
"Add", "AddChecked", "And", "AndAlso", "ArrayIndex",
95-
"Assign", "Coalesce", "Divide", "Equal", "ExclusiveOr",
96-
"GreaterThan", "GreaterThanOrEqual", "LeftShift", "LessThan", "LessThanOrEqual",
97-
"Modulo", "Multiply", "MultiplyChecked", "NotEqual", "Or",
98-
"OrElse", "Power", "RightShift", "Subtract", "SubtractChecked",
99-
"AddAssign", "AndAssign", "DivideAssign", "ExclusiveOrAssign", "LeftShiftAssign",
100-
"ModuloAssign", "MultiplyAssign", "OrAssign", "PowerAssign", "RightShiftAssign",
101-
"SubtractAssign", "AddAssignChecked", "MultiplyAssignChecked", "SubtractAssignChecked",
94+
"Add", "AddChecked", "And", "AndAlso", "ArrayIndex",
95+
"Assign", "Coalesce", "Divide", "Equal", "ExclusiveOr",
96+
"GreaterThan", "GreaterThanOrEqual", "LeftShift", "LessThan", "LessThanOrEqual",
97+
"Modulo", "Multiply", "MultiplyChecked", "NotEqual", "Or",
98+
"OrElse", "Power", "RightShift", "Subtract", "SubtractChecked",
99+
"AddAssign", "AndAssign", "DivideAssign", "ExclusiveOrAssign", "LeftShiftAssign",
100+
"ModuloAssign", "MultiplyAssign", "OrAssign", "PowerAssign", "RightShiftAssign",
101+
"SubtractAssign", "AddAssignChecked", "MultiplyAssignChecked", "SubtractAssignChecked",
102102
})
103103
{
104104
#>
@@ -148,9 +148,9 @@ namespace Linq.Expressions.Deconstruct
148148

149149
foreach (var item in new []
150150
{
151-
"ArrayLength", "Convert", "ConvertChecked", "Negate", "NegateChecked",
152-
"Not", "Quote", "TypeAs", "UnaryPlus", "Decrement",
153-
"Increment", "IsFalse", "IsTrue", "Throw", "Unbox",
151+
"ArrayLength", "Convert", "ConvertChecked", "Negate", "NegateChecked",
152+
"Not", "Quote", "TypeAs", "UnaryPlus", "Decrement",
153+
"Increment", "IsFalse", "IsTrue", "Throw", "Unbox",
154154
"PreIncrementAssign", "PreDecrementAssign", "PostIncrementAssign", "PostDecrementAssign", "OnesComplement",
155155
})
156156
{

Source/Linq.Expressions.Deconstruct.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5-
<LangVersion>preview</LangVersion>
6-
<Nullable>enable</Nullable>
75
<SignAssembly>true</SignAssembly>
86
<AssemblyOriginatorKeyFile>Linq.Expressions.Deconstruct.snk</AssemblyOriginatorKeyFile>
97
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -30,11 +28,6 @@
3028

3129
<ProjectReference Include="..\SourceGenerators\SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
3230

33-
<PackageReference Include="PolySharp" Version="1.15.0">
34-
<PrivateAssets>all</PrivateAssets>
35-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36-
</PackageReference>
37-
3831
<Compile Update="Expr.generated.cs">
3932
<DesignTime>True</DesignTime>
4033
<AutoGen>True</AutoGen>

SourceGenerators/SourceGenerators.csproj

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5-
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
6-
<LangVersion>preview</LangVersion>
75
</PropertyGroup>
86

97
<ItemGroup>
10-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
11-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
12-
<PackageReference Include="PolySharp" Version="1.15.0">
13-
<PrivateAssets>all</PrivateAssets>
14-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15-
</PackageReference>
8+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
9+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
1610
</ItemGroup>
11+
1712
</Project>

SourceGenerators/ToExprGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ sealed class ToExprAttribute : Attribute
6565

6666
foreach (var group in grouped)
6767
{
68-
var classSource = ProcessClass((INamedTypeSymbol)group.Key, group.ToList(), spc);
69-
spc.AddSource($"{group.Key.Name}.ToExpr.g.cs", SourceText.From(classSource, Encoding.UTF8));
68+
var classSource = ProcessClass((INamedTypeSymbol)group.Key!, group.ToList(), spc);
69+
spc.AddSource($"{group.Key!.Name}.ToExpr.g.cs", SourceText.From(classSource, Encoding.UTF8));
7070
}
7171
});
7272
}
7373

74-
static IFieldSymbol GetFieldSymbolWithAttribute(GeneratorSyntaxContext context)
74+
static IFieldSymbol? GetFieldSymbolWithAttribute(GeneratorSyntaxContext context)
7575
{
7676
if (context.Node is not FieldDeclarationSyntax fieldDeclaration)
7777
return null;

0 commit comments

Comments
 (0)