refactor(temporal)!: cleaned up organization

This commit is contained in:
D. Moonfire 2023-01-16 13:45:59 -06:00
parent e02c56e77e
commit edda9a2773
14 changed files with 50 additions and 30 deletions

3
.envrc
View file

@ -1,2 +1,3 @@
export PATH=$PWD/scripts:$PATH
use flake || use nix
export PATH=$PWD/scripts:$PATH
export DOTNET_ROOT=$(dirname $(dirname $(which dotnet)))

View file

@ -1,4 +1,6 @@
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using CliWrap;
@ -41,14 +43,31 @@ public class CopyFilesTest : NitrideTestBase
}
// Execute the generator. This will throw if there is an exception.
await Cli.Wrap("dotnet")
.WithArguments(
x => x.Add("run")
.Add("--project")
.Add(projectFile.FullName)
.Add("--")
.Add("build"))
.ExecuteAsync();
StringBuilder output = new();
try
{
await Cli
.Wrap("dotnet")
.WithWorkingDirectory(projectFile.DirectoryName!)
.WithArguments(
argumentsBuilder => argumentsBuilder
.Add("run")
.Add("--no-build")
.Add("--")
.Add("build"))
.WithStandardOutputPipe(PipeTarget.ToStringBuilder(output))
.WithStandardErrorPipe(PipeTarget.ToStringBuilder(output))
.ExecuteAsync();
}
catch (Exception exception)
{
this.Logger.Fatal(
exception,
"There was an exception running the command:\n\n{Log:l}",
output);
throw;
}
// Make sure we have our output.
FileInfo aFile = outputDir.GetFile("a.txt");

View file

@ -1,6 +1,6 @@
using Autofac;
using MfGames.Nitride.Temporal;
using MfGames.Nitride.Temporal.Setup;
namespace MfGames.Nitride.Calendar;

View file

@ -1,6 +1,6 @@
using Autofac;
using MfGames.Nitride.Temporal;
using MfGames.Nitride.Temporal.Setup;
namespace MfGames.Nitride.Feeds;

View file

@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Nitride.Temporal</RootNamespace>
</PropertyGroup>
<PropertyGroup>
@ -11,18 +10,18 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="6.4.0"/>
<PackageReference Include="MfGames.Gallium" Version="0.3.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0"/>
<PackageReference Include="NodaTime" Version="3.1.2"/>
<PackageReference Include="NodaTime.Testing" Version="3.1.2"/>
<PackageReference Include="Serilog" Version="2.11.0"/>
<PackageReference Include="TimeSpanParserUtil" Version="1.2.0"/>
<PackageReference Include="Zio" Version="0.15.0"/>
<PackageReference Include="Autofac" Version="6.4.0" />
<PackageReference Include="MfGames.Gallium" Version="0.3.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="NodaTime" Version="3.1.2" />
<PackageReference Include="NodaTime.Testing" Version="3.1.2" />
<PackageReference Include="Serilog" Version="2.11.0" />
<PackageReference Include="TimeSpanParserUtil" Version="1.2.0" />
<PackageReference Include="Zio" Version="0.15.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MfGames.Nitride\MfGames.Nitride.csproj"/>
<ProjectReference Include="..\MfGames.Nitride\MfGames.Nitride.csproj" />
</ItemGroup>
<!-- Include the source generator -->

View file

@ -4,6 +4,7 @@ using System.Collections.Generic;
using FluentValidation;
using MfGames.Gallium;
using MfGames.Nitride.Temporal.Validators;
using NodaTime;

View file

@ -7,7 +7,7 @@ using MfGames.Nitride.Temporal.Cli;
using Serilog;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Setup;
public static class NitrideTemporalBuilderExtensions
{

View file

@ -4,7 +4,7 @@ using MfGames.Nitride.Generators;
using NodaTime;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Setup;
/// <summary>
/// Configures the temporal settings for use with `UseTemporal`.

View file

@ -1,6 +1,6 @@
using FluentValidation;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Validators;
public class CreateDateIndexesValidator : AbstractValidator<CreateDateIndexes>
{

View file

@ -1,6 +1,6 @@
using FluentValidation;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Validators;
public class FilterOutExpiredInstantValidator
: AbstractValidator<FilterOutExpiredInstant>

View file

@ -1,6 +1,6 @@
using FluentValidation;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Validators;
public class FilterOutFutureInstantValidator
: AbstractValidator<FilterOutFutureInstant>

View file

@ -1,6 +1,6 @@
using FluentValidation;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Validators;
public class SetInstantFromComponentValidator
<TComponent> : AbstractValidator<SetInstantFromComponent<TComponent>>

View file

@ -1,6 +1,6 @@
using FluentValidation;
namespace MfGames.Nitride.Temporal;
namespace MfGames.Nitride.Temporal.Validators;
public class SetInstantFromPathValidator : AbstractValidator<SetInstantFromPath>
{

View file

@ -300,11 +300,11 @@ public class CreateDateIndexesTests : TemporalTestBase
x.Get<string>(),
x.GetOptional<DateIndex>()
?.Entries.Select(a => a.Get<string>())
.OrderBy(x => x)
.OrderBy(b => b)
.ToList(),
x.GetOptional<DateIndex>()
?.Indexes.Select(a => a.Get<string>())
.OrderBy(x => x)
.OrderBy(b => b)
.ToList()))
.OrderBy(x => x.Item1)
.ToList();