Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Terrabuild.UI/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const App = () => {
const [buildRunning, setBuildRunning] = useState(false);
const [forceBuild, setForceBuild] = useState(false);
const [retryBuild, setRetryBuild] = useState(false);
const [logBuild, setLogBuild] = useState(false);
const [debugBuild, setDebugBuild] = useState(false);
const [parallelism, setParallelism] = useState("");
const [engine, setEngine] = useState("default");
const [configuration, setConfiguration] = useState("");
Expand Down Expand Up @@ -616,6 +618,8 @@ const App = () => {
parallelism: parallel && parallel > 0 ? parallel : undefined,
force: forceBuild,
retry: retryBuild,
log: logBuild ? true : undefined,
debug: debugBuild ? true : undefined,
configuration: configValue.length > 0 ? configValue : undefined,
environment: envValue.length > 0 ? envValue : undefined,
engine: engineValue,
Expand Down Expand Up @@ -914,6 +918,10 @@ const App = () => {
retryBuild={retryBuild}
onForceBuildChange={setForceBuild}
onRetryBuildChange={setRetryBuild}
logBuild={logBuild}
onLogBuildChange={setLogBuild}
debugBuild={debugBuild}
onDebugBuildChange={setDebugBuild}
projects={projects}
selectedProjects={selectedProjects}
onProjectsChange={setSelectedProjects}
Expand Down
23 changes: 23 additions & 0 deletions src/Terrabuild.UI/src/components/BuildControlsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ type BuildControlsPanelProps = {
retryBuild: boolean;
onForceBuildChange: (checked: boolean) => void;
onRetryBuildChange: (checked: boolean) => void;
logBuild: boolean;
onLogBuildChange: (checked: boolean) => void;
debugBuild: boolean;
onDebugBuildChange: (checked: boolean) => void;
projects: ProjectInfo[];
selectedProjects: string[];
onProjectsChange: (values: string[]) => void;
Expand All @@ -58,6 +62,10 @@ const BuildControlsPanel = ({
retryBuild,
onForceBuildChange,
onRetryBuildChange,
logBuild,
onLogBuildChange,
debugBuild,
onDebugBuildChange,
projects,
selectedProjects,
onProjectsChange,
Expand Down Expand Up @@ -116,6 +124,13 @@ const BuildControlsPanel = ({
}
}}
/>
<Checkbox
label="Log"
checked={logBuild}
onChange={(event) => {
onLogBuildChange(event.currentTarget.checked);
}}
/>
</Group>

<Accordion
Expand Down Expand Up @@ -206,6 +221,14 @@ const BuildControlsPanel = ({
}
}}
/>

<Checkbox
label="Debug"
checked={debugBuild}
onChange={(event) =>
onDebugBuildChange(event.currentTarget.checked)
}
/>
</Stack>
</Accordion.Panel>
</Accordion.Item>
Expand Down
13 changes: 12 additions & 1 deletion src/Terrabuild/Web/GraphServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type BuildRequest = {
Parallelism: int option
Force: bool option
Retry: bool option
Log: bool option
Debug: bool option
Engine: string option
Configuration: string option
Environment: string option
Expand Down Expand Up @@ -237,8 +239,17 @@ let private createBuildCommand (workspace: string) (request: BuildRequest) =
| _ -> ""
let forceArg = if request.Force |> Option.defaultValue false then " -f" else ""
let retryArg = if request.Retry |> Option.defaultValue false then " -r" else ""
let logArg = if request.Log |> Option.defaultValue false then "--log" else ""
let debugArg = if request.Debug |> Option.defaultValue false then "--debug" else ""
let prefix =
[ logArg; debugArg ]
|> List.filter (fun value -> value <> "")
|> String.join " "
let baseArgs =
$"run {targets} -w \"{workspace}\"{projectArgs}{parallelArg}{configArg}{environmentArg}{engineArg}{forceArg}{retryArg}"
if prefix = "" then
$"run {targets} -w \"{workspace}\"{projectArgs}{parallelArg}{configArg}{environmentArg}{engineArg}{forceArg}{retryArg}"
else
$"{prefix} run {targets} -w \"{workspace}\"{projectArgs}{parallelArg}{configArg}{environmentArg}{engineArg}{forceArg}{retryArg}"
if isDotnetHost exePath then
exePath, $"\"{assemblyPath}\" {baseArgs}"
else
Expand Down