Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2cba0cb
feat: Initial ProjectBuilders
samtrion Dec 7, 2025
96c14f8
chore: Disabled `failFast` for Matrix Build&Test
samtrion Dec 7, 2025
dce4910
chore: Removed InternalVisibileto
samtrion Dec 7, 2025
6fa8fb0
test: Extended supported TargetFrameworks
samtrion Dec 7, 2025
c643d2c
fix: Corrected the `RepositoryUrl`
samtrion Dec 7, 2025
8293616
chore: Renamed to `ITemporaryDirectoryBuilder`
samtrion Dec 7, 2025
b864d1d
test: Additional Tests for `TemporaryDirectoryBuilder`
samtrion Dec 7, 2025
9911596
fix: Updated `RepositoryUrl`
samtrion Dec 7, 2025
7e9de48
test: Added `NetEvolve.ProjectBuilders.TUnit.Tests.Integration`
samtrion Dec 7, 2025
0bed5c0
docs: Added documentation
samtrion Dec 7, 2025
f52d206
test: Added `GlobalJsonBuilderTests`
samtrion Dec 7, 2025
525d325
fix(solution): Wrong project reference removed before
samtrion Dec 7, 2025
d224451
test: Added Tests for `GlobalJsonBuilder`
samtrion Dec 7, 2025
75d3174
chore: Updated Constants
samtrion Dec 7, 2025
0f1a2c9
test: Extended Integration tests
samtrion Dec 7, 2025
2938884
docs: Updated XML Summaries
samtrion Dec 7, 2025
64eadeb
fix: Use Matrix again
samtrion Dec 7, 2025
5a8555b
fix: Removed Template files
samtrion Dec 7, 2025
71df298
fix: Removed Summary warnings
samtrion Dec 7, 2025
5b44e2e
fix: Removed unused namespaces
samtrion Dec 7, 2025
b32ba10
fix: Synced Namespaces
samtrion Dec 7, 2025
bfa3c7f
test: Extended Unit tests
samtrion Dec 7, 2025
60aede4
fix: Solved Warnings
samtrion Dec 8, 2025
cc21aac
test: Extended tests
samtrion Dec 8, 2025
e1ea85d
chore: Set RootNamespace
samtrion Dec 8, 2025
ae45081
chore: Normalized naming
samtrion Dec 8, 2025
efba99c
test: Extended Tests, which adding a PackageReference
samtrion Dec 8, 2025
344c65f
test: Added Property `Aliases` to `IReference`
samtrion Dec 8, 2025
35cb3c3
docs: Added missing XML Summaries
samtrion Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ indent_size = 4
generated_code = true

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,nativeproj,locproj}]
[*.{slnx,csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,nativeproj,locproj}]
indent_size = 2

# Xml build files
Expand Down
33 changes: 0 additions & 33 deletions .github/template-sync.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ jobs:
all:
if: github.run_id != 1
name: Build & Tests
uses: dailydevops/pipelines/.github/workflows/build-dotnet-single.yml@cb37352bc6f2f8b723d966d5d879625d3dd5413b # 1.3.13
uses: dailydevops/pipelines/.github/workflows/build-dotnet-matrix.yml@cb37352bc6f2f8b723d966d5d879625d3dd5413b # 1.3.13
with:
disableTestsOnLinux: false
disableTestsOnMacOs: false
disableTestsOnWindows: false
dotnetLogging: ${{ inputs.dotnet-logging }}
dotnetVersion: ${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}
failFast: false
solution: ./ProjectBuilders.slnx
secrets: inherit
27 changes: 0 additions & 27 deletions .github/workflows/template-sync.yml

This file was deleted.

15 changes: 8 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project>
<PropertyGroup Label="Package settings">
<Title>$(MSBuildProjectName)</Title>
<Description></Description>
<RepositoryUrl></RepositoryUrl>
<PackageProjectUrl></PackageProjectUrl>
<Description>Allows you to create a temporary .NET project with all possible settings and few bells and whistles.</Description>
<RepositoryUrl>https://github.com/dailydevops/projectbuilders.git</RepositoryUrl>
<PackageProjectUrl>https://github.com/dailydevops/projectbuilders</PackageProjectUrl>
<PackageReleaseNotes>$(RepositoryUrl)/releases</PackageReleaseNotes>
<PackageTags></PackageTags>
<CopyrightYearStart>2024</CopyrightYearStart>
<PackageTags>test;projectbuilder</PackageTags>
<CopyrightYearStart>2025</CopyrightYearStart>
</PropertyGroup>

