Browse Source

Merge pull request #430 from PixiEditor/dotnet-7

Upgraded to .NET 7
Krzysztof Krysiński 2 years ago
parent
commit
ced19b58c3

+ 1 - 7
azure-pipelines.yml

@@ -17,12 +17,6 @@ steps:
   inputs:
     restoreSolution: '$(solution)'
 
-- task: DotNetCoreCLI@2
-  inputs:
-    command: 'custom'
-    custom: 'tool'
-    arguments: 'install --global Codecov.Tool'
-
 - task: DotNetCoreCLI@2
   displayName: Build
   inputs:
@@ -35,7 +29,7 @@ steps:
   inputs:
     command: test
     projects: '**/*Tests/*.csproj'
-    arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
+    arguments: '--configuration $(buildConfiguration)'
 
 #- task: PowerShell@2
 #  inputs:

+ 1 - 1
incompatible.json

@@ -1 +1 @@
-["0.1.3.0", "0.1.3.1", "0.1.3.2", "0.1.3.3", "0.1.3.4", "0.1.3.5", "0.1.3.6", "0.1.4.0", "0.1.5.0", "0.1.6.0"]
+["0.1.3.0", "0.1.3.1", "0.1.3.2", "0.1.3.3", "0.1.3.4", "0.1.3.5", "0.1.3.6", "0.1.4.0", "0.1.5.0", "0.1.6.0", "0.1.7.0", "0.1.8.0"]

+ 14 - 14
src/Installer/installer-setup-x64-light.iss

@@ -4,8 +4,8 @@
 // requires netcorecheck.exe and netcorecheck_x64.exe (see download link below)
 #define UseNetCoreCheck
 #ifdef UseNetCoreCheck
-  ;#define UseDotNet60
-  #define UseDotNet60Desktop
+  ;#define UseDotNet70
+  #define UseDotNet70Desktop
 #endif
 
 // custom setup info
@@ -401,24 +401,24 @@ var
   Version: String;
 begin
 
