refactor(temporal)!: cleaned up organization
This commit is contained in:
parent
e02c56e77e
commit
edda9a2773
14 changed files with 50 additions and 30 deletions
3
.envrc
3
.envrc
|
@ -1,2 +1,3 @@
|
||||||
export PATH=$PWD/scripts:$PATH
|
|
||||||
use flake || use nix
|
use flake || use nix
|
||||||
|
export PATH=$PWD/scripts:$PATH
|
||||||
|
export DOTNET_ROOT=$(dirname $(dirname $(which dotnet)))
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using CliWrap;
|
using CliWrap;
|
||||||
|
@ -41,14 +43,31 @@ public class CopyFilesTest : NitrideTestBase
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute the generator. This will throw if there is an exception.
|
// Execute the generator. This will throw if there is an exception.
|
||||||
await Cli.Wrap("dotnet")
|
StringBuilder output = new();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Cli
|
||||||
|
.Wrap("dotnet")
|
||||||
|
.WithWorkingDirectory(projectFile.DirectoryName!)
|
||||||
.WithArguments(
|
.WithArguments(
|
||||||
x => x.Add("run")
|
argumentsBuilder => argumentsBuilder
|
||||||
.Add("--project")
|
.Add("run")
|
||||||
.Add(projectFile.FullName)
|
.Add("--no-build")
|
||||||
.Add("--")
|
.Add("--")
|
||||||
.Add("build"))
|
.Add("build"))
|
||||||
|
.WithStandardOutputPipe(PipeTarget.ToStringBuilder(output))
|
||||||
|
.WithStandardErrorPipe(PipeTarget.ToStringBuilder(output))
|
||||||
.ExecuteAsync();
|
.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.
|
// Make sure we have our output.
|
||||||
FileInfo aFile = outputDir.GetFile("a.txt");
|
FileInfo aFile = outputDir.GetFile("a.txt");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using Autofac;
|
using Autofac;
|
||||||
|
|
||||||
using MfGames.Nitride.Temporal;
|
using MfGames.Nitride.Temporal.Setup;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Calendar;
|
namespace MfGames.Nitride.Calendar;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using Autofac;
|
using Autofac;
|
||||||
|
|
||||||
using MfGames.Nitride.Temporal;
|
using MfGames.Nitride.Temporal.Setup;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Feeds;
|
namespace MfGames.Nitride.Feeds;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<RootNamespace>Nitride.Temporal</RootNamespace>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -11,18 +10,18 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Autofac" Version="6.4.0"/>
|
<PackageReference Include="Autofac" Version="6.4.0" />
|
||||||
<PackageReference Include="MfGames.Gallium" Version="0.3.0"/>
|
<PackageReference Include="MfGames.Gallium" Version="0.3.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0"/>
|
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
|
||||||
<PackageReference Include="NodaTime" Version="3.1.2"/>
|
<PackageReference Include="NodaTime" Version="3.1.2" />
|
||||||
<PackageReference Include="NodaTime.Testing" Version="3.1.2"/>
|
<PackageReference Include="NodaTime.Testing" Version="3.1.2" />
|
||||||
<PackageReference Include="Serilog" Version="2.11.0"/>
|
<PackageReference Include="Serilog" Version="2.11.0" />
|
||||||
<PackageReference Include="TimeSpanParserUtil" Version="1.2.0"/>
|
<PackageReference Include="TimeSpanParserUtil" Version="1.2.0" />
|
||||||
<PackageReference Include="Zio" Version="0.15.0"/>
|
<PackageReference Include="Zio" Version="0.15.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\MfGames.Nitride\MfGames.Nitride.csproj"/>
|
<ProjectReference Include="..\MfGames.Nitride\MfGames.Nitride.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Include the source generator -->
|
<!-- Include the source generator -->
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
|
||||||
using MfGames.Gallium;
|
using MfGames.Gallium;
|
||||||
|
using MfGames.Nitride.Temporal.Validators;
|
||||||
|
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ using MfGames.Nitride.Temporal.Cli;
|
||||||
|
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Setup;
|
||||||
|
|
||||||
public static class NitrideTemporalBuilderExtensions
|
public static class NitrideTemporalBuilderExtensions
|
||||||
{
|
{
|
|
@ -4,7 +4,7 @@ using MfGames.Nitride.Generators;
|
||||||
|
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Setup;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Configures the temporal settings for use with `UseTemporal`.
|
/// Configures the temporal settings for use with `UseTemporal`.
|
|
@ -1,6 +1,6 @@
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Validators;
|
||||||
|
|
||||||
public class CreateDateIndexesValidator : AbstractValidator<CreateDateIndexes>
|
public class CreateDateIndexesValidator : AbstractValidator<CreateDateIndexes>
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Validators;
|
||||||
|
|
||||||
public class FilterOutExpiredInstantValidator
|
public class FilterOutExpiredInstantValidator
|
||||||
: AbstractValidator<FilterOutExpiredInstant>
|
: AbstractValidator<FilterOutExpiredInstant>
|
|
@ -1,6 +1,6 @@
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Validators;
|
||||||
|
|
||||||
public class FilterOutFutureInstantValidator
|
public class FilterOutFutureInstantValidator
|
||||||
: AbstractValidator<FilterOutFutureInstant>
|
: AbstractValidator<FilterOutFutureInstant>
|
|
@ -1,6 +1,6 @@
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Validators;
|
||||||
|
|
||||||
public class SetInstantFromComponentValidator
|
public class SetInstantFromComponentValidator
|
||||||
<TComponent> : AbstractValidator<SetInstantFromComponent<TComponent>>
|
<TComponent> : AbstractValidator<SetInstantFromComponent<TComponent>>
|
|
@ -1,6 +1,6 @@
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
|
||||||
namespace MfGames.Nitride.Temporal;
|
namespace MfGames.Nitride.Temporal.Validators;
|
||||||
|
|
||||||
public class SetInstantFromPathValidator : AbstractValidator<SetInstantFromPath>
|
public class SetInstantFromPathValidator : AbstractValidator<SetInstantFromPath>
|
||||||
{
|
{
|
|
@ -300,11 +300,11 @@ public class CreateDateIndexesTests : TemporalTestBase
|
||||||
x.Get<string>(),
|
x.Get<string>(),
|
||||||
x.GetOptional<DateIndex>()
|
x.GetOptional<DateIndex>()
|
||||||
?.Entries.Select(a => a.Get<string>())
|
?.Entries.Select(a => a.Get<string>())
|
||||||
.OrderBy(x => x)
|
.OrderBy(b => b)
|
||||||
.ToList(),
|
.ToList(),
|
||||||
x.GetOptional<DateIndex>()
|
x.GetOptional<DateIndex>()
|
||||||
?.Indexes.Select(a => a.Get<string>())
|
?.Indexes.Select(a => a.Get<string>())
|
||||||
.OrderBy(x => x)
|
.OrderBy(b => b)
|
||||||
.ToList()))
|
.ToList()))
|
||||||
.OrderBy(x => x.Item1)
|
.OrderBy(x => x.Item1)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
Reference in a new issue