2022-03-13 22:47:30 +00:00
|
|
|
|
using System;
|
2022-07-12 21:47:53 +00:00
|
|
|
|
using System.Collections.Generic;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reactive;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Wabbajack.Messages;
|
|
|
|
|
using ReactiveUI;
|
|
|
|
|
using System.Reactive.Disposables;
|
|
|
|
|
using System.Reactive.Linq;
|
|
|
|
|
using System.Text.Json;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Media;
|
2022-08-05 03:46:15 +00:00
|
|
|
|
using System.Windows.Threading;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
using DynamicData;
|
|
|
|
|
using Microsoft.WindowsAPICodePack.Dialogs;
|
|
|
|
|
using ReactiveUI.Fody.Helpers;
|
|
|
|
|
using Wabbajack.Common;
|
|
|
|
|
using Wabbajack.Compiler;
|
|
|
|
|
using Wabbajack.DTOs;
|
|
|
|
|
using Wabbajack.DTOs.JsonConverters;
|
|
|
|
|
using Wabbajack.Models;
|
2022-07-13 21:22:05 +00:00
|
|
|
|
using Wabbajack.Networking.WabbajackClientApi;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
using Wabbajack.Paths;
|
|
|
|
|
using Wabbajack.Paths.IO;
|
2022-08-05 03:46:15 +00:00
|
|
|
|
using Wabbajack.RateLimiter;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
using Wabbajack.Services.OSIntegrated;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum CompilerState
|
|
|
|
|
{
|
|
|
|
|
Configuration,
|
|
|
|
|
Compiling,
|
|
|
|
|
Completed,
|
|
|
|
|
Errored
|
|
|
|
|
}
|
|
|
|
|
public class CompilerVM : BackNavigatingVM, ICpuStatusVM
|
|
|
|
|
{
|
|
|
|
|
private const string LastSavedCompilerSettings = "last-saved-compiler-settings";
|
|
|
|
|
private readonly DTOSerializer _dtos;
|
|
|
|
|
private readonly SettingsManager _settingsManager;
|
|
|
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
|
private readonly ILogger<CompilerVM> _logger;
|
|
|
|
|
private readonly ResourceMonitor _resourceMonitor;
|
2022-05-25 02:59:15 +00:00
|
|
|
|
private readonly CompilerSettingsInferencer _inferencer;
|
2022-07-13 21:22:05 +00:00
|
|
|
|
private readonly Client _wjClient;
|
2022-08-05 03:46:15 +00:00
|
|
|
|
|
|
|
|
|
[Reactive] public string StatusText { get; set; }
|
|
|
|
|
[Reactive] public Percent StatusProgress { get; set; }
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
|
|
|
|
[Reactive]
|
|
|
|
|
public CompilerState State { get; set; }
|
|
|
|
|
|
|
|
|
|
[Reactive]
|
|
|
|
|
public ISubCompilerVM SubCompilerVM { get; set; }
|
|
|
|
|
|
|
|
|
|
// Paths
|
|
|
|
|
public FilePickerVM ModlistLocation { get; }
|
|
|
|
|
public FilePickerVM DownloadLocation { get; }
|
|
|
|
|
public FilePickerVM OutputLocation { get; }
|
|
|
|
|
|
|
|
|
|
// Modlist Settings
|
|
|
|
|
|
|
|
|
|
[Reactive] public string ModListName { get; set; }
|
|
|
|
|
[Reactive] public string Version { get; set; }
|
|
|
|
|
[Reactive] public string Author { get; set; }
|
|
|
|
|
[Reactive] public string Description { get; set; }
|
|
|
|
|
public FilePickerVM ModListImagePath { get; } = new();
|
|
|
|
|
[Reactive] public ImageSource ModListImage { get; set; }
|
|
|
|
|
[Reactive] public string Website { get; set; }
|
|
|
|
|
[Reactive] public string Readme { get; set; }
|
|
|
|
|
[Reactive] public bool IsNSFW { get; set; }
|
|
|
|
|
[Reactive] public bool PublishUpdate { get; set; }
|
|
|
|
|
[Reactive] public string MachineUrl { get; set; }
|
|
|
|
|
[Reactive] public Game BaseGame { get; set; }
|
|
|
|
|
[Reactive] public string SelectedProfile { get; set; }
|
|
|
|
|
[Reactive] public AbsolutePath GamePath { get; set; }
|
|
|
|
|
[Reactive] public bool IsMO2Compilation { get; set; }
|
|
|
|
|
|
|
|
|
|
[Reactive] public RelativePath[] AlwaysEnabled { get; set; } = Array.Empty<RelativePath>();
|
2022-05-26 05:21:12 +00:00
|
|
|
|
[Reactive] public RelativePath[] NoMatchInclude { get; set; } = Array.Empty<RelativePath>();
|
2022-07-27 03:56:30 +00:00
|
|
|
|
[Reactive] public RelativePath[] Include { get; set; } = Array.Empty<RelativePath>();
|
2022-05-25 02:59:15 +00:00
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
[Reactive] public string[] OtherProfiles { get; set; } = Array.Empty<string>();
|
|
|
|
|
|
|
|
|
|
[Reactive] public AbsolutePath Source { get; set; }
|
|
|
|
|
|
|
|
|
|
public AbsolutePath SettingsOutputLocation => Source.Combine(ModListName).WithExtension(Ext.CompilerSettings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ReactiveCommand<Unit, Unit> ExecuteCommand { get; }
|
|
|
|
|
|
2022-05-22 04:27:02 +00:00
|
|
|
|
public LogStream LoggerProvider { get; }
|
2022-03-13 22:47:30 +00:00
|
|
|
|
public ReadOnlyObservableCollection<CPUDisplayVM> StatusList => _resourceMonitor.Tasks;
|
|
|
|
|
|
2022-07-12 21:47:53 +00:00
|
|
|
|
[Reactive]
|
|
|
|
|
public ErrorResponse ErrorState { get; private set; }
|
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
public CompilerVM(ILogger<CompilerVM> logger, DTOSerializer dtos, SettingsManager settingsManager,
|
2022-05-25 02:59:15 +00:00
|
|
|
|
IServiceProvider serviceProvider, LogStream loggerProvider, ResourceMonitor resourceMonitor,
|
2022-07-13 21:22:05 +00:00
|
|
|
|
CompilerSettingsInferencer inferencer, Client wjClient) : base(logger)
|
2022-03-13 22:47:30 +00:00
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_dtos = dtos;
|
|
|
|
|
_settingsManager = settingsManager;
|
|
|
|
|
_serviceProvider = serviceProvider;
|
|
|
|
|
LoggerProvider = loggerProvider;
|
|
|
|
|
_resourceMonitor = resourceMonitor;
|
2022-05-25 02:59:15 +00:00
|
|
|
|
_inferencer = inferencer;
|
2022-07-13 21:22:05 +00:00
|
|
|
|
_wjClient = wjClient;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
2022-08-05 03:46:15 +00:00
|
|
|
|
StatusText = "Compiler Settings";
|
|
|
|
|
StatusProgress = Percent.Zero;
|
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
BackCommand =
|
|
|
|
|
ReactiveCommand.CreateFromTask(async () =>
|
|
|
|
|
{
|
|
|
|
|
await SaveSettingsFile();
|
|
|
|
|
NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
SubCompilerVM = new MO2CompilerVM(this);
|
|
|
|
|
|
|
|
|
|
ExecuteCommand = ReactiveCommand.CreateFromTask(async () => await StartCompilation());
|
|
|
|
|
|
2022-07-12 21:47:53 +00:00
|
|
|
|
ModlistLocation = new FilePickerVM
|
2022-03-13 22:47:30 +00:00
|
|
|
|
{
|
|
|
|
|
ExistCheckOption = FilePickerVM.CheckOptions.On,
|
|
|
|
|
PathType = FilePickerVM.PathTypeOptions.File,
|
|
|
|
|
PromptTitle = "Select a config file or a modlist.txt file"
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-12 21:47:53 +00:00
|
|
|
|
DownloadLocation = new FilePickerVM
|
2022-03-13 22:47:30 +00:00
|
|
|
|
{
|
|
|
|
|
ExistCheckOption = FilePickerVM.CheckOptions.On,
|
|
|
|
|
PathType = FilePickerVM.PathTypeOptions.Folder,
|
|
|
|
|
PromptTitle = "Location where the downloads for this list are stored"
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-12 21:47:53 +00:00
|
|
|
|
OutputLocation = new FilePickerVM
|
2022-03-13 22:47:30 +00:00
|
|
|
|
{
|
2022-07-12 21:47:53 +00:00
|
|
|
|
ExistCheckOption = FilePickerVM.CheckOptions.Off,
|
|
|
|
|
PathType = FilePickerVM.PathTypeOptions.File,
|
2022-03-13 22:47:30 +00:00
|
|
|
|
PromptTitle = "Location where the compiled modlist will be stored"
|
|
|
|
|
};
|
2022-07-12 21:47:53 +00:00
|
|
|
|
OutputLocation.Filters.Add(new CommonFileDialogFilter(".wabbajack", "*.wabbajack"));
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
|
|
|
|
ModlistLocation.Filters.AddRange(new []
|
|
|
|
|
{
|
|
|
|
|
new CommonFileDialogFilter("MO2 Modlist", "*" + Ext.Txt),
|
|
|
|
|
new CommonFileDialogFilter("Compiler Settings File", "*" + Ext.CompilerSettings)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.WhenActivated(disposables =>
|
|
|
|
|
{
|
|
|
|
|
State = CompilerState.Configuration;
|
|
|
|
|
Disposable.Empty.DisposeWith(disposables);
|
|
|
|
|
|
|
|
|
|
ModlistLocation.WhenAnyValue(vm => vm.TargetPath)
|
|
|
|
|
.Subscribe(p => InferModListFromLocation(p).FireAndForget())
|
|
|
|
|
.DisposeWith(disposables);
|
2022-07-12 21:47:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.WhenAnyValue(x => x.DownloadLocation.TargetPath)
|
|
|
|
|
.CombineLatest(this.WhenAnyValue(x => x.ModlistLocation.TargetPath),
|
|
|
|
|
this.WhenAnyValue(x => x.OutputLocation.TargetPath),
|
|
|
|
|
this.WhenAnyValue(x => x.DownloadLocation.ErrorState),
|
|
|
|
|
this.WhenAnyValue(x => x.ModlistLocation.ErrorState),
|
|
|
|
|
this.WhenAnyValue(x => x.OutputLocation.ErrorState),
|
|
|
|
|
this.WhenAnyValue(x => x.ModListName),
|
|
|
|
|
this.WhenAnyValue(x => x.Version))
|
|
|
|
|
.Select(_ => Validate())
|
|
|
|
|
.BindToStrict(this, vm => vm.ErrorState)
|
|
|
|
|
.DisposeWith(disposables);
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
|
|
|
|
LoadLastSavedSettings().FireAndForget();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-12 21:47:53 +00:00
|
|
|
|
private ErrorResponse Validate()
|
|
|
|
|
{
|
|
|
|
|
var errors = new List<ErrorResponse>();
|
|
|
|
|
errors.Add(DownloadLocation.ErrorState);
|
|
|
|
|
errors.Add(ModlistLocation.ErrorState);
|
|
|
|
|
errors.Add(OutputLocation.ErrorState);
|
|
|
|
|
return ErrorResponse.Combine(errors);
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-25 02:59:15 +00:00
|
|
|
|
private async Task InferModListFromLocation(AbsolutePath path)
|
2022-03-13 22:47:30 +00:00
|
|
|
|
{
|
2022-05-25 02:59:15 +00:00
|
|
|
|
using var _ = LoadingLock.WithLoading();
|
2022-07-14 13:24:47 +00:00
|
|
|
|
|
|
|
|
|
CompilerSettings settings;
|
|
|
|
|
if (path == default) return;
|
|
|
|
|
if (path.FileName.Extension == Ext.CompilerSettings)
|
|
|
|
|
{
|
|
|
|
|
await using var fs = path.Open(FileMode.Open, FileAccess.Read, FileShare.Read);
|
|
|
|
|
settings = (await _dtos.DeserializeAsync<CompilerSettings>(fs))!;
|
|
|
|
|
}
|
|
|
|
|
else if (path.FileName == "modlist.txt".ToRelativePath())
|
|
|
|
|
{
|
|
|
|
|
settings = await _inferencer.InferModListFromLocation(path);
|
|
|
|
|
if (settings == null) return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-05-25 02:59:15 +00:00
|
|
|
|
return;
|
2022-07-14 13:24:47 +00:00
|
|
|
|
}
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
2022-05-25 02:59:15 +00:00
|
|
|
|
BaseGame = settings.Game;
|
|
|
|
|
ModListName = settings.ModListName;
|
|
|
|
|
Source = settings.Source;
|
|
|
|
|
DownloadLocation.TargetPath = settings.Downloads;
|
|
|
|
|
OutputLocation.TargetPath = settings.OutputFile;
|
|
|
|
|
SelectedProfile = settings.Profile;
|
2022-07-14 13:24:47 +00:00
|
|
|
|
PublishUpdate = settings.PublishUpdate;
|
|
|
|
|
MachineUrl = settings.MachineUrl;
|
2022-05-30 20:50:24 +00:00
|
|
|
|
OtherProfiles = settings.AdditionalProfiles;
|
2022-05-25 02:59:15 +00:00
|
|
|
|
AlwaysEnabled = settings.AlwaysEnabled;
|
2022-05-26 05:21:12 +00:00
|
|
|
|
NoMatchInclude = settings.NoMatchInclude;
|
2022-07-27 03:56:30 +00:00
|
|
|
|
Include = settings.Include;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-05-25 02:59:15 +00:00
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
private async Task StartCompilation()
|
|
|
|
|
{
|
|
|
|
|
var tsk = Task.Run(async () =>
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2022-07-14 13:24:47 +00:00
|
|
|
|
await SaveSettingsFile();
|
2022-07-13 21:22:05 +00:00
|
|
|
|
var token = CancellationToken.None;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
State = CompilerState.Compiling;
|
|
|
|
|
|
2022-07-14 13:24:47 +00:00
|
|
|
|
var mo2Settings = GetSettings();
|
|
|
|
|
mo2Settings.UseGamePaths = true;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
2022-07-13 21:22:05 +00:00
|
|
|
|
if (PublishUpdate && !await RunPreflightChecks(token))
|
|
|
|
|
{
|
|
|
|
|
State = CompilerState.Errored;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-27 05:41:11 +00:00
|
|
|
|
var compiler = MO2Compiler.Create(_serviceProvider, mo2Settings);
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
2022-08-05 03:46:15 +00:00
|
|
|
|
compiler.OnStatusUpdate += (sender, update) =>
|
|
|
|
|
{
|
|
|
|
|
RxApp.MainThreadScheduler.Schedule(update, (scheduler, update) =>
|
|
|
|
|
{
|
|
|
|
|
StatusText = update.StatusText;
|
|
|
|
|
StatusProgress = update.StepsProgress;
|
|
|
|
|
return Disposable.Empty;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-13 21:22:05 +00:00
|
|
|
|
await compiler.Begin(token);
|
2022-03-13 22:47:30 +00:00
|
|
|
|
|
2022-07-13 21:51:42 +00:00
|
|
|
|
if (PublishUpdate)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("Publishing List");
|
|
|
|
|
var downloadMetadata = _dtos.Deserialize<DownloadMetadata>(
|
|
|
|
|
await mo2Settings.OutputFile.WithExtension(Ext.Meta).WithExtension(Ext.Json).ReadAllTextAsync())!;
|
|
|
|
|
await _wjClient.PublishModlist(MachineUrl, System.Version.Parse(Version), mo2Settings.OutputFile, downloadMetadata);
|
|
|
|
|
}
|
|
|
|
|
_logger.LogInformation("Compiler Finished");
|
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
State = CompilerState.Completed;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2022-08-05 03:46:15 +00:00
|
|
|
|
StatusText = "Compilation Failed";
|
|
|
|
|
StatusProgress = Percent.Zero;
|
|
|
|
|
|
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
State = CompilerState.Errored;
|
|
|
|
|
_logger.LogInformation(ex, "Failed Compilation : {Message}", ex.Message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await tsk;
|
|
|
|
|
}
|
2022-07-13 21:22:05 +00:00
|
|
|
|
|
|
|
|
|
private async Task<bool> RunPreflightChecks(CancellationToken token)
|
|
|
|
|
{
|
|
|
|
|
var lists = await _wjClient.GetMyModlists(token);
|
|
|
|
|
if (!lists.Any(x => x.Equals(MachineUrl, StringComparison.InvariantCultureIgnoreCase)))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("Preflight Check failed, list {MachineUrl} not found in any repository", MachineUrl);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2022-07-13 21:51:42 +00:00
|
|
|
|
|
|
|
|
|
if (!System.Version.TryParse(Version, out var v))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("Bad Version Number {Version}", Version);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-13 21:22:05 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-13 22:47:30 +00:00
|
|
|
|
private async Task SaveSettingsFile()
|
|
|
|
|
{
|
|
|
|
|
if (Source == default) return;
|
|
|
|
|
await using var st = SettingsOutputLocation.Open(FileMode.Create, FileAccess.Write, FileShare.None);
|
|
|
|
|
await JsonSerializer.SerializeAsync(st, GetSettings(), _dtos.Options);
|
|
|
|
|
|
2022-07-14 13:24:47 +00:00
|
|
|
|
await _settingsManager.Save(LastSavedCompilerSettings, SettingsOutputLocation);
|
2022-03-13 22:47:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task LoadLastSavedSettings()
|
|
|
|
|
{
|
|
|
|
|
var lastPath = await _settingsManager.Load<AbsolutePath>(LastSavedCompilerSettings);
|
2022-07-14 13:24:47 +00:00
|
|
|
|
if (lastPath == default || !lastPath.FileExists() || lastPath.FileName.Extension != Ext.CompilerSettings) return;
|
|
|
|
|
ModlistLocation.TargetPath = lastPath;
|
2022-03-13 22:47:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private CompilerSettings GetSettings()
|
|
|
|
|
{
|
|
|
|
|
return new CompilerSettings
|
|
|
|
|
{
|
|
|
|
|
ModListName = ModListName,
|
|
|
|
|
ModListAuthor = Author,
|
|
|
|
|
Downloads = DownloadLocation.TargetPath,
|
2022-07-14 13:24:47 +00:00
|
|
|
|
Source = Source,
|
2022-03-13 22:47:30 +00:00
|
|
|
|
Game = BaseGame,
|
2022-07-14 13:24:47 +00:00
|
|
|
|
PublishUpdate = PublishUpdate,
|
|
|
|
|
MachineUrl = MachineUrl,
|
2022-03-13 22:47:30 +00:00
|
|
|
|
Profile = SelectedProfile,
|
|
|
|
|
UseGamePaths = true,
|
2022-07-14 13:24:47 +00:00
|
|
|
|
OutputFile = OutputLocation.TargetPath,
|
2022-05-26 05:21:12 +00:00
|
|
|
|
AlwaysEnabled = AlwaysEnabled,
|
2022-05-30 20:50:24 +00:00
|
|
|
|
AdditionalProfiles = OtherProfiles,
|
2022-05-26 05:21:12 +00:00
|
|
|
|
NoMatchInclude = NoMatchInclude,
|
2022-07-27 03:56:30 +00:00
|
|
|
|
Include = Include
|
2022-03-13 22:47:30 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
2022-05-25 02:59:15 +00:00
|
|
|
|
|
|
|
|
|
#region ListOps
|
|
|
|
|
|
|
|
|
|
public void AddOtherProfile(string profile)
|
|
|
|
|
{
|
|
|
|
|
OtherProfiles = (OtherProfiles ?? Array.Empty<string>()).Append(profile).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveProfile(string profile)
|
|
|
|
|
{
|
|
|
|
|
OtherProfiles = OtherProfiles.Where(p => p != profile).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddAlwaysEnabled(RelativePath path)
|
|
|
|
|
{
|
|
|
|
|
AlwaysEnabled = (AlwaysEnabled ?? Array.Empty<RelativePath>()).Append(path).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveAlwaysEnabled(RelativePath path)
|
|
|
|
|
{
|
|
|
|
|
AlwaysEnabled = AlwaysEnabled.Where(p => p != path).ToArray();
|
|
|
|
|
}
|
2022-05-26 05:21:12 +00:00
|
|
|
|
|
|
|
|
|
public void AddNoMatchInclude(RelativePath path)
|
|
|
|
|
{
|
|
|
|
|
NoMatchInclude = (NoMatchInclude ?? Array.Empty<RelativePath>()).Append(path).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveNoMatchInclude(RelativePath path)
|
|
|
|
|
{
|
|
|
|
|
NoMatchInclude = NoMatchInclude.Where(p => p != path).ToArray();
|
|
|
|
|
}
|
2022-07-27 03:56:30 +00:00
|
|
|
|
|
|
|
|
|
public void AddInclude(RelativePath path)
|
|
|
|
|
{
|
|
|
|
|
Include = (Include ?? Array.Empty<RelativePath>()).Append(path).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveInclude(RelativePath path)
|
|
|
|
|
{
|
|
|
|
|
Include = Include.Where(p => p != path).ToArray();
|
|
|
|
|
}
|
2022-05-25 02:59:15 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
2022-03-13 22:47:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|