-#ifdef UseDotNet60
-  // https://dotnet.microsoft.com/download/dotnet/6.0
-  if not IsNetCoreInstalled('Microsoft.NETCore.App 6.0.0') then begin
-    AddDependency('dotnet60' + GetArchitectureSuffix + '.exe',
+#ifdef UseDotNet70
+  // https://dotnet.microsoft.com/download/dotnet/7.0
+  if not IsNetCoreInstalled('Microsoft.NETCore.App 7.0.0') then begin
+    AddDependency('dotnet70' + GetArchitectureSuffix + '.exe',
       '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
-      '.NET Runtime 6.0' + GetArchitectureTitle,
-      GetString('https://download.visualstudio.microsoft.com/download/pr/34df41d5-c813-4e30-8aa3-3603ce6600c0/976e801af82c7108abbcb736a8bc5c14/dotnet-runtime-6.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/b9cfdb9e-d5cd-4024-b318-00390b729d2f/65690f2440f40654898020cdfffa1050/dotnet-runtime-6.0.0-win-x64.exe'),
+      '.NET Runtime 7.0' + GetArchitectureTitle,
+      GetString('https://download.visualstudio.microsoft.com/download/pr/75c0d7c7-9f30-46fd-9675-a301f0e051f4/ec04d5cc40aa6537a4af21fad6bf8ba9/dotnet-runtime-7.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/87bc5966-97cc-498c-8381-bff4c43aafc6/baca88b989e7d2871e989d33a667d8e9/dotnet-runtime-7.0.0-win-x64.exe'),
       '', False, False, False);
   end;
 #endif
 
-#ifdef UseDotNet60Desktop
-  // https://dotnet.microsoft.com/download/dotnet/6.0
-  if not IsNetCoreInstalled('Microsoft.WindowsDesktop.App 6.0.0') then begin
-    AddDependency('dotnet60desktop' + GetArchitectureSuffix + '.exe',
+#ifdef UseDotNet70Desktop
+  // https://dotnet.microsoft.com/download/dotnet/7.0
+  if not IsNetCoreInstalled('Microsoft.WindowsDesktop.App 7.0.0') then begin
+    AddDependency('dotnet70desktop' + GetArchitectureSuffix + '.exe',
       '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
-      '.NET Desktop Runtime 6.0' + GetArchitectureTitle,
-      GetString('https://download.visualstudio.microsoft.com/download/pr/a1ca7d0d-ce01-4878-b952-3fa1e6d9a7c6/e386db367490b631b8c013a9fb0f3794/windowsdesktop-runtime-6.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/a865ccae-2219-4184-bcd6-0178dc580589/ba452d37e8396b7a49a9adc0e1a07e87/windowsdesktop-runtime-6.0.0-win-x64.exe'),
+      '.NET Desktop Runtime 7.0' + GetArchitectureTitle,
+      GetString('https://download.visualstudio.microsoft.com/download/pr/d05a833c-2cf9-4d06-89ae-a0f3e10c5c91/c668ff42e23c2f67aa3d80227860585f/windowsdesktop-runtime-7.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/5b2fbe00-507e-450e-8b52-43ab052aadf2/79d54c3a19ce3fce314f2367cf4e3b21/windowsdesktop-runtime-7.0.0-win-x64.exe'),
       '', False, False, False);
   end;
 #endif

+ 14 - 14
src/Installer/installer-setup-x86-light.iss

@@ -4,8 +4,8 @@
 // requires netcorecheck.exe and netcorecheck_x64.exe (see download link below)
 #define UseNetCoreCheck
 #ifdef UseNetCoreCheck
-  ;#define UseDotNet60
-  #define UseDotNet60Desktop
+  ;#define UseDotNet70
+  #define UseDotNet70Desktop
 #endif
 
 // custom setup info
@@ -400,24 +400,24 @@ var
   Version: String;
 begin
 
-#ifdef UseDotNet60
-  // https://dotnet.microsoft.com/download/dotnet/6.0
-  if not IsNetCoreInstalled('Microsoft.NETCore.App 6.0.0') then begin
-    AddDependency('dotnet60' + GetArchitectureSuffix + '.exe',
+#ifdef UseDotNet70
+  // https://dotnet.microsoft.com/download/dotnet/7.0
+  if not IsNetCoreInstalled('Microsoft.NETCore.App 7.0.0') then begin
+    AddDependency('dotnet70' + GetArchitectureSuffix + '.exe',
       '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
-      '.NET Runtime 6.0' + GetArchitectureTitle,
-      GetString('https://download.visualstudio.microsoft.com/download/pr/34df41d5-c813-4e30-8aa3-3603ce6600c0/976e801af82c7108abbcb736a8bc5c14/dotnet-runtime-6.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/b9cfdb9e-d5cd-4024-b318-00390b729d2f/65690f2440f40654898020cdfffa1050/dotnet-runtime-6.0.0-win-x64.exe'),
+      '.NET Runtime 7.0' + GetArchitectureTitle,
+      GetString('https://download.visualstudio.microsoft.com/download/pr/75c0d7c7-9f30-46fd-9675-a301f0e051f4/ec04d5cc40aa6537a4af21fad6bf8ba9/dotnet-runtime-7.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/87bc5966-97cc-498c-8381-bff4c43aafc6/baca88b989e7d2871e989d33a667d8e9/dotnet-runtime-7.0.0-win-x64.exe'),
       '', False, False, False);
   end;
 #endif
 
-#ifdef UseDotNet60Desktop
-  // https://dotnet.microsoft.com/download/dotnet/6.0
-  if not IsNetCoreInstalled('Microsoft.WindowsDesktop.App 6.0.0') then begin
-    AddDependency('dotnet60desktop' + GetArchitectureSuffix + '.exe',
+#ifdef UseDotNet70Desktop
+  // https://dotnet.microsoft.com/download/dotnet/7.0
+  if not IsNetCoreInstalled('Microsoft.WindowsDesktop.App 7.0.0') then begin
+    AddDependency('dotnet70desktop' + GetArchitectureSuffix + '.exe',
       '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
-      '.NET Desktop Runtime 6.0' + GetArchitectureTitle,
-      GetString('https://download.visualstudio.microsoft.com/download/pr/a1ca7d0d-ce01-4878-b952-3fa1e6d9a7c6/e386db367490b631b8c013a9fb0f3794/windowsdesktop-runtime-6.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/a865ccae-2219-4184-bcd6-0178dc580589/ba452d37e8396b7a49a9adc0e1a07e87/windowsdesktop-runtime-6.0.0-win-x64.exe'),
+      '.NET Desktop Runtime 7.0' + GetArchitectureTitle,
+      GetString('https://download.visualstudio.microsoft.com/download/pr/d05a833c-2cf9-4d06-89ae-a0f3e10c5c91/c668ff42e23c2f67aa3d80227860585f/windowsdesktop-runtime-7.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/5b2fbe00-507e-450e-8b52-43ab052aadf2/79d54c3a19ce3fce314f2367cf4e3b21/windowsdesktop-runtime-7.0.0-win-x64.exe'),
       '', False, False, False);
   end;
 #endif

+ 1 - 1
src/PixiEditor.ChangeableDocument/PixiEditor.ChangeableDocument.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <WarningsAsErrors>Nullable</WarningsAsErrors>

+ 1 - 1
src/PixiEditor.UpdateInstaller/PixiEditor.UpdateInstaller.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <OutputType>WinExe</OutputType>
-    <TargetFramework>net6.0-windows</TargetFramework>
+    <TargetFramework>net7.0-windows</TargetFramework>
     <UseWPF>true</UseWPF>
     <ApplicationManifest>app.manifest</ApplicationManifest>
     <Platforms>AnyCPU;x64;x86</Platforms>

+ 1 - 1
src/PixiEditor.UpdateModule/PixiEditor.UpdateModule.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <Platforms>AnyCPU;x64;x86</Platforms>
   </PropertyGroup>
 

+ 1 - 1
src/PixiEditor.Zoombox/PixiEditor.Zoombox.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0-windows</TargetFramework>
+    <TargetFramework>net7.0-windows</TargetFramework>
     <Nullable>enable</Nullable>
     <UseWPF>true</UseWPF>
     <WarningsAsErrors>Nullable</WarningsAsErrors>

+ 4 - 2
src/PixiEditor/Models/Commands/XAML/Command.cs

@@ -1,4 +1,6 @@
-using System.Windows.Input;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Input;
 using System.Windows.Markup;
 using PixiEditor.Helpers;
 
@@ -20,7 +22,7 @@ internal class Command : MarkupExtension
 
     public override object ProvideValue(IServiceProvider serviceProvider)
     {
-        if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
+        if ((bool)(DesignerProperties.IsInDesignModeProperty.GetMetadata(typeof(DependencyObject)).DefaultValue))
         {
             var attribute = DesignCommandHelpers.GetCommandAttribute(Name);
             return GetICommand(

+ 2 - 2
src/PixiEditor/PixiEditor.csproj

@@ -2,7 +2,7 @@
 
 	<PropertyGroup>
 		<OutputType>WinExe</OutputType>
-		<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
+		<TargetFramework>net7.0-windows</TargetFramework>
 		<UseWPF>true</UseWPF>
 		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
 		<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -16,9 +16,9 @@
 		<Authors>Krzysztof Krysiński, Egor Mozgovoy, CPK</Authors>
 		<Configurations>Debug;Release;MSIX;MSIX Debug;Dev Release</Configurations>
 		<Platforms>AnyCPU;x64;x86</Platforms>
-		<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
         <ImplicitUsings>true</ImplicitUsings>
         <AssemblyVersion></AssemblyVersion>
+        <LangVersion>11</LangVersion>
 	</PropertyGroup>
 
 	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSIX|AnyCPU'">

+ 1 - 3
src/PixiEditorTests/PixiEditorTests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
+    <TargetFramework>net7.0-windows</TargetFramework>
 
     <IsPackable>false</IsPackable>
 
@@ -30,7 +30,6 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Codecov" Version="1.13.0" />
     <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -38,7 +37,6 @@
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
-    <PackageReference Include="Moq" Version="4.17.2" />
     <PackageReference Include="OpenCover" Version="4.7.1221" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">

+ 7 - 0
src/global.json

@@ -0,0 +1,7 @@
+{
+  "sdk": {
+    "version": "7.0.0",
+    "rollForward": "latestMajor",
+    "allowPrerelease": false
+  }
+}

+ 1 - 1
windows-x64-release-dev.yml

@@ -20,7 +20,7 @@ steps:
 - task: UseDotNet@2
   inputs:
     packageType: 'sdk'
-    version: '6.x'
+    version: '7.x'
 - task: NuGetToolInstaller@1
 
 - task: NuGetCommand@2

+ 1 - 1
windows-x64-release.yml

@@ -20,7 +20,7 @@ steps:
 - task: UseDotNet@2
   inputs:
     packageType: 'sdk'
-    version: '6.x'
+    version: '7.x'
 - task: NuGetToolInstaller@1
 
 - task: NuGetCommand@2

+ 1 - 1
windows-x86-release-dev.yml

@@ -20,7 +20,7 @@ steps:
 - task: UseDotNet@2
   inputs:
     packageType: 'sdk'
-    version: '6.x'
+    version: '7.x'
 
 - task: NuGetToolInstaller@1
 

+ 1 - 1
windows-x86-release.yml

@@ -20,7 +20,7 @@ steps:
 - task: UseDotNet@2
   inputs:
     packageType: 'sdk'
-    version: '6.x'
+    version: '7.x'
 
 - task: NuGetToolInstaller@1