Skip to content

Commit

Permalink
Fix failing pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lithiumtoast committed Mar 31, 2024
1 parent 6083d1d commit d244d18
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cs/production/c2ffi.Tool/Commands/Merge/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed class Startup : IDependencyInjectionStartup
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<MergeFfisCommand>();
services.AddSingleton<MergeFfisTool>();
services.AddTransient<MergeFfisTool>();
services.AddSingleton<MergeInputSanitizer>();
}
}
24 changes: 20 additions & 4 deletions src/cs/tests/c2ffi.Tests.EndToEnd.Merge/MergeFfisTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ protected MergeFfisTest()
_tool = services.GetService<MergeFfisTool>()!;
}

public CTestFfiCrossPlatform GetFfi(string relativeInputDirectoryPath)
public CTestFfiCrossPlatform GetFfi(string ffiDirectoryPath)
{
var fullInputDirectoryPath = _fileSystemHelper.GetFullDirectoryPath(relativeInputDirectoryPath);
var fullOutputFilePath = _fileSystem.Path.Combine(fullInputDirectoryPath, "../ffi-x/cross-platform.json");
RunTool(fullInputDirectoryPath, fullOutputFilePath);
var fullFfiDirectoryPath = _fileSystemHelper.GetFullDirectoryPath(ffiDirectoryPath);
try
{
_fileSystem.Directory.Delete(_fileSystem.Path.Combine(fullFfiDirectoryPath, "../ffi-x"), true);
}
catch (DirectoryNotFoundException)
{
}

var fullOutputFilePath = _fileSystem.Path.Combine(fullFfiDirectoryPath, "../ffi-x/cross-platform.json");
RunTool(fullFfiDirectoryPath, fullOutputFilePath);
return ReadFfi(fullOutputFilePath);
}

Expand All @@ -51,6 +59,14 @@ private void RunTool(string inputDirectoryPath, string outputFilePath)
_tool.Run(inputDirectoryPath, outputFilePath);
}

private void DeleteFiles(IEnumerable<string> filePaths)
{
foreach (var filePath in filePaths)
{
_file.Delete(filePath);
}
}

private IEnumerable<string> GetFfiFilePaths(string configurationFilePath)
{
var directoryPath = _path.GetDirectoryName(configurationFilePath)!;
Expand Down

0 comments on commit d244d18

Please sign in to comment.