Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.NuGet;
using Nuke.Common.Utilities.Collections;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;

[CheckBuildProjectConfigurations]

[ShutdownDotNetAfterServerBuild]
class Build : NukeBuild
{
Expand Down Expand Up @@ -68,13 +67,13 @@ public static int Main()
.Before(Test)
.Executes(() =>
{
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
EnsureCleanDirectory(ArtifactsDirectory);
EnsureCleanDirectory(DeployDirectory);
EnsureCleanDirectory(DeployDirectory / "zip");
EnsureCleanDirectory(DeployDirectory / "nuget");
EnsureCleanDirectory(OutputDirectory);
EnsureCleanDirectory(DocsOutputDirectory);
//SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(CreateOrCleanDirectory);
ArtifactsDirectory.CreateOrCleanDirectory();
DeployDirectory.CreateOrCleanDirectory();
(DeployDirectory / "zip").CreateOrCleanDirectory();
(DeployDirectory / "nuget").CreateOrCleanDirectory();
DeployDirectory.CreateOrCleanDirectory();
DocsOutputDirectory.CreateOrCleanDirectory();
});

Target Test => _ => _
Expand Down
17 changes: 10 additions & 7 deletions build/_build.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand All @@ -12,11 +12,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0" />
<PackageReference Include="Nuke.Common" Version="6.2.1" />
<PackageReference Include="Microsoft.Build" Version="18.0.2" ExcludeAssets="runtime"/>
<PackageReference Include="Microsoft.Build.Locator" Version="1.10.12" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="18.0.2" ExcludeAssets="runtime"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.0" />
<PackageReference Include="Nuke.Common" Version="9.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<RootNamespace>PicklesDoc.Pickles.CommandLine.UnitTests</RootNamespace>
<AssemblyName>PicklesDoc.Pickles.CommandLine.UnitTests</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
Expand All @@ -24,9 +24,9 @@
</PropertyGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersionInfo.cs" Link="VersionInfo.cs" />
Expand All @@ -38,13 +38,13 @@
<ProjectReference Include="..\Pickles\Pickles.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NFluent" Version="2.7.2" />
<PackageReference Include="NuGetizer" Version="0.9.1">
<PackageReference Include="NFluent" Version="3.1.0" />
<PackageReference Include="NuGetizer" Version="1.4.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.3" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.0.16" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ public void ThenCanParseLongFormArgumentsSuccessfully()
bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

Check.That(shouldContinue).IsTrue();
Check.That(configuration.FeatureFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.FromDirectoryName("features").FullName);
Check.That(configuration.OutputFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.FromDirectoryName("features-output").FullName);
Check.That(configuration.FeatureFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.New("features").FullName);
Check.That(configuration.OutputFolder.FullName).IsEqualTo(FileSystem.DirectoryInfo.New("features-output").FullName);
}

