diff --git a/.gitattributes b/.gitattributes
index 1ff0c4230..0753195f4 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -61,3 +61,6 @@
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
+
+# Display axaml files with XML highlighting
+*.axaml linguist-language=xml
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 10351521f..f25a67c8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -196,3 +196,5 @@ FakesAssemblies/
src/Artemis\.Storage/Storage\.db
!src/Artemis.UI/screens/Settings/Debug
docfx/docfx_project/_site/
+
+src/.idea/
diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml
index 4ebae1d56..6b680e70c 100644
--- a/ci/azure-pipelines.yml
+++ b/ci/azure-pipelines.yml
@@ -4,124 +4,118 @@
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
-- master
+ - master
pr: none
resources:
repositories:
- - repository: Plugins
- type: github
- endpoint: github.com_SpoinkyNL
- name: Artemis-RGB/Artemis.Plugins
- ref: master
+ - repository: Plugins
+ type: github
+ endpoint: github.com_SpoinkyNL
+ name: Artemis-RGB/Artemis.Plugins
+ ref: master
pool:
- vmImage: 'windows-latest'
+ vmImage: "windows-latest"
variables:
- artemisSolution: '**/Artemis.sln'
- pluginProjects: '**/Artemis.Plugins.*.csproj'
+ windowsProject: "**/Artemis.UI.Windows/Artemis.UI.Windows.csproj"
+ pluginProjects: "**/Artemis.Plugins.*.csproj"
BuildId: $(Build.BuildId)
BuildNumber: $(Build.BuildNumber)
SourceBranch: $(Build.SourceBranch)
SourceVersion: $(Build.SourceVersion)
-
-steps:
-- checkout: self
- path: s/Artemis
-- checkout: Plugins
- path: s/Artemis.Plugins
-- task: DotNetCoreCLI@2
- displayName: 'Artemis - Publish'
- inputs:
- command: 'publish'
- publishWebProjects: false
- projects: '$(artemisSolution)'
- arguments: '--runtime win-x64 --self-contained false --configuration Release --output $(Build.ArtifactStagingDirectory)/build /nowarn:cs1591'
- zipAfterPublish: false
- modifyOutputPath: false
+jobs:
+ - job: Windows
+ steps:
+ - checkout: self
+ path: s/Artemis
+ - checkout: Plugins
+ path: s/Artemis.Plugins
-- 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: DotNetCoreCLI@2
+ displayName: "Artemis - Publish"
+ inputs:
+ command: "publish"
+ publishWebProjects: false
+ projects: "$(windowsProject)"
+ arguments: '--configuration Release --runtime win10-x64 --output $(Build.ArtifactStagingDirectory)/windows-build /nowarn:cs1591'
+ zipAfterPublish: false
+ modifyOutputPath: false
-- task: FileTransform@1
- displayName: 'Artemis - Populate buildinfo.json'
- inputs:
- folderPath: '$(Build.ArtifactStagingDirectory)/build'
- fileType: 'json'
- targetFiles: '**/buildinfo.json'
+ - 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)/windows-build"
-# Copy Artemis binaries to where plugin projects expect them
-- task: CopyFiles@2
- displayName: 'Plugins - Prepare Artemis binaries'
- inputs:
- SourceFolder: '$(Build.ArtifactStagingDirectory)/build'
- Contents: '**'
- TargetFolder: 'Artemis/src/Artemis.UI/bin/net5.0-windows'
+ - task: FileTransform@1
+ displayName: "Artemis - Populate buildinfo.json"
+ inputs:
+ folderPath: "$(Build.ArtifactStagingDirectory)/windows-build"
+ fileType: "json"
+ targetFiles: "**/buildinfo.json"
-- 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: 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 --configuration Release --self-contained false --output $(Build.ArtifactStagingDirectory)/build/Plugins'
- projects: '$(pluginProjects)'
- zipAfterPublish: true
+ - task: DotNetCoreCLI@2
+ displayName: "Plugins - Publish"
+ inputs:
+ command: "publish"
+ publishWebProjects: false
+ arguments: "--configuration Release --runtime win10-x64 --output $(Build.ArtifactStagingDirectory)/windows-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'
+ - task: PublishPipelineArtifact@1
+ displayName: "Upload build to Azure Pipelines"
+ inputs:
+ targetPath: "$(Build.ArtifactStagingDirectory)/windows-build"
+ artifact: "Artemis build"
+ publishLocation: "pipeline"
-- task: ArchiveFiles@2
- displayName: 'ZIP binaries'
- inputs:
- rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/build'
- includeRootFolder: false
- archiveType: 'zip'
- archiveFile: '$(Build.ArtifactStagingDirectory)/archive/artemis-build.zip'
- replaceExistingArchive: true
+ - task: ArchiveFiles@2
+ displayName: "ZIP binaries"
+ inputs:
+ rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/windows-build"
+ includeRootFolder: false
+ archiveType: "zip"
+ archiveFile: "$(Build.ArtifactStagingDirectory)/archive/artemis-build-windows.zip"
+ 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: PowerShell@2
+ displayName: "Calculate ZIP hash"
+ inputs:
+ targetType: "inline"
+ script: '(Get-FileHash .\artemis-build-windows.zip).Hash | Out-File -FilePath .\hash-windows.txt'
+ workingDirectory: "$(Build.ArtifactStagingDirectory)/archive"
-- task: FtpUpload@2
- displayName: 'Upload binaries to FTP'
- inputs:
- credentialsOption: 'inputs'
- serverUrl: 'ftp://artemis-rgb.com'
- username: 'devops'
- password: '$(ftp_password)'
- rootDirectory: '$(Build.ArtifactStagingDirectory)/archive'
- filePatterns: '**'
- remoteDirectory: '/builds.artemis-rgb.com/binaries/$(Build.SourceBranchName)/$(Build.BuildNumber)'
- clean: false
- preservePaths: true
- trustSSL: false
\ No newline at end of file
+ - task: FtpUpload@2
+ displayName: "Upload binaries to FTP"
+ inputs:
+ credentialsOption: "inputs"
+ serverUrl: "ftp://artemis-rgb.com"
+ username: "devops"
+ password: "$(ftp_password)"
+ rootDirectory: "$(Build.ArtifactStagingDirectory)/archive"
+ filePatterns: "**"
+ remoteDirectory: "/builds.artemis-rgb.com/binaries/$(Build.SourceBranchName)/$(Build.BuildNumber)"
+ clean: false
+ preservePaths: true
+ trustSSL: false
diff --git a/src/Artemis.ConsoleUI/Artemis.UI.Console.csproj b/src/Artemis.ConsoleUI/Artemis.UI.Console.csproj
deleted file mode 100644
index 145ff4a6a..000000000
--- a/src/Artemis.ConsoleUI/Artemis.UI.Console.csproj
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- exe
- net5.0
- x64
- Artemis.UI.Console
- Artemis.UI.Console
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Artemis.ConsoleUI/Program.cs b/src/Artemis.ConsoleUI/Program.cs
deleted file mode 100644
index 6d694d8d6..000000000
--- a/src/Artemis.ConsoleUI/Program.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading;
-using Artemis.Core;
-using Artemis.Core.Ninject;
-using Artemis.Core.Services;
-using Artemis.Storage;
-using Ninject;
-
-namespace Artemis.UI.Console
-{
- ///
- /// This is just a little experiment to show that Artemis can run without the UI and even on other OSes
- /// Some notes
- /// - Any plugin relying on WPF and/or Artemis.UI.Shared won't load
- /// - There is no input provider so key-press events and brushes won't work
- /// - Device providers using Windows SDKs won't work, OpenRGB will though!
- /// - You may need to fiddle around to get SkiaSharp binaries going
- /// - There is no UI obviously
- ///
- internal class Program
- {
- private static readonly AutoResetEvent Closing = new(false);
-
- protected static void OnExit(object sender, ConsoleCancelEventArgs args)
- {
- Closing.Set();
- }
-
- private static void Main(string[] args)
- {
- StorageManager.CreateBackup(Constants.DataFolder);
-
- Utilities.PrepareFirstLaunch();
- Utilities.ShutdownRequested += UtilitiesOnShutdownRequested;
- StandardKernel kernel = new() {Settings = {InjectNonPublic = true}};
- kernel.Load();
-
- ICoreService core = kernel.Get();
- core.StartupArguments = args.ToList();
- core.IsElevated = false;
- core.Initialize();
-
- System.Console.CancelKeyPress += OnExit;
- Closing.WaitOne();
- }
-
- private static void UtilitiesOnShutdownRequested(object sender, EventArgs e)
- {
- Closing.Set();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Artemis.ConsoleUI/Properties/PublishProfiles/Linux.pubxml b/src/Artemis.ConsoleUI/Properties/PublishProfiles/Linux.pubxml
deleted file mode 100644
index 36fac7487..000000000
--- a/src/Artemis.ConsoleUI/Properties/PublishProfiles/Linux.pubxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- Release
- x64
- bin\publish\linux
- FileSystem
- net5.0
- linux-x64
- false
- False
-
-
\ No newline at end of file
diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj
index 57ca5d067..985ec0b61 100644
--- a/src/Artemis.Core/Artemis.Core.csproj
+++ b/src/Artemis.Core/Artemis.Core.csproj
@@ -1,79 +1,78 @@
-
- net5.0
- false
- false
- Artemis.Core
- Artemis Core
- Copyright © Robert Beekman - 2020
- bin\
- x64
-
-
- x64
- bin\Artemis.Core.xml
-
- 5
-
+
+ net6.0
+ false
+ false
+ Artemis.Core
+ Artemis Core
+ Copyright © Robert Beekman - 2020
+ bin\
+ x64
+
+
+ x64
+ bin\Artemis.Core.xml
+
+ 5
+
-
- 1.0-{chash:6}
- true
- true
- true
- v[0-9]*
- true
- git
- true
- enable
- latest
-
+
+ 1.0-{chash:6}
+ true
+ true
+ true
+ v[0-9]*
+ true
+ git
+ true
+ enable
+ latest
+
-
- bin\Artemis.Core.xml
-
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
- PreserveNewest
-
-
+
+ bin\Artemis.Core.xml
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ PreserveNewest
+
+
-
-
- PreserveNewest
-
-
+
+
+ PreserveNewest
+
+
\ No newline at end of file
diff --git a/src/Artemis.Core/Artemis.Core.csproj.DotSettings b/src/Artemis.Core/Artemis.Core.csproj.DotSettings
index 31cbebcb3..a18836e5e 100644
--- a/src/Artemis.Core/Artemis.Core.csproj.DotSettings
+++ b/src/Artemis.Core/Artemis.Core.csproj.DotSettings
@@ -1,5 +1,6 @@
True
+ True
True
True
True
@@ -43,12 +44,15 @@
True
True
True
+ True
True
True
True
True
True
True
+ True
+ True
True
True
True
@@ -63,6 +67,7 @@
True
True
True
+ True
True
True
True
@@ -71,6 +76,9 @@
True
True
True
+ True
+ True
+ True
True
True
True
@@ -83,4 +91,6 @@
True
True
True
- True
\ No newline at end of file
+ True
+ True
+ True
\ No newline at end of file
diff --git a/src/Artemis.Core/Constants.cs b/src/Artemis.Core/Constants.cs
index 7921af0bc..69208acb3 100644
--- a/src/Artemis.Core/Constants.cs
+++ b/src/Artemis.Core/Constants.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Reflection;
using Artemis.Core.JsonConverters;
using Artemis.Core.Services;
using Artemis.Core.Services.Core;
@@ -14,6 +15,11 @@ namespace Artemis.Core
///
public static class Constants
{
+ ///
+ /// The Artemis.Core assembly
+ ///
+ public static readonly Assembly CoreAssembly = typeof(Constants).Assembly;
+
///
/// The full path to the Artemis application folder
///
@@ -24,10 +30,30 @@ namespace Artemis.Core
///
public static readonly string ExecutablePath = Utilities.GetCurrentLocation();
+ ///
+ /// The base path for Artemis application data folder
+ ///
+ public static readonly string BaseFolder = Environment.GetFolderPath(OperatingSystem.IsWindows() ? Environment.SpecialFolder.CommonApplicationData : Environment.SpecialFolder.LocalApplicationData);
+
///
/// The full path to the Artemis data folder
///
- public static readonly string DataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Artemis");
+ public static readonly string DataFolder = Path.Combine(BaseFolder, "Artemis");
+
+ ///
+ /// The full path to the Artemis logs folder
+ ///
+ public static readonly string LogsFolder = Path.Combine(DataFolder, "Logs");
+
+ ///
+ /// The full path to the Artemis plugins folder
+ ///
+ public static readonly string PluginsFolder = Path.Combine(DataFolder, "Plugins");
+
+ ///
+ /// The full path to the Artemis user layouts folder
+ ///
+ public static readonly string LayoutsFolder = Path.Combine(DataFolder, "User Layouts");
///
/// The plugin info used by core components of Artemis
@@ -62,13 +88,13 @@ namespace Artemis.Core
internal static JsonSerializerSettings JsonConvertSettings = new()
{
- Converters = new List {new SKColorConverter(), new ForgivingIntConverter()}
+ Converters = new List {new SKColorConverter(), new NumericJsonConverter(), new ForgivingIntConverter()}
};
internal static JsonSerializerSettings JsonConvertTypedSettings = new()
{
TypeNameHandling = TypeNameHandling.All,
- Converters = new List {new SKColorConverter(), new ForgivingIntConverter()}
+ Converters = new List {new SKColorConverter(), new NumericJsonConverter(), new ForgivingIntConverter()}
};
///
diff --git a/src/Artemis.Core/DefaultTypes/Conditions/Operators/EnumContainsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/EnumContainsConditionOperator.cs
deleted file mode 100644
index dd79f14cb..000000000
--- a/src/Artemis.Core/DefaultTypes/Conditions/Operators/EnumContainsConditionOperator.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace Artemis.Core
-{
- internal class EnumContainsConditionOperator : ConditionOperator
- {
- public override string Description => "Contains";
- public override string Icon => "Contain";
-
- public override bool Evaluate(Enum a, Enum b)
- {
- return a != null && b != null && a.HasFlag(b);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Artemis.Core/DefaultTypes/Conditions/Operators/EnumNotContainsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/EnumNotContainsConditionOperator.cs
deleted file mode 100644
index ef78b8470..000000000
--- a/src/Artemis.Core/DefaultTypes/Conditions/Operators/EnumNotContainsConditionOperator.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace Artemis.Core
-{
- internal class EnumNotContainsConditionOperator : ConditionOperator
- {
- public override string Description => "Does not contain";
- public override string Icon => "FormatStrikethrough";
-
- public override bool Evaluate(Enum a, Enum b)
- {
- return a != null && (b == null || !a.HasFlag(b));
- }
- }
-}
\ No newline at end of file
diff --git a/src/Artemis.Core/DefaultTypes/Conditions/Operators/EqualsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/EqualsConditionOperator.cs
deleted file mode 100644
index 789f86d63..000000000
--- a/src/Artemis.Core/DefaultTypes/Conditions/Operators/EqualsConditionOperator.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Artemis.Core
-{
- internal class EqualsConditionOperator : ConditionOperator