From eec7661bdc1f8716d7a4037a4d77bc15527a857d Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Fri, 12 Mar 2021 23:56:25 +0100 Subject: [PATCH 1/8] Update azure-pipelines.yml for Azure Pipelines --- ci/azure-pipelines.yml | 74 +++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 1544c01f5..8ec0198d7 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -6,37 +6,44 @@ trigger: - master +resources: + repositories: + - repository: RGBNET + type: github + endpoint: github.com_SpoinkyNL + name: DarthAffe/RGB.NET + ref: Development + - repository: Plugins + type: github + endpoint: github.com_SpoinkyNL + name: Artemis-RGB/Artemis.Plugins + ref: master + pool: vmImage: 'windows-latest' variables: artemisSolution: '**/Artemis.sln' - NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages + rgbSolution: '**/RGB.NET.sln' BuildId: $(Build.BuildId) BuildNumber: $(Build.BuildNumber) SourceBranch: $(Build.SourceBranch) SourceVersion: $(Build.SourceVersion) steps: +- checkout: RGBNET + path: s/RGB.NET - checkout: self path: s/Artemis - -- task: DownloadPipelineArtifact@2 - inputs: - buildType: 'specific' - project: '882fdc71-c09c-4923-8ab0-2cd9fcf0656d' - definition: '3' - buildVersionToDownload: 'latest' - artifactName: 'RGB.NET development build' - targetPath: '$(Pipeline.Workspace)/s/RGB.NET/bin/net5.0' +- checkout: Plugins + path: s/Artemis.Plugins - task: DotNetCoreCLI@2 - displayName: 'dotnet restore Artemis' + displayName: 'Build RGB.NET' inputs: - command: 'restore' - projects: '$(artemisSolution)' - feedsToUse: 'config' - nugetConfigPath: '$(Pipeline.Workspace)/s/Artemis/src/NuGet.Config' + command: 'build' + projects: '$(rgbSolution)' + arguments: '--configuration Release' - task: DotNetCoreCLI@2 displayName: 'Publish Artemis' @@ -48,14 +55,14 @@ steps: zipAfterPublish: false modifyOutputPath: false -- task: DownloadPipelineArtifact@2 +- task: PowerShell@2 + displayName: 'Create buildinfo.json' inputs: - buildType: 'specific' - project: '882fdc71-c09c-4923-8ab0-2cd9fcf0656d' - definition: '2' - buildVersionToDownload: 'latest' - artifactName: 'Artemis build' - targetPath: '$(Build.ArtifactStagingDirectory)/build' + targetType: 'inline' + script: | + $OFS = "`r`n" + SET-Content -Path 'buildinfo.json' -Value ('{' + $OFS + ' "BuildId": 0,' + $OFS + ' "BuildNumber": 0.0,' + $OFS + ' "SourceBranch": "",' + $OFS + ' "SourceVersion": ""' + $OFS + '}') + workingDirectory: '$(Build.ArtifactStagingDirectory)/build' - task: FileTransform@1 displayName: 'Populate buildinfo.json' @@ -64,6 +71,29 @@ steps: fileType: 'json' targetFiles: '**/buildinfo.json' +- task: PowerShell@2 + displayName: 'Insert build number into plugin.json' + inputs: + targetType: 'inline' + script: | + Get-ChildItem -Recurse -Filter plugin.json | + Foreach-Object { + $buidNumber = "1.0.1." + $Env:BUILD_BUILDID; + $a = Get-Content $_.FullName | ConvertFrom-Json + $a.Version = $buidNumber; + $a | ConvertTo-Json | Set-Content $_.FullName + } + workingDirectory: 's/Artemis.Plugins' + +- task: DotNetCoreCLI@2 + displayName: 'Publish Artemis.Plugins' + inputs: + command: 'publish' + publishWebProjects: false + arguments: '--runtime win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/build/Plugins' + projects: '$(pluginProjects)' + zipAfterPublish: true + - task: PublishPipelineArtifact@1 displayName: 'Upload build to Azure Pipelines' inputs: From 71a25ba6f77bb81a6b56fcd0af3ec1db8f50e983 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Sat, 13 Mar 2021 00:01:47 +0100 Subject: [PATCH 2/8] Update azure-pipelines.yml for Azure Pipelines --- ci/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 8ec0198d7..05d393b8a 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -83,7 +83,7 @@ steps: $a.Version = $buidNumber; $a | ConvertTo-Json | Set-Content $_.FullName } - workingDirectory: 's/Artemis.Plugins' + workingDirectory: 'Artemis.Plugins' - task: DotNetCoreCLI@2 displayName: 'Publish Artemis.Plugins' From 6fe25a7087d45ffeed601bd305bdcc72b26dccd2 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Sat, 13 Mar 2021 00:12:19 +0100 Subject: [PATCH 3/8] Update azure-pipelines.yml for Azure Pipelines --- ci/azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 05d393b8a..983939dc3 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -25,6 +25,7 @@ pool: variables: artemisSolution: '**/Artemis.sln' rgbSolution: '**/RGB.NET.sln' + pluginProjects: '**/Artemis.Plugins.*.csproj' BuildId: $(Build.BuildId) BuildNumber: $(Build.BuildNumber) SourceBranch: $(Build.SourceBranch) From 86d01a9c90c57ede6f6890fdc17ce28ce733ce15 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Sat, 13 Mar 2021 00:23:28 +0100 Subject: [PATCH 4/8] Update azure-pipelines.yml for Azure Pipelines --- ci/azure-pipelines.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 983939dc3..2b68ab9c3 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -40,14 +40,14 @@ steps: path: s/Artemis.Plugins - task: DotNetCoreCLI@2 - displayName: 'Build RGB.NET' + displayName: 'RGB.NET - Build' inputs: command: 'build' projects: '$(rgbSolution)' arguments: '--configuration Release' - task: DotNetCoreCLI@2 - displayName: 'Publish Artemis' + displayName: 'Artemis - Publish' inputs: command: 'publish' publishWebProjects: false @@ -57,7 +57,7 @@ steps: modifyOutputPath: false - task: PowerShell@2 - displayName: 'Create buildinfo.json' + displayName: 'Artemis - Create buildinfo.json' inputs: targetType: 'inline' script: | @@ -66,14 +66,21 @@ steps: workingDirectory: '$(Build.ArtifactStagingDirectory)/build' - task: FileTransform@1 - displayName: 'Populate buildinfo.json' + displayName: 'Artemis - Populate buildinfo.json' inputs: folderPath: '$(Build.ArtifactStagingDirectory)/build' fileType: 'json' targetFiles: '**/buildinfo.json' +- task: CopyFiles@2 + displayName: 'Plugins - Prepare Artemis binaries' + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/build' + Contents: '**' + TargetFolder: 'Artemis/src/Artemis.UI/bin/x64/Debug/net5.0-windows' + - task: PowerShell@2 - displayName: 'Insert build number into plugin.json' + displayName: 'Plugins - Insert build number into plugin.json' inputs: targetType: 'inline' script: | @@ -87,7 +94,7 @@ steps: workingDirectory: 'Artemis.Plugins' - task: DotNetCoreCLI@2 - displayName: 'Publish Artemis.Plugins' + displayName: 'Plugins - Publish' inputs: command: 'publish' publishWebProjects: false @@ -103,6 +110,7 @@ steps: publishLocation: 'pipeline' - task: ArchiveFiles@2 + displayName: 'ZIP binaries' inputs: rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/build' includeRootFolder: false @@ -111,13 +119,14 @@ steps: replaceExistingArchive: true - task: PowerShell@2 + displayName: 'Calculate ZIP hash' inputs: targetType: 'inline' script: '(Get-FileHash .\artemis-build.zip).Hash | Out-File -FilePath .\hash.txt' workingDirectory: '$(Build.ArtifactStagingDirectory)/archive' - task: FtpUpload@2 - displayName: "Binaries FTP upload" + displayName: 'Upload binaries to FTP' inputs: credentialsOption: 'inputs' serverUrl: 'ftp://artemis-rgb.com' From 1a3c2a43dff008780db92c2e8685cc436be65a98 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Mon, 15 Mar 2021 20:40:06 +0100 Subject: [PATCH 5/8] Azure builds - Don't trigger on PRs --- ci/azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 2b68ab9c3..2f40282d0 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -5,6 +5,7 @@ trigger: - master +pr: none resources: repositories: From d1b90572db522885b214ea4192e040fc0ee404f8 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Wed, 17 Mar 2021 20:53:31 +0100 Subject: [PATCH 6/8] Fixed API doc generation [skip ci] --- ci/azure-pipelines-docfx.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/ci/azure-pipelines-docfx.yml b/ci/azure-pipelines-docfx.yml index 36bfd34f4..db588fe8c 100644 --- a/ci/azure-pipelines-docfx.yml +++ b/ci/azure-pipelines-docfx.yml @@ -7,24 +7,38 @@ trigger: - master pr: none +resources: + repositories: + - repository: RGBNET + type: github + endpoint: github.com_SpoinkyNL + name: DarthAffe/RGB.NET + ref: Development + pool: vmImage: 'windows-latest' variables: artemisSolution: '**/Artemis.sln' - + rgbSolution: '**/RGB.NET.sln' + pluginProjects: '**/Artemis.Plugins.*.csproj' + BuildId: $(Build.BuildId) + BuildNumber: $(Build.BuildNumber) + SourceBranch: $(Build.SourceBranch) + SourceVersion: $(Build.SourceVersion) + steps: +- checkout: RGBNET + path: s/RGB.NET - checkout: self path: s/Artemis -- task: DownloadPipelineArtifact@2 +- task: DotNetCoreCLI@2 + displayName: 'RGB.NET - Build' inputs: - buildType: 'specific' - project: '882fdc71-c09c-4923-8ab0-2cd9fcf0656d' - definition: '3' - buildVersionToDownload: 'latest' - artifactName: 'RGB.NET development build' - targetPath: '$(Pipeline.Workspace)/s/RGB.NET/bin/netstandard2.0' + command: 'build' + projects: '$(rgbSolution)' + arguments: '--configuration Release' - task: DotNetCoreCLI@2 displayName: 'dotnet restore Artemis' From cb5d2cc8fa2712124e8ed639c76d771b9f200746 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 19 Mar 2021 23:49:59 +0100 Subject: [PATCH 7/8] =?UTF-8?q?Debugger=20-=20Added=20logs=20to=20logs=20t?= =?UTF-8?q?ab=20=E2=98=9C(=EF=BE=9F=E3=83=AE=EF=BE=9F=E2=98=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Core - Added logs store giving access to the last 500 logs --- src/Artemis.Core/Ninject/LoggerProvider.cs | 11 ++ src/Artemis.Core/Stores/LogStore.cs | 55 ++++++++ src/Artemis.UI/Properties/launchSettings.json | 2 +- .../Screens/Settings/Debug/DebugView.xaml | 124 +++++++++--------- .../Debug/Tabs/DataModelDebugViewModel.cs | 2 +- .../Settings/Debug/Tabs/LogsDebugView.xaml | 39 +++++- .../Settings/Debug/Tabs/LogsDebugViewModel.cs | 121 ++++++++++++++++- .../Settings/Debug/Tabs/RenderDebugView.xaml | 25 ++-- .../Debug/Tabs/RenderDebugViewModel.cs | 2 +- 9 files changed, 302 insertions(+), 79 deletions(-) create mode 100644 src/Artemis.Core/Stores/LogStore.cs diff --git a/src/Artemis.Core/Ninject/LoggerProvider.cs b/src/Artemis.Core/Ninject/LoggerProvider.cs index 42cd82430..fe2aaf5b6 100644 --- a/src/Artemis.Core/Ninject/LoggerProvider.cs +++ b/src/Artemis.Core/Ninject/LoggerProvider.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Ninject.Activation; using Serilog; using Serilog.Core; @@ -17,6 +18,7 @@ namespace Artemis.Core.Ninject rollingInterval: RollingInterval.Day, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}") .WriteTo.Debug() + .WriteTo.Sink() .MinimumLevel.ControlledBy(LoggingLevelSwitch) .CreateLogger(); @@ -28,4 +30,13 @@ namespace Artemis.Core.Ninject return Logger; } } + + internal class ArtemisSink : ILogEventSink + { + /// + public void Emit(LogEvent logEvent) + { + LogStore.Emit(logEvent); + } + } } \ No newline at end of file diff --git a/src/Artemis.Core/Stores/LogStore.cs b/src/Artemis.Core/Stores/LogStore.cs new file mode 100644 index 000000000..856ecd6fe --- /dev/null +++ b/src/Artemis.Core/Stores/LogStore.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Serilog.Events; + +namespace Artemis.Core +{ + /// + /// A static store containing the last 500 logging events + /// + public static class LogStore + { + private static readonly LinkedList LinkedList = new(); + + /// + /// Gets a list containing the last 500 log events. + /// + public static List Events => LinkedList.ToList(); + + /// + /// Occurs when a new was received. + /// + public static event EventHandler? EventAdded; + + internal static void Emit(LogEvent logEvent) + { + LinkedList.AddLast(logEvent); + if (LinkedList.Count > 500) + LinkedList.RemoveFirst(); + + OnEventAdded(new LogEventEventArgs(logEvent)); + } + + private static void OnEventAdded(LogEventEventArgs e) + { + EventAdded?.Invoke(null, e); + } + } + + /// + /// Contains log event related data + /// + public class LogEventEventArgs : EventArgs + { + internal LogEventEventArgs(LogEvent logEvent) + { + LogEvent = logEvent; + } + + /// + /// Gets the log event + /// + public LogEvent LogEvent { get; } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Properties/launchSettings.json b/src/Artemis.UI/Properties/launchSettings.json index e8d4f8dfb..be8d62f45 100644 --- a/src/Artemis.UI/Properties/launchSettings.json +++ b/src/Artemis.UI/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Artemis.UI": { "commandName": "Project", - "commandLineArgs": "--force-elevation --logging=debug" + "commandLineArgs": "--force-elevation" } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/DebugView.xaml b/src/Artemis.UI/Screens/Settings/Debug/DebugView.xaml index 068b39899..32f2e6256 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/DebugView.xaml +++ b/src/Artemis.UI/Screens/Settings/Debug/DebugView.xaml @@ -15,70 +15,74 @@ FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto" UseLayoutRounding="True" FadeContentIfInactive="False" - Width="800" + Width="1200" Height="800" d:DesignHeight="800" d:DesignWidth="800" d:DataContext="{d:DesignInstance debug:DebugViewModel}" Icon="/Resources/Images/Logo/logo-512.png" Topmost="{Binding StayOnTopSetting.Value}"> - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs index 0e0e97656..ae0364bb4 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs @@ -24,11 +24,11 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs public DataModelDebugViewModel(IDataModelUIService dataModelUIService, IPluginManagementService pluginManagementService) { + DisplayName = "DATA MODEL"; _dataModelUIService = dataModelUIService; _pluginManagementService = pluginManagementService; _updateTimer = new Timer(25); - DisplayName = "Data model"; Modules = new BindableCollection(); } diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml index 9982531f3..160fa3d2f 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml @@ -4,7 +4,44 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Artemis.UI.Screens.Settings.Debug.Tabs" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:LogsDebugViewModel}"> - + + + + + + + + + + + + + + + + + + + + When reporting errors please don't take a screenshot of the logs, instead upload the full log or select & copy a part of it, thanks! + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs index 5605473be..61e8a1cf1 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs @@ -1,12 +1,127 @@ -using Stylet; +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Media; +using Artemis.Core; +using Artemis.UI.Shared; +using Artemis.UI.Shared.Services; +using Serilog.Events; +using Serilog.Formatting.Display; +using Stylet; namespace Artemis.UI.Screens.Settings.Debug.Tabs { public class LogsDebugViewModel : Screen { - public LogsDebugViewModel() + private readonly IDialogService _dialogService; + private readonly MessageTemplateTextFormatter _formatter; + private ScrollViewer _scrollViewer; + + public LogsDebugViewModel(IDialogService dialogService) { - DisplayName = "Logs"; + DisplayName = "LOGS"; + _dialogService = dialogService; + _formatter = new MessageTemplateTextFormatter( + "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}" + ); } + + public FlowDocument LogsDocument { get; } = new(); + + public void ShowLogsFolder() + { + Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.Combine(Constants.DataFolder, "Logs")); + } + + public async Task UploadLogs() + { + bool confirmed = await _dialogService.ShowConfirmDialogAt( + "DebuggerDialog", + "Upload logs", + "Automatically uploading logs is not yet implemented.\r\n\r\n" + + "To manually upload a log simply drag the log file from the logs folder\r\n" + + "into Discord or the GitHub issue textbox, depending on what you're using.", + "OPEN LOGS FOLDER", + "CANCEL"); + + if (confirmed) + ShowLogsFolder(); + } + + private Paragraph CreateLogEventParagraph(LogEvent logEvent) + { + Paragraph paragraph = new(new Run(RenderLogEvent(logEvent))) + { + // But mah MVVM + Foreground = logEvent.Level switch + { + LogEventLevel.Verbose => new SolidColorBrush(Colors.White), + LogEventLevel.Debug => new SolidColorBrush(Color.FromRgb(216, 216, 216)), + LogEventLevel.Information => new SolidColorBrush(Color.FromRgb(93, 201, 255)), + LogEventLevel.Warning => new SolidColorBrush(Color.FromRgb(255, 177, 53)), + LogEventLevel.Error => new SolidColorBrush(Color.FromRgb(255, 63, 63)), + LogEventLevel.Fatal => new SolidColorBrush(Colors.Red), + _ => throw new ArgumentOutOfRangeException() + } + }; + + return paragraph; + } + + private string RenderLogEvent(LogEvent logEvent) + { + using StringWriter writer = new(); + _formatter.Format(logEvent, writer); + return writer.ToString().Trim(); + } + + #region Overrides of Screen + + /// + protected override void OnActivate() + { + LogsDocument.Blocks.AddRange(LogStore.Events.Select(e => CreateLogEventParagraph(e))); + LogStore.EventAdded += LogStoreOnEventAdded; + + base.OnActivate(); + } + + private void LogStoreOnEventAdded(object sender, LogEventEventArgs e) + { + Execute.PostToUIThread(() => + { + LogsDocument.Blocks.Add(CreateLogEventParagraph(e.LogEvent)); + while (LogsDocument.Blocks.Count > 500) + LogsDocument.Blocks.Remove(LogsDocument.Blocks.FirstBlock); + + if (_scrollViewer != null && Math.Abs(_scrollViewer.VerticalOffset - _scrollViewer.ScrollableHeight) < 10) + _scrollViewer.ScrollToBottom(); + }); + } + + /// + protected override void OnDeactivate() + { + LogStore.EventAdded -= LogStoreOnEventAdded; + LogsDocument.Blocks.Clear(); + + base.OnDeactivate(); + } + + /// + protected override void OnViewLoaded() + { + ScrollViewer scrollViewer = VisualTreeUtilities.FindChild(View, null); + _scrollViewer = scrollViewer; + _scrollViewer?.ScrollToBottom(); + + base.OnViewLoaded(); + } + + #endregion } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml index 05f2c83da..629db8ada 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml @@ -10,10 +10,10 @@ d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:RenderDebugViewModel}"> - - - - + + + + In this window you can view the inner workings of Artemis. @@ -30,19 +30,20 @@ This image shows what is being rendered and dispatched to RGB.NET - - - - + + + + + - - + + - - + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs index 934ba89b9..a879a5a78 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs @@ -23,8 +23,8 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs public RenderDebugViewModel(ICoreService coreService) { + DisplayName = "RENDERING"; _coreService = coreService; - DisplayName = "Rendering"; } public ImageSource CurrentFrame From 09e8faf4e455acfe7006c28ce2ad901a48d09057 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Mon, 22 Mar 2021 20:23:03 +0100 Subject: [PATCH 8/8] CI - Added PR-only pipeline [skip ci] --- azure-pipelines-pr.yml | 112 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 azure-pipelines-pr.yml diff --git a/azure-pipelines-pr.yml b/azure-pipelines-pr.yml new file mode 100644 index 000000000..a63766c6c --- /dev/null +++ b/azure-pipelines-pr.yml @@ -0,0 +1,112 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +trigger: none +pr: +- master +- Development + +resources: + repositories: + - repository: RGBNET + type: github + endpoint: github.com_SpoinkyNL + name: DarthAffe/RGB.NET + ref: Development + - repository: Plugins + type: github + endpoint: github.com_SpoinkyNL + name: Artemis-RGB/Artemis.Plugins + ref: master + +pool: + vmImage: 'windows-latest' + +variables: + artemisSolution: '**/Artemis.sln' + rgbSolution: '**/RGB.NET.sln' + pluginProjects: '**/Artemis.Plugins.*.csproj' + BuildId: $(Build.BuildId) + BuildNumber: $(Build.BuildNumber) + SourceBranch: $(Build.SourceBranch) + SourceVersion: $(Build.SourceVersion) + +steps: +- checkout: RGBNET + path: s/RGB.NET +- checkout: self + path: s/Artemis +- checkout: Plugins + path: s/Artemis.Plugins + +- task: DotNetCoreCLI@2 + displayName: 'RGB.NET - Build' + inputs: + command: 'build' + projects: '$(rgbSolution)' + arguments: '--configuration Release' + +- task: DotNetCoreCLI@2 + displayName: 'Artemis - Publish' + inputs: + command: 'publish' + publishWebProjects: false + projects: '$(artemisSolution)' + arguments: '--runtime win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/build /nowarn:cs1591' + zipAfterPublish: false + modifyOutputPath: false + +- task: PowerShell@2 + displayName: 'Artemis - Create buildinfo.json' + inputs: + targetType: 'inline' + script: | + $OFS = "`r`n" + SET-Content -Path 'buildinfo.json' -Value ('{' + $OFS + ' "BuildId": 0,' + $OFS + ' "BuildNumber": 0.0,' + $OFS + ' "SourceBranch": "",' + $OFS + ' "SourceVersion": ""' + $OFS + '}') + workingDirectory: '$(Build.ArtifactStagingDirectory)/build' + +- task: FileTransform@1 + displayName: 'Artemis - Populate buildinfo.json' + inputs: + folderPath: '$(Build.ArtifactStagingDirectory)/build' + fileType: 'json' + targetFiles: '**/buildinfo.json' + +- task: CopyFiles@2 + displayName: 'Plugins - Prepare Artemis binaries' + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/build' + Contents: '**' + TargetFolder: 'Artemis/src/Artemis.UI/bin/x64/Debug/net5.0-windows' + +- task: PowerShell@2 + displayName: 'Plugins - Insert build number into plugin.json' + inputs: + targetType: 'inline' + script: | + Get-ChildItem -Recurse -Filter plugin.json | + Foreach-Object { + $buidNumber = "1.0.1." + $Env:BUILD_BUILDID; + $a = Get-Content $_.FullName | ConvertFrom-Json + $a.Version = $buidNumber; + $a | ConvertTo-Json | Set-Content $_.FullName + } + workingDirectory: 'Artemis.Plugins' + +- task: DotNetCoreCLI@2 + displayName: 'Plugins - Publish' + inputs: + command: 'publish' + publishWebProjects: false + arguments: '--runtime win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/build/Plugins' + projects: '$(pluginProjects)' + zipAfterPublish: true + +- task: PublishPipelineArtifact@1 + displayName: 'Upload build to Azure Pipelines' + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)/build' + artifact: 'Artemis build' + publishLocation: 'pipeline' \ No newline at end of file