Skip to content

Commit 3e2cd46

Browse files
committed
pack project description fallback fix
1 parent 8887a81 commit 3e2cd46

11 files changed

Lines changed: 50 additions & 33 deletions

File tree

PixelGraph.CLI/PixelGraph.CLI.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
24-
<PackageReference Include="Serilog" Version="4.0.2" />
24+
<PackageReference Include="Serilog" Version="4.2.0" />
2525
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
2626
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
2727
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
28+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
29+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
2830
</ItemGroup>
2931

3032
<ItemGroup>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace PixelGraph.Common.Extensions;
2+
3+
internal static class StringExtensions
4+
{
5+
public static string? NullIfEmpty(this string? value)
6+
{
7+
return string.IsNullOrEmpty(value) ? null : value;
8+
}
9+
}

PixelGraph.Common/IO/Publishing/BedrockPublisher.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ public BedrockPublisher(
1919
Mapping = new JavaToBedrockPublishMapping();
2020
}
2121

22-
protected override async Task PublishPackMetaAsync(PublishProfileProperties pack, CancellationToken token)
22+
protected override async Task PublishPackMetaAsync(ProjectPublishContext context, CancellationToken token)
2323
{
2424
var packMeta = new BedrockPackMetadata {
25-
FormatVersion = pack.Format ?? PublishProfileProperties.DefaultBedrockFormat,
25+
FormatVersion = context.Profile?.Format ?? PublishProfileProperties.DefaultBedrockFormat,
2626
Header = {
27-
Name = pack.Name,
28-
Description = pack.Description,
29-
UniqueId = pack.HeaderUuid,
27+
Name = context.Profile?.Name ?? context.Project?.Name,
28+
Description = context.Profile?.Description ?? context.Project?.Description,
29+
UniqueId = context.Profile?.HeaderUuid,
3030
Version = [1, 0, 0],
3131
MinEngineVersion = [1, 16, 0],
3232
},
3333
Modules = {
3434
new BedrockPackModuleMetadata {
35-
UniqueId = pack.ModuleUuid,
36-
Description = pack.Description,
35+
UniqueId = context.Profile?.ModuleUuid,
36+
Description = context.Profile?.Description,
3737
Type = "resources",
3838
Version = [1, 0, 0],
3939
},
4040
},
4141
};
4242

43-
var isRtx = TextureFormat.Is(pack.Encoding?.Format, TextureFormat.Format_Rtx);
43+
var isRtx = TextureFormat.Is(context.Profile?.Encoding?.Format, TextureFormat.Format_Rtx);
4444
if (isRtx) packMeta.Capabilities.Add("raytraced");
4545

4646
await Writer.OpenWriteAsync("manifest.json", async stream => {

PixelGraph.Common/IO/Publishing/JavaPublisher.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.Extensions.Logging;
33
using Newtonsoft.Json;
44
using PixelGraph.Common.ConnectedTextures;
5+
using PixelGraph.Common.Extensions;
56
using PixelGraph.Common.Projects;
67
using PixelGraph.Common.Textures.Graphing;
78
using PixelGraph.Common.Textures.Graphing.Builders;
@@ -21,15 +22,15 @@ public JavaPublisher(
2122
this.ctmPublish = ctmPublish;
2223
}
2324

24-
protected override async Task PublishPackMetaAsync(PublishProfileProperties pack, CancellationToken token)
25+
protected override async Task PublishPackMetaAsync(ProjectPublishContext context, CancellationToken token)
2526
{
2627
var packMeta = new JavaPackMetadata {
27-
PackFormat = pack.Format ?? PublishProfileProperties.DefaultJavaFormat,
28-
Description = pack.Description ?? string.Empty,
28+
PackFormat = context.Profile?.Format ?? PublishProfileProperties.DefaultJavaFormat,
29+
Description = context.Profile?.Description.NullIfEmpty() ?? context.Project?.Description ?? string.Empty,
2930
};
3031

31-
if (pack.Tags != null) {
32-
packMeta.Description += $"\n{string.Join(' ', pack.Tags)}";
32+
if (context.Profile?.Tags != null) {
33+
packMeta.Description += $"\n{string.Join(' ', context.Profile.Tags)}";
3334
}
3435

3536
var data = new {pack = packMeta};

PixelGraph.Common/IO/Publishing/PublisherBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public virtual async Task PrepareAsync(ProjectPublishContext context, bool clean
5959
summary.Reset();
6060
if (clean) CleanDestination();
6161

62-
await PublishPackMetaAsync(context.Profile, token);
62+
await PublishPackMetaAsync(context, token);
6363

6464
content = await loader.LoadAsync(token).ToArrayAsync(token);
6565

@@ -190,7 +190,7 @@ private async Task PublishFileAsync(ProjectPublishContext packContext, string lo
190190
Logger.LogInformation("Published untracked file {destFile}.", destFile);
191191
}
192192

193-
protected abstract Task PublishPackMetaAsync(PublishProfileProperties pack, CancellationToken token);
193+
protected abstract Task PublishPackMetaAsync(ProjectPublishContext context, CancellationToken token);
194194

195195
protected virtual bool TryMapFile(in string sourceFile, out string? destinationFile)
196196
{

PixelGraph.Common/PixelGraph.Common.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,18 @@
5858
<ItemGroup>
5959
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
6060
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
61-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
61+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
6262
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
6363
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
64-
<PackageReference Include="Serilog" Version="4.0.2" />
64+
<PackageReference Include="Serilog" Version="4.2.0" />
6565
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
6666
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
67-
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
68-
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
67+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
68+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.5" />
6969
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
70-
<PackageReference Include="YamlDotNet" Version="16.1.3" />
70+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
71+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
72+
<PackageReference Include="YamlDotNet" Version="16.3.0" />
7173
</ItemGroup>
7274

7375
<ItemGroup>

PixelGraph.Rendering/PixelGraph.Rendering.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="HelixToolkit.SharpDX.Core" Version="2.25.0" />
30+
<PackageReference Include="HelixToolkit.SharpDX.Core" Version="2.26.0" />
3131
<PackageReference Include="JeremyAnsel.HLSL.Targets" Version="2.0.26" />
32+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
33+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
3234
</ItemGroup>
3335

3436
<ItemGroup>

PixelGraph.Rendering/Resources/Shaders/lib/parallax.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ static const float sqrt2 = sqrt(2.0f);
77

88
float get_parallax_length(const in float2 uv_size)
99
{
10-
return sqrt(lengthSq(uv_size) * 0.5f) * ParallaxDepth;
10+
return ParallaxDepth;// * sqrt(lengthSq(uv_size) * 0.5f);
1111
}
1212

1313
float2 get_parallax_offset(const in float3 lightT)
@@ -22,7 +22,7 @@ float2 get_parallax_offset(const in float3 lightT)
2222
float2 get_parallax_texcoord(const in float2 tex, const in float2 offsetT, out float3 shadow_tex, out float tex_depth) //, out float3 hit_normal)
2323
{
2424
const int step_count = ParallaxSamples; //(int)lerp(ParallaxSamplesMax, ParallaxSamplesMin, NoV);
25-
const float step_size = rcp(step_count);
25+
const float step_size = rcp(float(step_count));
2626
const float2 step_offset = step_size * offsetT;
2727

2828
float trace_depth = 1.0;

PixelGraph.Rendering/Resources/Shaders/pbr_null_ps.hlsl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ static const float3 absorption_factor = float3(0.0035f, 0.0004f, 0.0f);
2222

2323
float4 main(const ps_input input, const in bool face : SV_IsFrontFace) : SV_TARGET
2424
{
25-
//float2 col = tex_dielectric_brdf_lut.SampleLevel(sampler_brdf_lut, input.tex, 0);
26-
//return float4(col, 0.f, 1.f);
27-
2825
const float3 normal = normalize(input.nor);
2926
float3 tangent = normalize(input.tan);
3027
float3 bitangent = normalize(input.bin);

PixelGraph.Tests/PixelGraph.Tests.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
20-
<PackageReference Include="xunit" Version="2.9.2" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
20+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
21+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
22+
<PackageReference Include="xunit" Version="2.9.3" />
23+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
2224
<PrivateAssets>all</PrivateAssets>
2325
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2426
</PackageReference>
25-
<PackageReference Include="coverlet.collector" Version="6.0.2">
27+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2628
<PrivateAssets>all</PrivateAssets>
2729
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2830
</PackageReference>

0 commit comments

Comments
 (0)