Browse Source

Build fixes

flabbet 1 year ago
parent
commit
c630e97f3d

+ 10 - 2
src/Directory.Build.props

@@ -38,19 +38,21 @@
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)'=='MSIX Debug'">
-    <DebugType>full</DebugType>
-    <DebugSymbols>true</DebugSymbols>
     <Optimize>false</Optimize>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)'=='MSIX'">
     <DefineConstants>TRACE;RELEASE</DefineConstants>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
     <Optimize>true</Optimize>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)'=='Release'">
     <DefineConstants>TRACE;UPDATE</DefineConstants>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
     <Optimize>true</Optimize>
   </PropertyGroup>
 
@@ -64,16 +66,22 @@
   <PropertyGroup Condition="'$(Configuration)'=='Steam'">
     <DefineConstants>TRACE;RELEASE;STEAM</DefineConstants>
     <Optimize>True</Optimize>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)'=='DevSteam'">
     <DefineConstants>TRACE;RELEASE;STEAM</DefineConstants>
     <Optimize>True</Optimize>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
   </PropertyGroup>
 
   <PropertyGroup Condition=" '$(Configuration)' == 'DevRelease' ">
     <DefineConstants>TRACE;UPDATE;RELEASE</DefineConstants>
     <Optimize>True</Optimize>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(RuntimeIdentifier)'=='win-x64'">

+ 2 - 2
src/PixiEditor.Builder/build/Program.cs

@@ -88,7 +88,7 @@ public sealed class ReplaceSpecialStringsTask : FrostingTask<BuildContext>
     {
         context.Log.Information("Replacing special strings...");
         string projectPath = context.PathToProject;
-        string filePath = Path.Combine(projectPath, "BuildConstants.cs");
+        string filePath = Path.Combine(projectPath, "..", "PixiEditor", "BuildConstants.cs");
 
         string result;
         var fileContent = File.ReadAllText(filePath);
@@ -130,7 +130,7 @@ public sealed class BuildProjectTask : FrostingTask<BuildContext>
     public override void Finally(BuildContext context)
     {
         context.Log.Information("Cleaning up...");
-        string constantsPath = Path.Combine(context.PathToProject, "BuildConstants.cs");
+        string constantsPath = Path.Combine(context.PathToProject, "..", "PixiEditor", "BuildConstants.cs");
 
         File.WriteAllText(constantsPath, context.BackedUpConstants);
     }

+ 25 - 20
src/PixiEditor.Desktop/PixiEditor.Desktop.csproj

@@ -1,30 +1,35 @@
 <Project Sdk="Microsoft.NET.Sdk">
-    <PropertyGroup>
-        <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.-->
-        <TargetFramework>net8.0</TargetFramework>
-        <Nullable>enable</Nullable>
-        <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
-        <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
-        <RootNamespace>PixiEditor.AvaloniaUI.Desktop</RootNamespace>
-    </PropertyGroup>
+  <PropertyGroup>
+    <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.-->
+    <TargetFramework>net8.0</TargetFramework>
+    <Nullable>enable</Nullable>
+    <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
+    <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
+    <RootNamespace>PixiEditor.Desktop</RootNamespace>
+  </PropertyGroup>
 
-    <PropertyGroup>
-        <ApplicationManifest>app.manifest</ApplicationManifest>
-    </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationManifest>app.manifest</ApplicationManifest>
+  </PropertyGroup>
 
-    <ItemGroup>
-        <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
-        <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
-        <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
-    </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
+    <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
+    <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
+  </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
+    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2"/>
   </ItemGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\PixiEditor\PixiEditor.csproj" />
+    <ProjectReference Include="..\PixiEditor\PixiEditor.csproj"/>
   </ItemGroup>
+
+  <Target Name="Rename" AfterTargets="AfterBuild">
+    <Move SourceFiles="$(OutDir)PixiEditor.Desktop.exe" DestinationFiles="$(OutDir)PixiEditor.exe" />
+    <Message Text="Renamed executable file." Importance="high" />
+  </Target> 
 </Project>

+ 1 - 2
src/PixiEditor.Desktop/Program.cs

@@ -1,8 +1,7 @@
 using System;
 using Avalonia;
-using PixiEditor;
 
-namespace PixiEditor.Avalonia.Desktop;
+namespace PixiEditor.Desktop;
 
 public class Program
 {

+ 1 - 1
src/PixiEditor/Models/ExceptionHandling/CrashReport.cs

@@ -337,7 +337,7 @@ internal class CrashReport : IDisposable
         Process process = new();
 
         //TODO: Handle different name for the executable, .Desktop.exe
-        string fileName = Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location) + ".Desktop.exe";
+        string fileName = Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location) + ".exe";
 
         process.StartInfo = new()
         {