feat: add Launcher Next .NET 8 foundation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace Launcher.Next.Core;
|
||||
|
||||
public enum LauncherMode { Legacy, NextPilot, NextPreferred }
|
||||
public sealed record ProductInstallation(string ExecutablePath, string ProductVersion, string Architecture, IReadOnlyList<string> Profiles);
|
||||
public sealed record PackageFile(string Path, long Length, string Sha256, bool Optional = false);
|
||||
public sealed record StartupDefinition(string Type, string Command);
|
||||
public sealed record PackageManifest(
|
||||
int SchemaVersion, string PackageId, string Version, string Product, int ProductYear,
|
||||
string Architecture, string EntryAssembly, IReadOnlyList<PackageFile> Files, StartupDefinition Startup,
|
||||
string? MinimumLauncherVersion = null, IReadOnlyList<string>? CompatibleAutoCadSeries = null,
|
||||
string? RequiredRuntime = null, IReadOnlyList<string>? Dependencies = null,
|
||||
IReadOnlyList<string>? OptionalResources = null, string? RolloutChannel = null,
|
||||
bool Disabled = false, bool RollbackSafe = false, string? ReleaseNotesReference = null);
|
||||
public sealed record ValidationIssue(string Code, string Message);
|
||||
public sealed record ValidationResult(IReadOnlyList<ValidationIssue> Issues)
|
||||
{ public bool IsValid => Issues.Count == 0; public static ValidationResult Success { get; } = new([]); }
|
||||
public sealed record PackageProgress(string Stage, int Completed, int Total);
|
||||
public sealed record ActivationResult(string CurrentVersion, string? PreviousVersion);
|
||||
public sealed record LaunchRequest(ProductInstallation Product, string Profile, string StartupScriptPath, bool DryRun);
|
||||
public sealed record PreparedLaunch(string Executable, IReadOnlyList<string> Arguments, string WorkingDirectory, bool WouldStart);
|
||||
|
||||
public interface IProductDiscovery { ProductInstallation? DiscoverPlant3D(int year); }
|
||||
public interface IPackageCatalogClient { Task<PackageManifest?> GetManifestAsync(string packageId, CancellationToken cancellationToken); }
|
||||
public interface IPackageManifestValidator { ValidationResult Validate(PackageManifest manifest, int productYear, string architecture); }
|
||||
public interface IPackageSynchronizer { Task<ActivationResult> SynchronizeAsync(PackageManifest manifest, string sourceRoot, CancellationToken cancellationToken, IProgress<PackageProgress>? progress = null); }
|
||||
public interface ILocalPackageStore { Task<string?> GetCurrentVersionAsync(string packageId, CancellationToken cancellationToken); Task<string?> GetPreviousVersionAsync(string packageId, CancellationToken cancellationToken); }
|
||||
public interface IPackageActivator { Task<ActivationResult> ActivateAsync(string packageId, string version, CancellationToken cancellationToken); }
|
||||
public interface IRollbackManager { Task<string?> RollbackAsync(string packageId, CancellationToken cancellationToken); }
|
||||
public interface IAutodeskProcessLauncher { PreparedLaunch Prepare(LaunchRequest request); }
|
||||
public interface IStartupScriptBuilder { string BuildNetloadScript(string validatedPackageRoot, string entryAssembly); }
|
||||
public interface ILauncherConfigurationProvider { LauncherMode GetMode(); }
|
||||
public interface ILauncherTelemetry { void Write(string eventType, IReadOnlyDictionary<string, object?>? fields = null); }
|
||||
public interface IClock { DateTimeOffset UtcNow { get; } }
|
||||
public interface IFileHasher { Task<string> Sha256Async(string path, CancellationToken cancellationToken); }
|
||||
Reference in New Issue
Block a user