[Test]
public void ThenCanParseResultsFileWithLongFormSuccessfully()
{
FileSystem.AddFile(@"results.xml", "<xml />");
var resultPath = FileSystem.FileInfo.FromFileName("results.xml").FullName;
var resultPath = FileSystem.FileInfo.New("results.xml").FullName;
var args = new[] { @"-link-results-file=" + resultPath };

var configuration = new Configuration();
Expand All @@ -189,9 +189,9 @@ public void ThenCanParseResultsFileWithLongFormSuccessfully()
public void ThenCanParseResultsFileAsSemicolonSeparatedList()
{
FileSystem.AddFile(@"results1.xml", "<xml />");
var result1path = FileSystem.FileInfo.FromFileName("results1.xml").FullName;
var result1path = FileSystem.FileInfo.New("results1.xml").FullName;
FileSystem.AddFile(@"results2.xml", "<xml />");
var result2path = FileSystem.FileInfo.FromFileName("results2.xml").FullName;
var result2path = FileSystem.FileInfo.New("results2.xml").FullName;

var args = new[] { $"-link-results-file={result1path};{result2path}" };

Expand All @@ -210,7 +210,7 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedList()
public void ThenCanParseResultsFileAsSemicolonSeparatedListAndTestResultsFileContainsTheFirstElementOfTestResultsFiles()
{
FileSystem.AddFile("results1.xml", "<xml />");
var result1path = FileSystem.FileInfo.FromFileName("results1.xml").FullName;
var result1path = FileSystem.FileInfo.New("results1.xml").FullName;
FileSystem.AddFile("results2.xml", "<xml />");

var args = new[] { "-link-results-file=results1.xml;results2.xml" };
Expand All @@ -229,7 +229,7 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedListAndTestResultsFileCon
public void ThenCanParseResultsFileAsSemicolonSeparatedListThatStartsWithASemicolon()
{
FileSystem.AddFile(@"results1.xml", "<xml />");
var result1Path = FileSystem.FileInfo.FromFileName("results1.xml").FullName;
var result1Path = FileSystem.FileInfo.New("results1.xml").FullName;
var args = new[] { @"-link-results-file=;results1.xml" };

var configuration = new Configuration();
Expand All @@ -246,7 +246,7 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedListThatStartsWithASemico
[Test]
public void ThenCanParseResultsFileAsSemicolonSeparatedListThatEndsWithASemicolon()
{
var fileInfo = FileSystem.FileInfo.FromFileName("results1.xml");
var fileInfo = FileSystem.FileInfo.New("results1.xml");
FileSystem.AddFile(@"results1.xml", "<xml />");
var args = new[] { $"-link-results-file={fileInfo.FullName};" };

Expand All @@ -265,9 +265,9 @@ public void ThenCanParseResultsFileAsSemicolonSeparatedListThatEndsWithASemicolo
public void ThenCanParseMultipleResultsFilesWithWildCard()
{
FileSystem.AddFile("results1.xml", "<xml />");
var result1FileInfo = FileSystem.FileInfo.FromFileName("results1.xml");
var result1FileInfo = FileSystem.FileInfo.New("results1.xml");
FileSystem.AddFile("results2.xml", "<xml />");
var result2FileInfo = FileSystem.FileInfo.FromFileName("results2.xml");
var result2FileInfo = FileSystem.FileInfo.New("results2.xml");

var args = new[] { @"-link-results-file=results*.xml" };

Expand All @@ -286,9 +286,9 @@ public void ThenCanParseMultipleResultsFilesWithWildCard()
public void ThenCanParseMultipleResultsFilesWithWildCardWhereNoMatchIsExcluded()
{
FileSystem.AddFile(@"results1.xml", "<xml />");
var result1path = FileSystem.FileInfo.FromFileName("results1.xml").FullName;
var result1path = FileSystem.FileInfo.New("results1.xml").FullName;
FileSystem.AddFile(@"results2.xml", "<xml />");
var result2path = FileSystem.FileInfo.FromFileName("results2.xml").FullName;
var result2path = FileSystem.FileInfo.New("results2.xml").FullName;
FileSystem.AddFile(@"nomatch_results3.xml", "<xml />");

var args = new[] { @"-link-results-file=results*.xml" };
Expand All @@ -308,11 +308,11 @@ public void ThenCanParseMultipleResultsFilesWithWildCardWhereNoMatchIsExcluded()
public void ThenCanParseMultipleResultsFilesWithWildCardAndSemicolon()
{
FileSystem.AddFile(@"results_foo1.xml", "<xml />");
var foo1Path = FileSystem.FileInfo.FromFileName("results_foo1.xml").FullName;
var foo1Path = FileSystem.FileInfo.New("results_foo1.xml").FullName;
FileSystem.AddFile(@"results_foo2.xml", "<xml />");
var foo2Path = FileSystem.FileInfo.FromFileName("results_foo2.xml").FullName;
var foo2Path = FileSystem.FileInfo.New("results_foo2.xml").FullName;
FileSystem.AddFile(@"results_bar.xml", "<xml />");
var resultsPath = FileSystem.FileInfo.FromFileName("results_bar.xml").FullName;
var resultsPath = FileSystem.FileInfo.New("results_bar.xml").FullName;

var args = new[] { @"-link-results-file=results_foo*.xml;results_bar.xml" };

Expand Down Expand Up @@ -368,7 +368,7 @@ public void ThenNoExceptionIsThrownWhenResultsFileIsDir()
public void ThenCanParseResultsFilesWithMultipleMatchesResolvingInSingleMatch()
{
FileSystem.AddFile(@"results_foo.xml", "<xml />");
var fileInfo=FileSystem.FileInfo.FromFileName("results_foo.xml");
var fileInfo=FileSystem.FileInfo.New("results_foo.xml");

var args = new[] { $"-link-results-file={FileSystem.Path.Combine(fileInfo.Directory.FullName,"results*.xml")};*foo.xml" };

Expand Down
6 changes: 3 additions & 3 deletions src/Pickles.CommandLine/CommandLineArgumentParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public CommandLineArgumentParser(IFileSystem fileSystem)
public bool Parse(string[] args, IConfiguration configuration, TextWriter stdout)
{
var currentDirectory =
this.fileSystem.DirectoryInfo.FromDirectoryName(this.fileSystem.Directory.GetCurrentDirectory());
this.fileSystem.DirectoryInfo.New(this.fileSystem.Directory.GetCurrentDirectory());
configuration.FeatureFolder = currentDirectory;
configuration.OutputFolder = currentDirectory;

Expand All @@ -96,12 +96,12 @@ public bool Parse(string[] args, IConfiguration configuration, TextWriter stdout

if (!string.IsNullOrEmpty(this.featureDirectory))
{
configuration.FeatureFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.featureDirectory);
configuration.FeatureFolder = this.fileSystem.DirectoryInfo.New(this.featureDirectory);
}

if (!string.IsNullOrEmpty(this.outputDirectory))
{
configuration.OutputFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.outputDirectory);
configuration.OutputFolder = this.fileSystem.DirectoryInfo.New(this.outputDirectory);
}

if (!string.IsNullOrEmpty(this.testResultsFormat))
Expand Down
6 changes: 3 additions & 3 deletions src/Pickles.CommandLine/Pickles.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>PicklesDoc.Pickles.CommandLine</RootNamespace>
<AssemblyName>Pickles</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<PackAsTool>true</PackAsTool>
<ToolCommandName>pickles</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
Expand Down Expand Up @@ -73,9 +73,9 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="NDesk.Options.Core" Version="1.2.5" />
<PackageReference Include="NDesk.Options.Core" Version="1.2.8" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="NuGetizer" Version="0.9.1">
<PackageReference Include="NuGetizer" Version="1.4.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public sealed class StepDefinitions : BaseFixture /* God object antipattern */
[Given(@"I have this feature description placed in a folder '(.*)' in a file '(.*)'")]
public void GivenIHaveThisFeatureDescriptionPlacedInAFolder(string featureFolder, string featureFile, string multilineText)
{
var directoryInfo = FileSystem.DirectoryInfo.FromDirectoryName(featureFolder);
var directoryInfo = FileSystem.DirectoryInfo.New(featureFolder);
directoryInfo.Create();
var fileName = FileSystem.Path.Combine(featureFolder,featureFile);
var fileInfo = FileSystem.FileInfo.FromFileName(fileName);
var fileInfo = FileSystem.FileInfo.New(fileName);
using var writer = fileInfo.CreateText();
{
writer.Write(multilineText);
Expand All @@ -66,7 +66,7 @@ public void GivenIHaveThisFeatureDescriptionPlacedInAFolder(string featureFolder
featureNodeFactory,
FileSystem);
this.nodes =
crawler.Crawl(FileSystem.DirectoryInfo.FromDirectoryName(FileSystem.Directory.GetCurrentDirectory()),
crawler.Crawl(FileSystem.DirectoryInfo.New(FileSystem.Directory.GetCurrentDirectory()),
new ParsingReport());
}
[Given("I have this feature description")]
Expand All @@ -76,7 +76,7 @@ public void IHaveThisFeatureDescription(string featureDescription)

var feature = parser.Parse(new StringReader(featureDescription));

this.nodes = new Tree(new FeatureNode(FileSystem.DirectoryInfo.FromDirectoryName(@"output"), string.Empty, feature));
this.nodes = new Tree(new FeatureNode(FileSystem.DirectoryInfo.New(@"output"), string.Empty, feature));
}

[When(@"I generate the documentation")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Then the screen should be empty

var fileSystem = new FileSystem();
fileSystem.Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
var IFileSystemInfo = fileSystem.DirectoryInfo.FromDirectoryName(@"./");
var IFileSystemInfo = fileSystem.DirectoryInfo.New(@"./");
var configuration = new Configuration
{
OutputFolder = IFileSystemInfo
Expand Down
Loading