Files
Michele Bastione d1a19c934d Separating project into different assemblies (#828)
* Separating into 3 assemblies, changing namespaces, renaming main APIs, adding Directory.Build.props, and general refactoring

* Rebasing, fixing merge conflicts and updating workflows

* Made core and csv projects fully independent

Moving importer, exporter and templater classes into core project and making them extensible, changing project names, fixing directory.build.props dependency warnings, turning solution file to slnx format, adding (basic) async implementation of MiniExcelDataReader

* Reverting to standard .sln solution file to fix CodeQL analysis

* Codeql workflow fixes for new slnx solution format

* Added global usings

* Updating directory.build.props target framework after rebasing

* Removing facade assembly, renaming MiniExcel.Core project to MiniExcel

* Added some more global usings

* Separate CSV test cases

* Changing MiniExcelTests project name to MiniExcel.Tests

* Fixing commit mistake

* Adjusted csv test namespaces

* Introduced extensible providers for exporter, importer and templater

* Added public api for applying a template from a template stream

* Added assembly for legacy methods

* Fixing build errors

* Moved the public api under relevant namespace, changed version from beta to preview

* Removing warning suppressions and adding a check on seekable stream template for SaveAsByTemplate method

* Renamed API methods deleting Excel and Csv suffixes for simplicity

Also moved a few tests and test sections from the main testing assembly to the csv testing assembly

* Changed namespaces .Api to .Providers in both main and csv assemblies

* Added Directory.Packages.props file and moved package metadata content to Directory.Build.props

* Reintroduced facade assembly containing legacy code

- Renamed MiniExcel to MiniExcel.Core again
- Added different packages titles and ids for the assemblies
- Renamed the providers back to Api but simplified namespaces

* Fixed accidentally adding old tests not part of the solution

* Adjusting legacy namespaces and adding old attributes signatures

* Renamed some methods and properties

---------

Co-authored-by: Victor Irzak <victor.irzak@zomp.com>
2025-08-04 09:18:58 +08:00

28 lines
921 B
C#

using BenchmarkDotNet.Running;
using MiniExcelLib.Benchmarks;
using MiniExcelLib.Benchmarks.BenchmarkSections;
if (Environment.GetEnvironmentVariable("BenchmarkMode") == "Automatic")
{
var section = Environment.GetEnvironmentVariable("BenchmarkSection");
var benchmark = section?.ToLowerInvariant().Trim() switch
{
"query" => typeof(QueryExcelBenchmark),
"create" => typeof(CreateExcelBenchmark),
"template" => typeof(TemplateExcelBenchmark),
_ => throw new ArgumentException($"Benchmark section {section} does not exist")
};
BenchmarkRunner.Run(benchmark, BenchmarkConfig.Default, args);
}
else
{
BenchmarkSwitcher
.FromTypes(
[
typeof(QueryExcelBenchmark),
typeof(CreateExcelBenchmark),
typeof(TemplateExcelBenchmark)
])
.Run(args, BenchmarkConfig.Default);
}