eliminate database provider nuget packages

This commit is contained in:
sbwalker 2023-12-14 14:32:19 -05:00
parent 0d718a5ca2
commit ade0419bf6
21 changed files with 43 additions and 158 deletions

View File

@ -1,12 +1,10 @@
using System.Data; using System.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Operations; using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders; using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using MySql.EntityFrameworkCore.Metadata; using MySql.EntityFrameworkCore.Metadata;
using Oqtane.Databases; using Oqtane.Databases;
using Oqtane.Shared;
namespace Oqtane.Database.MySQL namespace Oqtane.Database.MySQL
{ {

View File

@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl> <RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -37,7 +33,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" /> <ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup> </ItemGroup>
<Target Name="CopyPackage" AfterTargets="Pack"> <ItemGroup>
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" /> <ProviderFiles
Include="$(OutputPath)Oqtane.Database.MySQL.dll;$(OutputPath)Oqtane.Database.MySQL.pdb;$(OutputPath)MySql.EntityFrameworkCore.dll;$(OutputPath)MySql.Data.dll"
Exclude=""
DestinationPath="..\Oqtane.Server\bin\$(Configuration)\net8.0\%(Filename)%(Extension)">
</ProviderFiles>
</ItemGroup>
<Target Name="PublishProvider" AfterTargets="PostBuildEvent" Inputs="@(ProviderFiles)" Outputs="@(ProviderFiles->'%(DestinationPath)')">
<Copy SourceFiles="@(ProviderFiles)" DestinationFiles="@(ProviderFiles->'%(DestinationPath)')" />
</Target> </Target>
</Project> </Project>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Oqtane.Database.MySQL</id>
<version>5.0.0</version>
<authors>Shaun Walker</authors>
<owners>.NET Foundation</owners>
<title>Oqtane MySQL Provider</title>
<summary>MySQL database support for the Oqtane Framework</summary>
<description>MySQL database support for the Oqtane Framework</description>
<copyright>.NET Foundation</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v5.0.0</releaseNotes>
<icon>icon.png</icon>
<tags>oqtane</tags>
</metadata>
<files>
<file src="bin\net8.0\Oqtane.Database.MySQL.dll" target="lib\net8.0" />
<file src="bin\net8.0\Oqtane.Database.MySQL.pdb" target="lib\net8.0" />
<file src="bin\net8.0\MySql.EntityFrameworkCore.dll" target="lib\net8.0" />
<file src="bin\net8.0\MySql.Data.dll" target="lib\net8.0" />
<file src="icon.png" target="" />
</files>
</package>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl> <RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -38,7 +34,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" /> <ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup> </ItemGroup>
<Target Name="CopyPackage" AfterTargets="Pack"> <ItemGroup>
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" /> <ProviderFiles
Include="$(OutputPath)Oqtane.Database.PostgreSQL.dll;$(OutputPath)Oqtane.Database.PostgreSQL.pdb;$(OutputPath)EFCore.NamingConventions.dll;$(OutputPath)Npgsql.EntityFrameworkCore.PostgreSQL.dll;$(OutputPath)Npgsql.dll"
Exclude=""
DestinationPath="..\Oqtane.Server\bin\$(Configuration)\net8.0\%(Filename)%(Extension)">
</ProviderFiles>
</ItemGroup>
<Target Name="PublishProvider" AfterTargets="PostBuildEvent" Inputs="@(ProviderFiles)" Outputs="@(ProviderFiles->'%(DestinationPath)')">
<Copy SourceFiles="@(ProviderFiles)" DestinationFiles="@(ProviderFiles->'%(DestinationPath)')" />
</Target> </Target>
</Project> </Project>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Oqtane.Database.PostgreSQL</id>
<version>5.0.0</version>
<authors>Shaun Walker</authors>
<owners>.NET Foundation</owners>
<title>Oqtane PostgreSQL Provider</title>
<summary>PostgreSQL database support for the Oqtane Framework</summary>
<description>PostgreSQL database support for the Oqtane Framework</description>
<copyright>.NET Foundation</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v5.0.0</releaseNotes>
<icon>icon.png</icon>
<tags>oqtane</tags>
</metadata>
<files>
<file src="bin\net8.0\Oqtane.Database.PostgreSQL.dll" target="lib\net8.0" />
<file src="bin\net8.0\Oqtane.Database.PostgreSQL.pdb" target="lib\net8.0" />
<file src="bin\net8.0\EFCore.NamingConventions.dll" target="lib\net8.0" />
<file src="bin\net8.0\Npgsql.EntityFrameworkCore.PostgreSQL.dll" target="lib\net8.0" />
<file src="bin\net8.0\Npgsql.dll" target="lib\net8.0" />
<file src="icon.png" target="" />
</files>
</package>

View File

@ -1,11 +1,9 @@
using System; using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal; using Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal;
using Oqtane.Migrations.Framework; using Oqtane.Migrations.Framework;
using Oqtane.Models; using Oqtane.Models;
using Oqtane.Shared;
// ReSharper disable ClassNeverInstantiated.Global // ReSharper disable ClassNeverInstantiated.Global

View File

@ -9,7 +9,6 @@ using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using Npgsql; using Npgsql;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Oqtane.Databases; using Oqtane.Databases;
using Oqtane.Shared;
namespace Oqtane.Database.PostgreSQL namespace Oqtane.Database.PostgreSQL
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl> <RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -36,8 +32,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" /> <ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup> </ItemGroup>
<Target Name="CopyPackage" AfterTargets="Pack"> <ItemGroup>
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" /> <ProviderFiles
Include="$(OutputPath)Oqtane.Database.SqlServer.dll;$(OutputPath)Oqtane.Database.SqlServer.pdb;$(OutputPath)Microsoft.EntityFrameworkCore.SqlServer.dll"
Exclude=""
DestinationPath="..\Oqtane.Server\bin\$(Configuration)\net8.0\%(Filename)%(Extension)">
</ProviderFiles>
</ItemGroup>
<Target Name="PublishProvider" AfterTargets="PostBuildEvent" Inputs="@(ProviderFiles)" Outputs="@(ProviderFiles->'%(DestinationPath)')">
<Copy SourceFiles="@(ProviderFiles)" DestinationFiles="@(ProviderFiles->'%(DestinationPath)')" />
</Target> </Target>
</Project> </Project>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Oqtane.Database.SqlServer</id>
<version>5.0.0</version>
<authors>Shaun Walker</authors>
<owners>.NET Foundation</owners>
<title>Oqtane SQL Server Provider</title>
<summary>SQL Server database support for the Oqtane Framework</summary>
<description>SQL Server database support for the Oqtane Framework</description>
<copyright>.NET Foundation</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v5.0.0</releaseNotes>
<icon>icon.png</icon>
<tags>oqtane</tags>
</metadata>
<files>
<file src="bin\net8.0\Oqtane.Database.SqlServer.dll" target="lib\net8.0" />
<file src="bin\net8.0\Oqtane.Database.SqlServer.pdb" target="lib\net8.0" />
<file src="bin\net8.0\Microsoft.EntityFrameworkCore.SqlServer.dll" target="lib\net8.0" />
<file src="icon.png" target="" />
</files>
</package>

View File

@ -1,13 +1,9 @@
using System; using System;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.SqlServer.Migrations.Internal; using Microsoft.EntityFrameworkCore.SqlServer.Migrations.Internal;
using Microsoft.EntityFrameworkCore.Storage;
using Oqtane.Migrations.Framework; using Oqtane.Migrations.Framework;
using Oqtane.Models; using Oqtane.Models;
using Oqtane.Shared;
// ReSharper disable ClassNeverInstantiated.Global // ReSharper disable ClassNeverInstantiated.Global

View File

@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Operations; using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders; using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using Oqtane.Databases; using Oqtane.Databases;
using Oqtane.Shared;
namespace Oqtane.Database.SqlServer namespace Oqtane.Database.SqlServer
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl> <RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -36,8 +32,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" /> <ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup> </ItemGroup>
<Target Name="CopyPackage" AfterTargets="Pack"> <ItemGroup>
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" /> <ProviderFiles
Include="$(OutputPath)Oqtane.Database.Sqlite.dll;$(OutputPath)Oqtane.Database.Sqlite.pdb;$(OutputPath)Microsoft.EntityFrameworkCore.Sqlite.dll"
Exclude=""
DestinationPath="..\Oqtane.Server\bin\$(Configuration)\net8.0\%(Filename)%(Extension)">
</ProviderFiles>
</ItemGroup>
<Target Name="PublishProvider" AfterTargets="PostBuildEvent" Inputs="@(ProviderFiles)" Outputs="@(ProviderFiles->'%(DestinationPath)')">
<Copy SourceFiles="@(ProviderFiles)" DestinationFiles="@(ProviderFiles->'%(DestinationPath)')" />
</Target> </Target>
</Project> </Project>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Oqtane.Database.Sqlite</id>
<version>5.0.0</version>
<authors>Shaun Walker</authors>
<owners>.NET Foundation</owners>
<title>Oqtane SQLite Provider</title>
<summary>SQLite database support for the Oqtane Framework</summary>
<description>SQLite database support for the Oqtane Framework</description>
<copyright>.NET Foundation</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v5.0.0</releaseNotes>
<icon>icon.png</icon>
<tags>oqtane</tags>
</metadata>
<files>
<file src="bin\net8.0\Oqtane.Database.Sqlite.dll" target="lib\net8.0" />
<file src="bin\net8.0\Oqtane.Database.Sqlite.pdb" target="lib\net8.0" />
<file src="bin\net8.0\Microsoft.EntityFrameworkCore.Sqlite.dll" target="lib\net8.0" />
<file src="icon.png" target="" />
</files>
</package>

View File

@ -1,11 +1,9 @@
using System; using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Sqlite.Migrations.Internal; using Microsoft.EntityFrameworkCore.Sqlite.Migrations.Internal;
using Oqtane.Migrations.Framework; using Oqtane.Migrations.Framework;
using Oqtane.Models; using Oqtane.Models;
using Oqtane.Shared;
// ReSharper disable ClassNeverInstantiated.Global // ReSharper disable ClassNeverInstantiated.Global

View File

@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Operations; using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders; using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using Oqtane.Databases; using Oqtane.Databases;
using Oqtane.Shared;
namespace Oqtane.Database.Sqlite namespace Oqtane.Database.Sqlite
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -46,27 +46,12 @@ namespace Oqtane.Infrastructure
string errors = ""; string errors = "";
string binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location); string binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
string sourceFolder = Path.Combine(contentRootPath, "Packages"); string sourceFolder = Path.Combine(contentRootPath, Constants.PackagesFolder);
if (!Directory.Exists(sourceFolder)) if (!Directory.Exists(sourceFolder))
{ {
Directory.CreateDirectory(sourceFolder); Directory.CreateDirectory(sourceFolder);
} }
// move core framework distribution packages to secure /Packages folder
string folder = Path.Combine(webRootPath, "Packages");
if (Directory.Exists(folder))
{
foreach (var file in Directory.GetFiles(folder, "*.nupkg"))
{
var destinationFile = Path.Combine(sourceFolder, Path.GetFileName(file));
if (File.Exists(destinationFile))
{
File.Delete(destinationFile);
}
File.Move(file, destinationFile);
}
}
// install Nuget packages in secure Packages folder // install Nuget packages in secure Packages folder
foreach (string packagename in Directory.GetFiles(sourceFolder, "*.nupkg")) foreach (string packagename in Directory.GetFiles(sourceFolder, "*.nupkg"))
{ {

View File

@ -4,9 +4,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore; using Microsoft.AspNetCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Oqtane.Infrastructure; using Oqtane.Infrastructure;
using System.Diagnostics;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Oqtane.Shared;
using Oqtane.Documentation; using Oqtane.Documentation;
namespace Oqtane.Server namespace Oqtane.Server