浏览代码

Revert "Add support for .net 10"

This reverts commit 31ff89f1ff376f4f235e8ca4049c4955b7f7d665.
Ruben 7 月之前
父节点
当前提交
ea78f1e137

+ 1 - 1
Build/Build Avalonia.MacOS.ps1

@@ -41,7 +41,7 @@ $tempBuildPath = Join-Path -Path $outputPath -ChildPath "temp"
 New-Item -ItemType Directory -Force -Path $tempBuildPath
 
 # Run dotnet publish for the Avalonia project
-dotnet publish -f net9.0 $avaloniaProjectPath `
+dotnet publish $avaloniaProjectPath `
     --runtime "osx-$Platform" `
     --self-contained true `
     --configuration Release `

+ 48 - 0
Build/Build Avalonia.Win32 x64.ps1

@@ -0,0 +1,48 @@
+# Define the project path relative to the script's location
+$projectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.Avalonia.Win32\PicView.Avalonia.Win32.csproj"
+
+# Load the .csproj file as XML and extract the AssemblyVersion
+$projectFile = [xml](Get-Content $projectPath)
+$assemblyVersion = $projectFile.Project.PropertyGroup.AssemblyVersion
+
+# Define the temporary output path using the system's temp folder
+$tempPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath "PicView"
+
+# Define the final output path relative to the script's location
+$outputPath = Join-Path -Path $PSScriptRoot -ChildPath "PicView-v.$assemblyVersion-win-x64"
+
+# Ensure the temp directory exists
+if (-Not (Test-Path $tempPath)) {
+    New-Item -Path $tempPath -ItemType Directory | Out-Null
+}
+
+# Run dotnet publish
+dotnet publish $projectPath --runtime win-x64 --self-contained true --configuration Release --output $tempPath /p:PublishReadyToRun=true
+
+# Ensure the output directory exists and is empty
+if (Test-Path $outputPath) {
+    Remove-Item -Path $outputPath -Recurse -Force
+}
+New-Item -Path $outputPath -ItemType Directory | Out-Null
+
+# Copy the build output to the final destination
+Copy-Item -Path "$tempPath\*" -Destination $outputPath -Recurse -Force
+
+# Remove the license file
+$licensePath = Join-Path -Path $outputPath -ChildPath "Licenses\XamlAnimatedGif LICENSE.txt"
+if (Test-Path $licensePath) {
+    Remove-Item -Path $licensePath -Force
+}
+
+# Remove the PDB file
+$pdbPath = Join-Path -Path $outputPath -ChildPath "PicView.Avalonia.pdb"
+if (Test-Path $pdbPath) {
+    Remove-Item -Path $pdbPath -Force
+}
+
+#Remove uninstended space
+Rename-Item -path $outputPath -NewName $outputPath.Replace(" ","")
+
+# Clean up the temporary directory
+Start-Sleep -Seconds 2
+Remove-Item -Path $tempPath -Recurse -Force

+ 1 - 1
Build/Build Avalonia.Win32.ps1

@@ -35,7 +35,7 @@ $coreCsproj.Save($coreProjectPath)
 $avaloniaProjectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.Avalonia.Win32\PicView.Avalonia.Win32.csproj"
 
 # Run dotnet publish for the Avalonia project
-dotnet publish -f net9.0-windows10.0.22621.0 $avaloniaProjectPath --runtime "win-$Platform" --self-contained true --configuration Release --output $outputPath /p:PublishReadyToRun=true
+dotnet publish $avaloniaProjectPath --runtime "win-$Platform" --self-contained true --configuration Release --output $outputPath /p:PublishReadyToRun=true
 
 
 # Remove the PDB file

+ 1 - 1
src/PicView.Avalonia.MacOS/PicView.Avalonia.MacOS.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>WinExe</OutputType>
-    <TargetFrameworks>net10.0;net9.0</TargetFrameworks>
+	<TargetFramework>net9.0</TargetFramework>
     <Platforms>x64;arm64</Platforms>
     <Nullable>enable</Nullable>
     <BuiltInComInteropSupport>true</BuiltInComInteropSupport>

+ 1 - 1
src/PicView.Avalonia.Win32/PicView.Avalonia.Win32.csproj

@@ -3,7 +3,7 @@
     <OutputType>WinExe</OutputType>
     <!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
     One for Windows with net7.0-windows TFM, one for MacOS with net7.0-macos and one with net7.0 TFM for Linux.-->
-    <TargetFrameworks>net10.0-windows10.0.22621.0;net9.0-windows10.0.22621.0</TargetFrameworks>
+    <TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
     <Nullable>enable</Nullable>
     <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
     <ApplicationManifest>app.manifest</ApplicationManifest>

+ 1 - 1
src/PicView.Avalonia/PicView.Avalonia.csproj

@@ -1,5 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
+    <TargetFramework>net9.0</TargetFramework>
     <Nullable>enable</Nullable>
     <LangVersion>preview</LangVersion>
     <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
@@ -8,7 +9,6 @@
     <Product>PicView</Product>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <Platforms>x64;arm64</Platforms>
-    <TargetFrameworks>net10.0;net9.0</TargetFrameworks>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <IsAotCompatible>False</IsAotCompatible>

+ 1 - 1
src/PicView.Core/PicView.Core.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>net10.0;net9.0</TargetFrameworks>
+    <TargetFramework>net9.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <Platforms>x64;arm64</Platforms>

+ 1 - 1
src/PicView.MacOS/PicView.MacOS.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net10.0;net9.0</TargetFrameworks>
+    <TargetFramework>net9.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <Platforms>arm64;x64</Platforms>

+ 1 - 1
src/PicView.Tests/PicView.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net10.0;net9.0</TargetFrameworks>
+    <TargetFramework>net9.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 

+ 1 - 1
src/PicView.WindowsNT/PicView.WindowsNT.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net10.0-windows10.0.22621.0;net9.0-windows10.0.22621.0</TargetFrameworks>
+    <TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <Platforms>x64;arm64</Platforms>