Skip to content

Commit

Permalink
Remove generated types from CI compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotr7 committed Jan 26, 2025
1 parent 8e386fd commit 0cf75d8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
23 changes: 23 additions & 0 deletions src/StarBreaker.DataCore.Generated/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using StarBreaker.Common;
using StarBreaker.DataCore;
using StarBreaker.DataCoreGenerated;
using StarBreaker.P4k;

var timer = new TimeLogger();
var p4k = new P4kFileSystem(P4kFile.FromFile(@"C:\Program Files\Roberts Space Industries\StarCitizen\PTU\Data.p4k"));
var dcbStream = p4k.OpenRead(@"Data\Game2.dcb");

var df = new DataForge<DataCoreTypedRecord>(new DataCoreBinaryGenerated(new DataCoreDatabase(dcbStream)));

timer.LogReset("Loaded DataForge");

var allRecords = df.DataCore.Database.MainRecords
.AsParallel()
.Select(x => df.GetFromRecord(x))
.ToList();
timer.LogReset("Extracted all records.");

var classDefinitions = allRecords.Where(r => r.Data is EntityClassDefinition).Select(r => r.Data as EntityClassDefinition).ToList();
//var spaceships = classDefinitions.Where(x => x.Data.tags.Any(t => t?.tagName == "Ship")).ToList();

Console.WriteLine();
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\StarBreaker.DataCore\StarBreaker.DataCore.csproj" />
<ProjectReference Include="..\StarBreaker.P4k\StarBreaker.P4k.csproj" />
</ItemGroup>
</Project>
27 changes: 1 addition & 26 deletions src/StarBreaker.Sandbox/DataCoreSandbox.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Runtime.CompilerServices;
using StarBreaker.Common;
using StarBreaker.Common;
using StarBreaker.DataCore;
using StarBreaker.DataCoreGenerated;
using StarBreaker.P4k;

namespace StarBreaker.Sandbox;
Expand All @@ -10,7 +8,6 @@ public static class DataCoreSandbox
{
public static void Run()
{
//ExtractGenerated();
//ExtractProblematic();
//ExtractAll();
ExtractJson();
Expand Down Expand Up @@ -41,28 +38,6 @@ private static void ExtractProblematic()
// dcb.GetFromRecord(megaMap).Save(@"D:\StarCitizen\DataCore\Sandbox\megamap.xml");
}

private static void ExtractGenerated()
{
var timer = new TimeLogger();
var p4k = new P4kFileSystem(P4kFile.FromFile(@"C:\Program Files\Roberts Space Industries\StarCitizen\PTU\Data.p4k"));
var dcbStream = p4k.OpenRead(@"Data\Game2.dcb");

var df = new DataForge<DataCoreTypedRecord>(new DataCoreBinaryGenerated(new DataCoreDatabase(dcbStream)));

timer.LogReset("Loaded DataForge");

var allRecords = df.DataCore.Database.MainRecords
.AsParallel()
.Select(x => df.GetFromRecord(x))
.ToList();
timer.LogReset("Extracted all records.");

var classDefinitions = allRecords.Where(r => r.Data is EntityClassDefinition).Select(r => r.Data as EntityClassDefinition).ToList();
//var spaceships = classDefinitions.Where(x => x.Data.tags.Any(t => t?.tagName == "Ship")).ToList();

Console.WriteLine();
}

private static void ExtractXml()
{
var timer = new TimeLogger();
Expand Down
1 change: 0 additions & 1 deletion src/StarBreaker.Sandbox/StarBreaker.Sandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<ProjectReference Include="..\StarBreaker.Chf\StarBreaker.Chf.csproj" />
<ProjectReference Include="..\StarBreaker.CryChunkFile\StarBreaker.CryChunkFile.csproj" />
<ProjectReference Include="..\StarBreaker.CryXmlB\StarBreaker.CryXmlB.csproj" />
<ProjectReference Include="..\StarBreaker.DataCore.Generated\StarBreaker.DataCore.Generated.csproj" />
<ProjectReference Include="..\StarBreaker.Dds\StarBreaker.Dds.csproj" />
<ProjectReference Include="..\StarBreaker.DataCore\StarBreaker.DataCore.csproj" />
<ProjectReference Include="..\StarBreaker.P4k\StarBreaker.P4k.csproj" />
Expand Down
2 changes: 0 additions & 2 deletions src/StarBreaker.sln
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ Global
{5B8D1493-7025-4EF3-B56C-70905A5787DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B8D1493-7025-4EF3-B56C-70905A5787DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDBA37FE-1A2A-4901-AC1C-54428A377E90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDBA37FE-1A2A-4901-AC1C-54428A377E90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDBA37FE-1A2A-4901-AC1C-54428A377E90}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDBA37FE-1A2A-4901-AC1C-54428A377E90}.Release|Any CPU.Build.0 = Release|Any CPU
{40FF4AF0-EC2B-47C4-B884-763D84DFAA35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40FF4AF0-EC2B-47C4-B884-763D84DFAA35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40FF4AF0-EC2B-47C4-B884-763D84DFAA35}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down

0 comments on commit 0cf75d8

Please sign in to comment.