This repository has been archived by the owner on Feb 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f718718
commit bd9bc65
Showing
19 changed files
with
1,393 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Running; | ||
using Slnx; | ||
|
||
BenchmarkRunner.Run<Benchie>(); | ||
|
||
[MemoryDiagnoser] | ||
public class Benchie | ||
{ | ||
private const string Input = """ | ||
<Solution> | ||
<Folder Name="Solution Items"> | ||
<File Path="File1.cs" /> | ||
<File Path=".editorconfig" /> | ||
<Project Path="File.csproj" /> | ||
<Folder Name="Test"> | ||
<File Path=".editorconfig" /> | ||
<File Path="data.cs" /> | ||
</Folder> | ||
</Folder> | ||
</Solution> | ||
"""; | ||
|
||
[Benchmark] | ||
public void ReadBenchie() | ||
{ | ||
_ = SlnxModel.Load(Input); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Slnx\Slnx.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Running; | ||
using Slnx; | ||
|
||
BenchmarkRunner.Run<Benchie>(); | ||
|
||
[MemoryDiagnoser] | ||
public class Benchie | ||
{ | ||
[Benchmark] | ||
public void WriteBenchie() | ||
{ | ||
var factory = new SlnxFactory(); | ||
|
||
var folder = new Folder("Solution Items"); | ||
folder.AddProjectWithPathOnly("./CSharp/CSharp.csproj"); | ||
folder.AddProjectWithPathOnly("./VB.NET/VB.NET.vbproj"); | ||
folder.AddProject(new Project("./DockerCompose/DockerCompose.dcproj", type: null, config: new(solution: "*|*", project: "*|*|Deploy"))); | ||
var moreFolders = new Folder("C++"); | ||
moreFolders.AddFiles(["util.cpp", "util.h", "data.cc", "data.h"]); | ||
folder.AddFiles(["File1.cs", "File2.cs"]); | ||
|
||
factory.AddFolder(folder); | ||
factory.AddProjectWithPathOnly("Slnx/Slnx.csproj"); | ||
factory.AddProjectWithPathOnly("App/App.shproj"); | ||
|
||
_ = factory.AsModel().Store(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Slnx\Slnx.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace Slnx | ||
{ | ||
/// <summary> | ||
/// Represents a "<Configuration>" like tag. | ||
/// </summary> | ||
public class DescendantConfiguration | ||
{ | ||
/// <summary> | ||
/// Solution where this configuration applies to. | ||
/// </summary> | ||
public string? Solution { get; init; } | ||
|
||
/// <summary> | ||
/// Project where this configuration applies to. | ||
/// </summary> | ||
public string? Project { get; init; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DescendantConfiguration" /> class. | ||
/// </summary> | ||
/// <param name="solution">Solution where this configuration applies to.</param> | ||
/// <param name="project">Project where this configuration applies to.</param> | ||
public DescendantConfiguration(string? solution, string? project) | ||
{ | ||
Solution = solution; | ||
Project = project; | ||
} | ||
} | ||
} |
Oops, something went wrong.