-
-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into listview-to-itemsview
- Loading branch information
Showing
29 changed files
with
1,295 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/UniGetUI.Interface.BackgroundApi/UniGetUI.Interface.BackgroundApi.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers> | ||
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier> | ||
<Platforms>x64</Platforms> | ||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion> | ||
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion> | ||
<SdkVersion>8.0.204</SdkVersion> | ||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> | ||
<PublishSelfContained>true</PublishSelfContained> | ||
<FileVersion>3.1.0.0</FileVersion> | ||
<InformationalVersion>3.1.0-alpha0</InformationalVersion> | ||
<Product>UniGetUI</Product> | ||
<Authors>Martí Climent and the contributors</Authors> | ||
<PublisherName>Martí Climent</PublisherName> | ||
<ApplicationVersion>3.1.0-alpha0</ApplicationVersion> | ||
<Copyright>2024, Martí Climent</Copyright> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Nancy" Version="2.0.0" /> | ||
<PackageReference Include="Nancy.Hosting.Self" Version="2.0.0"> | ||
<NoWarn>NU1701</NoWarn> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\UniGetUI.Core.Classes\UniGetUI.Core.Classes.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Data\UniGetUI.Core.Data.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.IconStore\UniGetUI.Core.IconEngine.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.LanguageEngine\UniGetUI.Core.LanguageEngine.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Logger\UniGetUI.Core.Logging.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Settings\UniGetUI.Core.Settings.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Tools\UniGetUI.Core.Tools.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Enums\UniGetUI.PackageEngine.Enums.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.PackageEngine\UniGetUI.PackageEngine.PEInterface.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.PackageManagerClasses\UniGetUI.PackageEngine.Classes.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using UniGetUI.PackageEngine.ManagerClasses.Manager; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UniGetUI.PackageEngine.Managers.WingetManager; | ||
using UniGetUI.PackageEngine.Managers.ScoopManager; | ||
using UniGetUI.PackageEngine.Managers.ChocolateyManager; | ||
using UniGetUI.PackageEngine.Managers.DotNetManager; | ||
using UniGetUI.PackageEngine.Managers.NpmManager; | ||
using UniGetUI.PackageEngine.Managers.PowerShellManager; | ||
using UniGetUI.PackageEngine.Managers.PipManager; | ||
using UniGetUI.PackageEngine.PackageLoader; | ||
using UniGetUI.Core.Logging; | ||
|
||
namespace UniGetUI.PackageEngine | ||
{ | ||
public static class PEInterface | ||
{ | ||
private const int ManagerLoadTimeout = 10000; // 10 seconds timeout for Package Manager initialization | ||
|
||
public static readonly WinGet WinGet = new WinGet(); | ||
public static readonly Scoop Scoop = new Scoop(); | ||
public static readonly Chocolatey Chocolatey = new Chocolatey(); | ||
public static readonly Npm Npm = new Npm(); | ||
public static readonly Pip Pip = new Pip(); | ||
public static readonly DotNet DotNet = new DotNet(); | ||
public static readonly PowerShell PowerShell = new PowerShell(); | ||
|
||
public static readonly PackageManager[] Managers = [WinGet, Scoop, Chocolatey, Npm, Pip, DotNet, PowerShell]; | ||
|
||
public static readonly DiscoverablePackagesLoader DiscoveredPackagesLoader = new(Managers); | ||
public static readonly UpgradablePackagesLoader UpgradablePackagesLoader = new(Managers); | ||
public static readonly InstalledPackagesLoader InstalledPackagesLoader = new(Managers); | ||
|
||
public static async Task Initialize() | ||
{ | ||
List<Task> initializeTasks = new(); | ||
|
||
foreach (PackageManager manager in Managers) | ||
{ | ||
initializeTasks.Add(manager.InitializeAsync()); | ||
} | ||
|
||
Task ManagersMetaTask = Task.WhenAll(initializeTasks); | ||
try | ||
{ | ||
await ManagersMetaTask.WaitAsync(TimeSpan.FromMilliseconds(ManagerLoadTimeout)); | ||
} | ||
catch (Exception e) | ||
{ | ||
Logger.Error(e); | ||
} | ||
if (ManagersMetaTask.IsCompletedSuccessfully == false) | ||
Logger.Warn("Timeout: Not all package managers have finished initializing."); | ||
|
||
_ = UpgradablePackagesLoader.ReloadPackages(); | ||
_ = InstalledPackagesLoader.ReloadPackages(); | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/UniGetUI.PackageEngine.PackageEngine/UniGetUI.PackageEngine.PEInterface.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers> | ||
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier> | ||
<Platforms>x64</Platforms> | ||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion> | ||
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion> | ||
<SdkVersion>8.0.204</SdkVersion> | ||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> | ||
<PublishSelfContained>true</PublishSelfContained> | ||
<FileVersion>3.1.0.0</FileVersion> | ||
<InformationalVersion>3.1.0-alpha0</InformationalVersion> | ||
<Product>UniGetUI</Product> | ||
<Authors>Martí Climent and the contributors</Authors> | ||
<PublisherName>Martí Climent</PublisherName> | ||
<ApplicationVersion>3.1.0-alpha0</ApplicationVersion> | ||
<Copyright>2024, Martí Climent</Copyright> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\UniGetUI.Core.Classes\UniGetUI.Core.Classes.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Data\UniGetUI.Core.Data.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.IconStore\UniGetUI.Core.IconEngine.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.LanguageEngine\UniGetUI.Core.LanguageEngine.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Logger\UniGetUI.Core.Logging.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Settings\UniGetUI.Core.Settings.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.Core.Tools\UniGetUI.Core.Tools.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Enums\UniGetUI.PackageEngine.Enums.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.Chocolatey\UniGetUI.PackageEngine.Managers.Chocolatey.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.Dotnet\UniGetUI.PackageEngine.Managers.Dotnet.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.Generic.NuGet\UniGetUI.PackageEngine.Managers.Generic.NuGet.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.Npm\UniGetUI.PackageEngine.Managers.Npm.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.Pip\UniGetUI.PackageEngine.Managers.Pip.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.PowerShell\UniGetUI.PackageEngine.Managers.PowerShell.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.Scoop\UniGetUI.PackageEngine.Managers.Scoop.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.Managers.WinGet\UniGetUI.PackageEngine.Managers.WinGet.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.PackageLoader\UniGetUI.PackageEngine.PackageLoaders.csproj" /> | ||
<ProjectReference Include="..\UniGetUI.PackageEngine.PackageManagerClasses\UniGetUI.PackageEngine.Classes.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.