<PropertyGroup>
<!-- Workaround, until https://github.com/GitTools/GitVersion/pull/4206 is released -->
<GitVersionTargetFramework>net8.0</GitVersionTargetFramework>
<ProjectTargetFrameworks>net8.0;net9.0;net10.0</ProjectTargetFrameworks>
<TestTargetFrameworks>net8.0;net9.0;net10.0</TestTargetFrameworks>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.4.81" />
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.16.1.129956" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="CliWrap" Version="3.10.0" />
<PackageVersion Include="NetEvolve.Arguments" Version="2.0.17" />
<PackageVersion Include="NetEvolve.Extensions.TUnit" Version="3.2.3" />
<PackageVersion Include="TUnit" Version="1.5.6" />
<PackageVersion Include="TUnit.Core" Version="1.5.6" />
<PackageVersion Include="Verify.ParametersHashing" Version="1.0.0" />
<PackageVersion Include="Verify.TUnit" Version="31.8.0" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.1" />
</ItemGroup>
</Project>
30 changes: 30 additions & 0 deletions ProjectBuilders.slnx
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".commitlintrc" />
<File Path=".csharpierignore" />
<File Path=".editorconfig" />
<File Path=".filenesting.json" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path=".mcp.json" />
<File Path="AGENTS.md" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="Directory.Solution.props" />
<File Path="GitVersion.yml" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="logo.png" />
<File Path="nuget.config" />
<File Path="README.md" />
<File Path="renovate.json" />
<File Path="testEnvironments.json" />
</Folder>
<Folder Name="/src/">
<Project Path="src/NetEvolve.ProjectBuilders.TUnit/NetEvolve.ProjectBuilders.TUnit.csproj" />
<Project Path="src/NetEvolve.ProjectBuilders.XUnit/NetEvolve.ProjectBuilders.XUnit.csproj" />
<Project Path="src/NetEvolve.ProjectBuilders/NetEvolve.ProjectBuilders.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/NetEvolve.ProjectBuilders.Tests.Unit/NetEvolve.ProjectBuilders.Tests.Unit.csproj" />
<Project Path="tests/NetEvolve.ProjectBuilders.TUnit.Tests.Integration/NetEvolve.ProjectBuilders.TUnit.Tests.Integration.csproj" />
</Folder>
</Solution>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(ProjectTargetFrameworks)</TargetFrameworks>
<RootNamespace>NetEvolve.ProjectBuilders</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TUnit.Core" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetEvolve.ProjectBuilders\NetEvolve.ProjectBuilders.csproj" />
</ItemGroup>
</Project>
89 changes: 89 additions & 0 deletions src/NetEvolve.ProjectBuilders.TUnit/TemporaryDirectory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
namespace NetEvolve.ProjectBuilders;

using System.IO;
using System.Threading;
using System.Threading.Tasks;
using NetEvolve.ProjectBuilders.Abstractions;
using NetEvolve.ProjectBuilders.Builders;
using TUnit.Core.Interfaces;

