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