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

eliminate database provider nuget packages #3553

Merged
merged 1 commit into from
Dec 14, 2023
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
2 changes: 0 additions & 2 deletions Oqtane.Database.MySQL/MySQLDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using MySql.Data.MySqlClient;
using MySql.EntityFrameworkCore.Metadata;
using Oqtane.Databases;
using Oqtane.Shared;

namespace Oqtane.Database.MySQL
{
Expand Down
17 changes: 11 additions & 6 deletions Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -37,7 +33,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup>

<Target Name="CopyPackage" AfterTargets="Pack">
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" />
<ItemGroup>
<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>

</Project>
26 changes: 0 additions & 26 deletions Oqtane.Database.MySQL/Oqtane.Database.MySQL.nuspec

This file was deleted.

Binary file removed Oqtane.Database.MySQL/icon.png
Binary file not shown.
17 changes: 11 additions & 6 deletions Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -38,7 +34,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup>

<Target Name="CopyPackage" AfterTargets="Pack">
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" />
<ItemGroup>
<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>

</Project>
27 changes: 0 additions & 27 deletions Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.nuspec

This file was deleted.

2 changes: 0 additions & 2 deletions Oqtane.Database.PostgreSQL/OqtaneHistoryRepository.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal;
using Oqtane.Migrations.Framework;
using Oqtane.Models;
using Oqtane.Shared;

// ReSharper disable ClassNeverInstantiated.Global

Expand Down
1 change: 0 additions & 1 deletion Oqtane.Database.PostgreSQL/PostgreSQLDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Npgsql;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Oqtane.Databases;
using Oqtane.Shared;

namespace Oqtane.Database.PostgreSQL
{
Expand Down
Binary file removed Oqtane.Database.PostgreSQL/icon.png
Binary file not shown.
16 changes: 10 additions & 6 deletions Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -36,8 +32,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup>

<Target Name="CopyPackage" AfterTargets="Pack">
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" />
<ItemGroup>
<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>

</Project>
25 changes: 0 additions & 25 deletions Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.nuspec

This file was deleted.

4 changes: 0 additions & 4 deletions Oqtane.Database.SqlServer/OqtaneHistoryRepository.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.SqlServer.Migrations.Internal;
using Microsoft.EntityFrameworkCore.Storage;
using Oqtane.Migrations.Framework;
using Oqtane.Models;
using Oqtane.Shared;

// ReSharper disable ClassNeverInstantiated.Global

Expand Down
1 change: 0 additions & 1 deletion Oqtane.Database.SqlServer/SqlServerDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using Oqtane.Databases;
using Oqtane.Shared;

namespace Oqtane.Database.SqlServer
{
Expand Down
Binary file removed Oqtane.Database.SqlServer/icon.png
Binary file not shown.
16 changes: 10 additions & 6 deletions Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<PackageName>$(MSBuildProjectName).$(Version).nupkg</PackageName>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -36,8 +32,16 @@
<ProjectReference Include="..\Oqtane.Server\Oqtane.Server.csproj" />
</ItemGroup>

<Target Name="CopyPackage" AfterTargets="Pack">
<Copy SourceFiles="$(OutputPath)..\$(PackageName)" DestinationFiles="..\Oqtane.Server\wwwroot\Packages\$(MSBuildProjectName).nupkg" />
<ItemGroup>
<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>

</Project>
25 changes: 0 additions & 25 deletions Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.nuspec

This file was deleted.

2 changes: 0 additions & 2 deletions Oqtane.Database.Sqlite/OqtaneHistoryRepository.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Sqlite.Migrations.Internal;
using Oqtane.Migrations.Framework;
using Oqtane.Models;
using Oqtane.Shared;

// ReSharper disable ClassNeverInstantiated.Global

Expand Down
1 change: 0 additions & 1 deletion Oqtane.Database.Sqlite/SqliteDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders;
using Oqtane.Databases;
using Oqtane.Shared;

namespace Oqtane.Database.Sqlite
{
Expand Down
Binary file removed Oqtane.Database.Sqlite/icon.png
Binary file not shown.
17 changes: 1 addition & 16 deletions Oqtane.Server/Infrastructure/InstallationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,12 @@ public static string InstallPackages(string webRootPath, string contentRootPath)
string errors = "";
string binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);

string sourceFolder = Path.Combine(contentRootPath, "Packages");
string sourceFolder = Path.Combine(contentRootPath, Constants.PackagesFolder);
if (!Directory.Exists(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
foreach (string packagename in Directory.GetFiles(sourceFolder, "*.nupkg"))
{
Expand Down
2 changes: 0 additions & 2 deletions Oqtane.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using Microsoft.AspNetCore;
using Microsoft.Extensions.DependencyInjection;
using Oqtane.Infrastructure;
using System.Diagnostics;
using Microsoft.Extensions.Logging;
using Oqtane.Shared;
using Oqtane.Documentation;

namespace Oqtane.Server
Expand Down