Skip to content

Commit

Permalink
Fixed some errors on ILLinking
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbra committed May 11, 2024
1 parent 186aa55 commit 300635a
Show file tree
Hide file tree
Showing 32 changed files with 88 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/grate.core/grate.core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<RootNamespace>grate</RootNamespace>
<SourceRevisionId>build$([System.DateTime]::UtcNow.ToString("O"))</SourceRevisionId>

<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/grate.mariadb/grate.mariadb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetTargetFrameworks)</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/grate.oracle/grate.oracle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetTargetFrameworks)</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/grate.postgresql/grate.postgresql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetTargetFrameworks)</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/grate.sqlite/grate.sqlite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetTargetFrameworks)</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/grate.sqlserver/grate.sqlserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetTargetFrameworks)</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions unittests/Basic_tests/Basic_tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<IsTestProject>true</IsTestProject>
<RootNamespace>Basic_tests</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
1 change: 1 addition & 0 deletions unittests/Docker/Docker.Common/Docker.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>

Expand Down
1 change: 1 addition & 0 deletions unittests/Docker/Docker.MariaDB/Docker.MariaDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
1 change: 1 addition & 0 deletions unittests/Docker/Docker.Oracle/Docker.Oracle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
1 change: 1 addition & 0 deletions unittests/Docker/Docker.SqlServer/Docker.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
1 change: 1 addition & 0 deletions unittests/Docker/Docker.Sqlite/Docker.Sqlite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

Expand Down
26 changes: 14 additions & 12 deletions unittests/MariaDB/MariaDB.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio"/>
<PackageReference Include="XunitXml.TestLogger" />
<PackageReference Include="coverlet.collector" />
<PackageReference Include="Testcontainers.MariaDb" />
<PackageReference Include="Xunit.DependencyInjection" />
<PackageReference Include="Xunit.DependencyInjection.Logging" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio"/>
<PackageReference Include="XunitXml.TestLogger" />
<PackageReference Include="coverlet.collector" />
<PackageReference Include="Testcontainers.MariaDb" />
<PackageReference Include="Xunit.DependencyInjection" />
<PackageReference Include="Xunit.DependencyInjection.Logging" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 6 additions & 4 deletions unittests/Oracle/Oracle.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Data;
using System.Diagnostics.CodeAnalysis;
using Docker.DotNet.Models;
using grate.Infrastructure;
using grate.Migration;
Expand Down
10 changes: 6 additions & 4 deletions unittests/PostgreSQL/PostgreSQL.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
14 changes: 8 additions & 6 deletions unittests/SqlServer/SqlServer.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio"/>
Expand All @@ -17,7 +19,7 @@
<PackageReference Include="Testcontainers.MsSql" />
<PackageReference Include="Xunit.DependencyInjection" />
<PackageReference Include="Xunit.DependencyInjection.Logging" />
</ItemGroup>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\grate\grate.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Data;
using System.Diagnostics.CodeAnalysis;
using grate.Infrastructure;
using grate.Migration;
using grate.SqlServer.Infrastructure;
Expand Down
10 changes: 6 additions & 4 deletions unittests/SqlServerCaseSensitive/SqlServerCaseSensitive.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 6 additions & 4 deletions unittests/Sqlite/Sqlite.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions unittests/TestCommon/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using DotNet.Testcontainers.Builders;
using grate.Configuration;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -38,8 +39,13 @@ public void ConfigureServices(IServiceCollection services, HostBuilderContext co
RegisterTestDatabase(services, context.Configuration);
}

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
protected abstract Type TestContainerDatabaseType { get; }

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
protected abstract Type ExternalTestDatabaseType { get; }

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
protected abstract Type TestContextType { get; }

// ReSharper disable once UnassignedGetOnlyAutoProperty
Expand Down
12 changes: 9 additions & 3 deletions unittests/TestCommon/Startup_T.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
using System.Diagnostics.CodeAnalysis;
using TestCommon.TestInfrastructure;

namespace TestCommon;

public abstract class Startup<
TTestContainerDatabase,
TExternalDatabase,
TGrateTestContext>: Startup
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TTestContainerDatabase,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TExternalDatabase,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TGrateTestContext>: Startup
where TTestContainerDatabase : ITestDatabase
where TExternalDatabase : ITestDatabase
where TGrateTestContext : IGrateTestContext
{
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
protected override Type TestContainerDatabaseType => typeof(TTestContainerDatabase);

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
protected override Type ExternalTestDatabaseType => typeof(TExternalDatabase);

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
protected override Type TestContextType => typeof(TGrateTestContext);
}
2 changes: 2 additions & 0 deletions unittests/TestCommon/TestCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<IsTestProject>false</IsTestProject>
<NoWarn>IL2072;IL2075;IL2026</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions unittests/TestCommon/TestInfrastructure/GrateTestContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Data;
using System.Diagnostics.CodeAnalysis;
using Dapper;
using grate.Infrastructure;
using grate.Migration;
Expand Down Expand Up @@ -41,7 +42,9 @@ public async Task DropDatabase(string databaseName)

public abstract ISyntax Syntax { get; }
public abstract Type DbExceptionType { get; }

public abstract Type DatabaseType { get; }

public abstract bool SupportsTransaction { get; }
public abstract SqlStatements Sql { get; }
public abstract string ExpectedVersionPrefix { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Data;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using grate.Configuration;
using grate.Infrastructure;
Expand Down

0 comments on commit 300635a

Please sign in to comment.