mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 23:01:44 +01:00
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
|
using System;
|
|||
|
using System.IO;
|
|||
|
|
|||
|
namespace Capnpc.Csharp.MsBuild.Generation
|
|||
|
{
|
|||
|
public class FilePathGenerator
|
|||
|
{
|
|||
|
public string GenerateFilePath(string projectFolder, string relativeOutputPath, string featureFileName, string generatedCodeBehindFileName)
|
|||
|
{
|
|||
|
if (projectFolder is null)
|
|||
|
{
|
|||
|
throw new ArgumentNullException(nameof(projectFolder));
|
|||
|
}
|
|||
|
|
|||
|
if (featureFileName is null)
|
|||
|
{
|
|||
|
throw new ArgumentNullException(nameof(featureFileName));
|
|||
|
}
|
|||
|
|
|||
|
if (generatedCodeBehindFileName is null)
|
|||
|
{
|
|||
|
throw new ArgumentNullException(nameof(generatedCodeBehindFileName));
|
|||
|
}
|
|||
|
|
|||
|
string featureFileFullPath = Path.GetFullPath(Path.Combine(projectFolder, relativeOutputPath ?? "", featureFileName));
|
|||
|
string featureFileDirPath = Path.GetDirectoryName(featureFileFullPath);
|
|||
|
|
|||
|
return Path.Combine(featureFileDirPath, generatedCodeBehindFileName);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|