-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from EAVFW/tst/docs-assembly-xml
feat: Utilize path globbing to find assemblies
- Loading branch information
Showing
4 changed files
with
44 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace EAVFW.Extensions.Docs.Extractor | ||
{ | ||
public struct PluginInfo | ||
{ | ||
public PluginInfo(DirectoryInfo rootPath, FileInfo assemblyPath, string configuration, string framework) | ||
public PluginInfo(DirectoryInfo rootPath, FileInfo assemblyPath) | ||
{ | ||
RootPath = !rootPath.Exists | ||
? throw new ArgumentException($"Directory {nameof(rootPath)} does not exists") | ||
: rootPath; | ||
var basePath = rootPath.Parent; | ||
var search = rootPath.Name; | ||
|
||
if (rootPath.FullName.Contains("**")) | ||
{ | ||
basePath = new DirectoryInfo(rootPath.FullName.Split("**").First()); | ||
search = rootPath.FullName[basePath.FullName.Length..]; | ||
} | ||
else if (!rootPath.FullName.Contains('*')) | ||
{ | ||
throw new ArgumentException("Probing path mu"); | ||
} | ||
|
||
Search = search; | ||
RootPath = !(basePath?.Exists ?? false) | ||
? throw new ArgumentException($"Directory {basePath.FullName} does not exists") | ||
Check warning on line 26 in src/EAVFW.Extensions.Docs.Extractor/Plugin/PluginInfo.cs GitHub Actions / Releasing
|
||
: basePath; | ||
|
||
AssemblyPath = !assemblyPath.Exists | ||
? throw new ArgumentException($"File {nameof(assemblyPath)} does not exists") | ||
: assemblyPath; | ||
|
||
Configuration = string.IsNullOrWhiteSpace(configuration) | ||
? throw new ArgumentNullException(configuration) | ||
: configuration; | ||
Framework = string.IsNullOrWhiteSpace(framework) ? throw new ArgumentNullException(framework) : framework; | ||
} | ||
|
||
public DirectoryInfo RootPath { get; } | ||
public string Search { get; } | ||
public FileInfo AssemblyPath { get; } | ||
public string Configuration { get; } | ||
public string Framework { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters