Skip to content

Build commands for executable resources #8872

Closed Answered by michaelwildvarian
michaelwildvarian asked this question in Q&A
Discussion options

You must be logged in to vote

To answer myself, something like this does it:

var builder = DistributedApplication.CreateBuilder(args);
var cmakeConfigure = builder
  .AddExecutable(
    "CMakeConfigure",
    "cmake",
    "relative/path/to/dir",
    "-S", ".",
    "-B", "relative/path/to/other/dir",
    "-G", "Ninja");
var cmakeBuild = builder
  .AddExecutable(
    "CMakeBuild",
    "cmake",
    "relatvie/path/to/dir",
    "--build", "relative/path/to/other/dir",
    "--target", "foo")
  .WaitForCompletion(cmakeConfigure);
var foo = builder
  .AddExecutable(
    "foo",
    "relative/path/to/other/dir/path/to/foo",
    "path/to/work/dir")
  .WaitForCompletion(cmakeBuild);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by michaelwildvarian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant