Skip to content

Commit

Permalink
remove unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotr7 committed Jan 27, 2025
1 parent 9c0d09e commit 4fa0c80
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 34 deletions.
11 changes: 3 additions & 8 deletions src/StarBreaker.DataCore.TypeGenerator/DataCoreCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ private void GenerateEnums(string path)
sb.AppendLine($"public enum {enumDefinition.GetName(Database)} : int");
sb.AppendLine("{");

if ("SinglePlayerOrMultiplayer" == enumDefinition.GetName(Database))
{
Console.WriteLine();
}

sb.AppendLine($" __Unknown = -1,");

for (var i = 0; i < enumDefinition.ValueCount; i++)
Expand Down Expand Up @@ -174,7 +169,7 @@ private void GenerateTypes(string path)
// DataType.WeakPointer => Database.StructDefinitions[property.StructIndex].GetName(Database)?,
_ => throw new ArgumentOutOfRangeException()
};

private string GetGenericPropertyType(DataCorePropertyDefinition property) => property.DataType switch
{
DataType.Boolean => "bool",
Expand Down Expand Up @@ -387,7 +382,7 @@ private void WriteArrayRead(StringBuilder sb, DataCorePropertyDefinition propert
throw new ArgumentOutOfRangeException();
}
}

private void GenerateConstantsFile(string path)
{
var sb = new StringBuilder();
Expand All @@ -400,7 +395,7 @@ private void GenerateConstantsFile(string path)
sb.AppendLine($" public const int StructsHash = {Database.StructsHash};");
sb.AppendLine($" public const int EnumsHash = {Database.EnumsHash};");
sb.AppendLine("}");

File.WriteAllText(Path.Combine(path, "Constants.cs"), sb.ToString());
}
}
21 changes: 10 additions & 11 deletions src/StarBreaker.Dds/StarBreaker.Dds.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DirectXTexNet" Version="1.0.7" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StarBreaker.Common\StarBreaker.Common.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DirectXTexNet" Version="1.0.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StarBreaker.Common\StarBreaker.Common.csproj" />
</ItemGroup>
</Project>
15 changes: 9 additions & 6 deletions src/StarBreaker/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
Expand All @@ -24,17 +25,19 @@ public override void Initialize()
RequestedThemeVariant = ThemeVariant.Dark;
}
}

private SplashWindow? _splashWindow;
private MainWindow? _mainWindow;

[UnconditionalSuppressMessage(
"AssemblyLoadTrimming",
"IL2026:RequiresUnreferencedCode",
Justification = "Everything referenced in the loaded assembly is manually preserved, so it's safe")]
public override void OnFrameworkInitializationCompleted()
{
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
#pragma warning disable IL2026
BindingPlugins.DataValidators.RemoveAt(0);
#pragma warning restore IL2026

var collection = new ServiceCollection();

Expand All @@ -59,12 +62,12 @@ public override void OnFrameworkInitializationCompleted()

private void SwapWindows(object? sender, EventArgs e)
{
if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
return;

var mainVm = Services.GetRequiredService<MainWindowViewModel>();
_mainWindow = new MainWindow { DataContext = mainVm };

//do not change the order of these
_mainWindow.Show();
_splashWindow!.Close();
Expand Down
20 changes: 11 additions & 9 deletions src/StarBreaker/StarBreaker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="Assets\**"/>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
Expand All @@ -16,8 +16,11 @@
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.2.0" />
<PackageReference Include="Avalonia.Controls.TreeDataGrid" Version="11.1.0" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
<!--Condition
below is needed to remove Avalonia.Diagnostics package from build output in Release
configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics"
Version="11.2.3" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.1.0" />
<PackageReference Include="AvaloniaEdit.TextMate.Grammars" Version="0.10.12.1" />
<PackageReference Include="AvaloniaHex" Version="0.1.6" />
Expand All @@ -28,13 +31,12 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.1" />
<PackageReference Include="Pfim" Version="0.11.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\StarBreaker.CryXmlB\StarBreaker.CryXmlB.csproj" />
<ProjectReference Include="..\StarBreaker.DataCore\StarBreaker.DataCore.csproj" />
<ProjectReference Include="..\StarBreaker.Dds\StarBreaker.Dds.csproj" />
<ProjectReference Include="..\StarBreaker.P4k\StarBreaker.P4k.csproj" />
<ProjectReference Include="..\StarBreaker.CryXmlB\StarBreaker.CryXmlB.csproj" />
<ProjectReference Include="..\StarBreaker.DataCore\StarBreaker.DataCore.csproj" />
<ProjectReference Include="..\StarBreaker.Dds\StarBreaker.Dds.csproj" />
<ProjectReference Include="..\StarBreaker.P4k\StarBreaker.P4k.csproj" />
</ItemGroup>
</Project>
</Project>

0 comments on commit 4fa0c80

Please sign in to comment.