Skip to content
This repository has been archived by the owner on Feb 8, 2025. It is now read-only.

Commit

Permalink
Commit source of SLNX 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
winscripter authored Oct 11, 2024
1 parent f718718 commit bd9bc65
Show file tree
Hide file tree
Showing 19 changed files with 1,393 additions and 15 deletions.
40 changes: 25 additions & 15 deletions Slnx.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ VisualStudioVersion = 17.10.35122.118
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4ED70E92-F679-4B86-A5B3-EC1234EA24D2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2629E79A-539B-49CE-8466-6F99FB34B6FB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Slnx", "src\Slnx\Slnx.csproj", "{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Slnx.TestConsole", "test\Slnx.TestConsole\Slnx.TestConsole.csproj", "{BF6A75A8-2A70-42AC-A84A-547CED1EF608}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{D32C2907-F140-4C3B-98A4-F5511A2C8D43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Slnx.ReadBenchmark", "benchmark\Slnx.ReadBenchmark\Slnx.ReadBenchmark.csproj", "{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Slnx.TestConsoleV2", "test\Slnx.TestConsoleV2\Slnx.TestConsoleV2.csproj", "{280DDE7C-6B42-44CF-8BE4-2EFB4106814E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Slnx.WriteBenchmark", "benchmark\Slnx.WriteBenchmark\Slnx.WriteBenchmark.csproj", "{420A3B54-9B79-41A3-82D0-7C275212B44D}"
EndProject
Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1D04ABB-EF13-4243-A653-B1BC6CB05EB8}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{280DDE7C-6B42-44CF-8BE4-2EFB4106814E} = {2629E79A-539B-49CE-8466-6F99FB34B6FB}
{BF6A75A8-2A70-42AC-A84A-547CED1EF608} = {2629E79A-539B-49CE-8466-6F99FB34B6FB}
{420A3B54-9B79-41A3-82D0-7C275212B44D} = {D32C2907-F140-4C3B-98A4-F5511A2C8D43}
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301} = {D32C2907-F140-4C3B-98A4-F5511A2C8D43}
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0} = {4ED70E92-F679-4B86-A5B3-EC1234EA24D2}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{280DDE7C-6B42-44CF-8BE4-2EFB4106814E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{280DDE7C-6B42-44CF-8BE4-2EFB4106814E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{280DDE7C-6B42-44CF-8BE4-2EFB4106814E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{280DDE7C-6B42-44CF-8BE4-2EFB4106814E}.Release|Any CPU.Build.0 = Release|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Release|Any CPU.Build.0 = Release|Any CPU
{420A3B54-9B79-41A3-82D0-7C275212B44D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{420A3B54-9B79-41A3-82D0-7C275212B44D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{420A3B54-9B79-41A3-82D0-7C275212B44D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{420A3B54-9B79-41A3-82D0-7C275212B44D}.Release|Any CPU.Build.0 = Release|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Release|Any CPU.Build.0 = Release|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -43,7 +43,17 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
= Debug|Any CPU
ny CPU.Build.0 = Release|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF6A75A8-2A70-42AC-A84A-547CED1EF608}.Release|Any CPU.Build.0 = Release|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFB1A338-7FE1-46A1-9F41-2BEF3ABBF301}.Release|Any CPU.Build.0 = Release|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D23FC02A-231A-48F1-86E3-1C6DD9D0D8C0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
29 changes: 29 additions & 0 deletions benchmark/Slnx.ReadBenchmark/Program.cs
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);
}
}
18 changes: 18 additions & 0 deletions benchmark/Slnx.ReadBenchmark/Slnx.ReadBenchmark.csproj
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>
29 changes: 29 additions & 0 deletions benchmark/Slnx.WriteBenchmark/Program.cs
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();
}
}
18 changes: 18 additions & 0 deletions benchmark/Slnx.WriteBenchmark/Slnx.WriteBenchmark.csproj
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>
29 changes: 29 additions & 0 deletions src/Slnx/DescendantConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Slnx
{
/// <summary>
/// Represents a "&lt;Configuration&gt;" 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;
}
}
}
Loading

0 comments on commit bd9bc65

Please sign in to comment.