/// <summary>
/// Represents a temporary directory that is automatically created and cleaned up for TUnit tests.
/// </summary>
/// <remarks>
/// <para>
/// This class serves as a TUnit-specific adapter around <see cref="TemporaryDirectoryBuilder"/>
/// to provide seamless integration with TUnit's test lifecycle management. It implements both
/// <see cref="IAsyncInitializer"/> for automatic initialization and <see cref="IAsyncDisposable"/>
/// for automatic cleanup.
/// </para>
/// <para>
/// The temporary directory is automatically:
/// <list type="bullet">
/// <item><description>Created before test execution via <see cref="IAsyncInitializer.InitializeAsync"/></description></item>
/// <item><description>Cleaned up and deleted after test completion via <see cref="DisposeAsync"/></description></item>
/// <item><description>Placed in a unique location to avoid conflicts between parallel test executions</description></item>
/// </list>
/// </para>
/// <para>
/// Provides directory and file management methods through <see cref="ITemporaryDirectoryBuilder"/>,
/// including directory creation, file creation, and path resolution.
/// </para>
/// <para>
/// Usage example in TUnit tests:
/// <code>
/// [ClassDataSource&lt;TemporaryDirectory&gt;]
/// public class MyTests(TemporaryDirectory directory)
/// {
/// [Test]
/// public async Task TestCreateFile()
/// {
/// using var stream = directory.CreateFile("test.txt");
/// stream.WriteAsync(new byte[] { 1, 2, 3 }, 0, 3);
///
/// string fullPath = directory.GetFilePath("test.txt");
/// Assert.That(File.Exists(fullPath));
/// }
///
/// [Test]
/// public void TestCreateDirectory()
/// {
/// var subDir = directory.CreateDirectory("subdirectory");
/// Assert.That(Directory.Exists(Path.Combine(directory.FullPath, "subdirectory")));
/// }
/// }
/// </code>
/// </para>
/// </remarks>
/// <seealso cref="IAsyncInitializer"/>
/// <seealso cref="IAsyncDisposable"/>
/// <seealso cref="TemporaryDirectoryBuilder"/>
public sealed class TemporaryDirectory : ITemporaryDirectoryBuilder, IAsyncInitializer
{
private readonly TemporaryDirectoryBuilder _directory = new();

/// <inheritdoc cref="IObjectBuilder.FullPath"/>
public string FullPath => _directory.FullPath;

/// <inheritdoc cref="IObjectBuilder.CreateAsync(CancellationToken)"/>
public ValueTask CreateAsync(CancellationToken cancellationToken = default) =>
_directory.CreateAsync(cancellationToken);

/// <inheritdoc cref="ISubdirectoryBuilder.CreateDirectory(string)"/>
public ISubdirectoryBuilder CreateDirectory(string directoryName) => _directory.CreateDirectory(directoryName);

/// <inheritdoc cref="ISubdirectoryBuilder.CreateFile(string)"/>
public Stream CreateFile(string fileName) => _directory.CreateFile(fileName);

/// <inheritdoc/>
public async Task DisposeAsync() => await _directory.DisposeAsync().ConfigureAwait(false);

/// <inheritdoc cref="ISubdirectoryBuilder.GetFilePath(string)"/>
public string GetFilePath(string fileName) => _directory.GetFilePath(fileName);

/// <inheritdoc/>
async Task IAsyncInitializer.InitializeAsync() => await _directory.CreateAsync().ConfigureAwait(false);

/// <inheritdoc cref="IAsyncDisposable.DisposeAsync" />
async ValueTask IAsyncDisposable.DisposeAsync() => await DisposeAsync().ConfigureAwait(false);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(ProjectTargetFrameworks)</TargetFrameworks>
<RootNamespace>NetEvolve.ProjectBuilders</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.v3.extensibility.core" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetEvolve.ProjectBuilders\NetEvolve.ProjectBuilders.csproj" />
</ItemGroup>
</Project>
125 changes: 125 additions & 0 deletions src/NetEvolve.ProjectBuilders.XUnit/TemporaryDirectoryFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
namespace NetEvolve.ProjectBuilders;

using System.IO;
using System.Threading;
using System.Threading.Tasks;
using NetEvolve.ProjectBuilders.Abstractions;
using NetEvolve.ProjectBuilders.Builders;
using Xunit;

/// <summary>
/// Represents a temporary directory fixture that is automatically created and cleaned up for xUnit tests.
/// </summary>
/// <remarks>
/// <para>
/// This class serves as an xUnit-specific adapter around <see cref="TemporaryDirectoryBuilder"/>
/// to provide seamless integration with xUnit's test lifecycle management through the fixture pattern.
/// It implements <see cref="IAsyncLifetime"/> for automatic initialization and cleanup.
/// </para>
/// <para>
/// The temporary directory is automatically:
/// <list type="bullet">
/// <item><description>Created before test execution via <see cref="IAsyncLifetime.InitializeAsync"/></description></item>
/// <item><description>Cleaned up and deleted after test completion via <see cref="IAsyncDisposable.DisposeAsync"/></description></item>
/// <item><description>Placed in a unique location to avoid conflicts between parallel test executions</description></item>
/// </list>
/// </para>
/// <para>
/// Provides directory and file management methods through <see cref="ITemporaryDirectoryBuilder"/>,
/// including directory creation, file creation, and path resolution.
/// </para>
/// <para>
/// Works with xUnit class fixtures and collection fixtures for flexible test lifecycle management.
/// </para>
/// <para>
/// Class fixture usage example:
/// <code>
/// public class MyTests : IClassFixture&lt;TemporaryDirectoryFixture&gt;
/// {
/// private readonly TemporaryDirectoryFixture _directory;
///
/// public MyTests(TemporaryDirectoryFixture directory)
/// {
/// _directory = directory;
/// }
///
/// [Fact]
/// public void TestCreateFile()
/// {
/// // Directory is automatically initialized before this test runs
/// using var stream = _directory.CreateFile("test.txt");
/// var fullPath = _directory.GetFilePath("test.txt");
/// Assert.True(File.Exists(fullPath));
/// // Directory is automatically cleaned up after this test completes
/// }
/// }
/// </code>
/// </para>
/// <para>
/// Collection fixture usage example:
/// <code>
/// [CollectionDefinition("Temporary Directory Collection")]
/// public class TemporaryDirectoryCollection : ICollectionFixture&lt;TemporaryDirectoryFixture&gt;
/// {
/// }
///
/// [Collection("Temporary Directory Collection")]
/// public class MyTests
/// {
/// private readonly TemporaryDirectoryFixture _directory;
///
/// public MyTests(TemporaryDirectoryFixture directory)
/// {
/// _directory = directory;
/// }
///
/// [Fact]
/// public void TestOne()
/// {
/// // Directory is shared across all tests in the collection
/// using var stream = _directory.CreateFile("test1.txt");
/// }
///
/// [Fact]
/// public void TestTwo()
/// {
/// // Same directory instance from TestOne
/// using var stream = _directory.CreateFile("test2.txt");
/// }
/// }
/// </code>
/// </para>
/// </remarks>
/// <seealso cref="IClassFixture{TFixture}"/>
/// <seealso cref="ICollectionFixture{TFixture}"/>
/// <seealso cref="IAsyncLifetime"/>
/// <seealso cref="TemporaryDirectoryBuilder"/>
public sealed class TemporaryDirectoryFixture : ITemporaryDirectoryBuilder, IAsyncLifetime
{
private readonly TemporaryDirectoryBuilder _directory = new();

/// <inheritdoc cref="IObjectBuilder.FullPath"/>
public string FullPath => _directory.FullPath;

/// <inheritdoc cref="IObjectBuilder.CreateAsync(CancellationToken)"/>
public ValueTask CreateAsync(CancellationToken cancellationToken = default) =>
_directory.CreateAsync(cancellationToken);

/// <inheritdoc cref="ISubdirectoryBuilder.CreateDirectory(string)"/>
public ISubdirectoryBuilder CreateDirectory(string directoryName) => _directory.CreateDirectory(directoryName);

/// <inheritdoc cref="ISubdirectoryBuilder.CreateFile(string)"/>
public Stream CreateFile(string fileName) => _directory.CreateFile(fileName);

/// <inheritdoc/>
public async Task DisposeAsync() => await _directory.DisposeAsync().ConfigureAwait(false);

/// <inheritdoc cref="ISubdirectoryBuilder.GetFilePath(string)"/>
public string GetFilePath(string fileName) => _directory.GetFilePath(fileName);

/// <inheritdoc/>
async ValueTask IAsyncLifetime.InitializeAsync() => await _directory.CreateAsync().ConfigureAwait(false);

/// <inheritdoc cref="IAsyncDisposable.DisposeAsync" />
async ValueTask IAsyncDisposable.DisposeAsync() => await DisposeAsync().ConfigureAwait(false);
}
Loading