Files
Adam Hathcock acdc486510 Cleanup (#1)
* Initial update for net8 and netstandard2

* delete more and fix test folders

* clean up changes

* format

* more clean up

* allow build script to run

* format again

* fix packing and tests

* do tests always

* fmt again
2024-06-25 15:02:20 +01:00

67 lines
1.5 KiB
C#

using GlobExpressions;
using static Bullseye.Targets;
using static SimpleExec.Command;
const string CLEAN = "clean";
const string FORMAT = "format";
const string RESTORE_TOOLS = "restore-tools";
const string RESTORE = "restore";
const string BUILD = "build";
const string TEST = "test";
const string PACK = "pack";
Target(
CLEAN,
ForEach("**/output"),
dir =>
{
IEnumerable<string> GetDirectories(string d)
{
return Glob.Directories(".", d);
}
void RemoveDirectory(string d)
{
if (Directory.Exists(d))
{
Console.WriteLine(d);
Directory.Delete(d, true);
}
}
foreach (var d in GetDirectories(dir))
{
RemoveDirectory(d);
}
}
);
Target(RESTORE_TOOLS, () => RunAsync("dotnet", "tool restore"));
Target(FORMAT, DependsOn(RESTORE_TOOLS), () => RunAsync("dotnet", "csharpier --check ."));
Target(RESTORE, () => RunAsync("dotnet", "restore Speckle.DoubleNumerics.sln --locked-mode"));
Target(BUILD, DependsOn(RESTORE), () => RunAsync("dotnet", "build Speckle.DoubleNumerics.sln -c Release --no-restore"));
Target(
TEST,
DependsOn(BUILD),
Glob.Files(".", "**/*.Tests.csproj"),
async file =>
{
await RunAsync("dotnet", $"test {file} -c Release --no-build --verbosity=normal");
}
);
Target(
PACK,
DependsOn(TEST),
() => RunAsync("dotnet", "pack Speckle.DoubleNumerics.sln -c Release -o output --no-build")
);
Target("default", DependsOn(FORMAT, TEST), () => Console.WriteLine("Done!"));
await RunTargetsAndExitAsync(args).ConfigureAwait(true);