opentelemetry-dotnet-instru.../build/nuke/Build.Steps.Linux.cs

63 lines
2.0 KiB
C#

using Nuke.Common;
using Nuke.Common.IO;
using static Nuke.Common.EnvironmentInfo;
using static Nuke.Common.IO.FileSystemTasks;
partial class Build
{
Target CompileNativeSrcLinux => _ => _
.Unlisted()
.After(CompileManagedSrc)
.OnlyWhenStatic(() => IsLinux)
.Executes(() =>
{
var buildDirectory = NativeProfilerProject.Directory / "build";
EnsureExistingDirectory(buildDirectory);
CMake.Value(
arguments: "../ -DCMAKE_BUILD_TYPE=Release",
workingDirectory: buildDirectory);
Make.Value(workingDirectory: buildDirectory);
});
Target CompileNativeTestsLinux => _ => _
.Unlisted()
.After(CompileNativeSrc)
.OnlyWhenStatic(() => IsLinux)
.Executes(() =>
{
// TODO: Compile Linux native tests
Logger.Error("Linux native tests are currently not supported.");
});
Target PublishNativeProfilerLinux => _ => _
.Unlisted()
.OnlyWhenStatic(() => IsLinux)
.After(CompileNativeSrc, PublishManagedProfiler)
.Executes(() =>
{
// copy createLogPath.sh
CopyFileToDirectory(
RootDirectory / "build" / "artifacts" / "createLogPath.sh",
TracerHomeDirectory,
FileExistsPolicy.Overwrite);
// Copy Native file
CopyFileToDirectory(
NativeProfilerProject.Directory / "build" / "bin" / $"{NativeProfilerProject.Name}.so",
TracerHomeDirectory,
FileExistsPolicy.Overwrite);
});
Target RunNativeTestsLinux => _ => _
.Unlisted()
.After(CompileNativeSrcLinux)
.After(CompileNativeTestsLinux)
.OnlyWhenStatic(() => IsLinux)
.Executes(() =>
{
// TODO: Run Linux native tests
Logger.Error("Linux native tests are currently not supported.");
});
}