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
6 changes: 4 additions & 2 deletions src/Terrabuild.Common/Ansi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let cursorHome = "\r"
let csi (x: int) = $"{CSI}{x}m"

module Emojis =
let info = "ℹ️"
let crossmark = "✘"
let checkmark = "✔"
let party = "🎉"
Expand All @@ -30,14 +31,14 @@ module Emojis =
let poop = "💩"
let skull = "☠️"
let noentry = "⛔️"
let cyclone = "🌀"
let cyclone = ""
let prohibited = "🚫"
let gear = "⚙️"
let clockwise = "↻"
let bang = "!"
let recycle = "♻︎"
let log = "𝍌"
let rightarrow = ""
let arrow = ""
let brain = "🧠"
let sun_cloud = "🌤️"
let think = "🤔"
Expand All @@ -51,6 +52,7 @@ module Emojis =
let coffee = "☕️"
let construction = "🚧"
let tombstone = "🪦"
let unicorn = "🦄"

module Styles =
let reset = csi 0
Expand Down
5 changes: 1 addition & 4 deletions src/Terrabuild/Core/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ type Restorable(action: unit -> unit, dependencies: Restorable list) =

let run (options: ConfigOptions.Options) (cache: Cache.ICache) (api: Contracts.IApiClient option) (notification: IBuildNotification) (graph: GraphDef.Graph) =
let startedAt = DateTime.UtcNow
let targets = options.Targets |> String.join " "
$"{Ansi.Emojis.rocket} Running targets [{targets}]" |> Terminal.writeLine

$" {Ansi.Styles.green}{Ansi.Emojis.checkmark}{Ansi.Styles.reset} {graph.Nodes.Count} tasks to build" |> Terminal.writeLine
$"{Ansi.Emojis.rocket} Processing tasks" |> Terminal.writeLine

notification.BuildStarted graph
api |> Option.iter (fun api -> api.StartBuild())
Expand Down
5 changes: 3 additions & 2 deletions src/Terrabuild/Core/Builder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa
let startedAt = DateTime.UtcNow
Log.Debug("===== [Graph Build] =====")

$"{Ansi.Emojis.gear} Building graph" |> Terminal.writeLine
$"{Ansi.Emojis.construction} Constructing graph" |> Terminal.writeLine

let processedNodes = ConcurrentDictionary<string, bool>()
let allNodes = ConcurrentDictionary<string, Node>()
Expand Down Expand Up @@ -162,7 +162,8 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa
let buildDuration = endedAt - startedAt
Log.Debug("Graph Build: {duration}", buildDuration)

$" {Ansi.Styles.green}{Ansi.Emojis.checkmark}{Ansi.Styles.reset} {allNodes.Count} tasks" |> Terminal.writeLine
$" {Ansi.Styles.green}{Ansi.Emojis.arrow}{Ansi.Styles.reset} {allNodes.Count} nodes" |> Terminal.writeLine
$" {Ansi.Styles.green}{Ansi.Emojis.arrow}{Ansi.Styles.reset} {rootNodes.Count} root nodes" |> Terminal.writeLine

{ Graph.Nodes = allNodes |> Map.ofDict
Graph.RootNodes = rootNodes }
29 changes: 16 additions & 13 deletions src/Terrabuild/Core/Configuration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -556,19 +556,22 @@ let private finalizeProject projectDir evaluationContext (projectDef: LoadedProj


let read (options: ConfigOptions.Options) =
$"{Ansi.Emojis.box} Reading {options.Configuration} configuration" |> Terminal.writeLine

if options.Force then
$" {Ansi.Styles.yellow}{Ansi.Emojis.bang}{Ansi.Styles.reset} force build requested" |> Terminal.writeLine
else
if options.Retry then
$" {Ansi.Styles.yellow}{Ansi.Emojis.bang}{Ansi.Styles.reset} retry build requested" |> Terminal.writeLine

if options.WhatIf then
$" {Ansi.Styles.yellow}{Ansi.Emojis.bang}{Ansi.Styles.reset} whatif mode requested" |> Terminal.writeLine

options.Run
|> Option.iter (fun run -> $" {Ansi.Styles.green}{Ansi.Emojis.checkmark}{Ansi.Styles.reset} source control is {run.Name}" |> Terminal.writeLine)
let configInfos =
let targets = options.Targets |> String.join " "
let labels = options.Labels |> Option.map (fun labels -> labels |> String.join " ")
let warningConfig = [
if options.Force then "force"
elif options.Retry then "retry"
if options.WhatIf then "whatif" ] |> String.join(" ")
[
if warningConfig |> String.IsNullOrWhiteSpace |> not then $"Build flags [{warningConfig}]"
if options.Run.IsSome then $"Source control {options.Run.Value.Name}"
if options.Configuration.IsSome then $"Configuration {options.Configuration.Value}"
$"Targets [{targets}]"
if labels.IsSome then $"Labels [{labels}]"
]
$"{Ansi.Emojis.gear} Settings" |> Terminal.writeLine
configInfos |> List.iter (fun configInfo -> $" {Ansi.Styles.green}{Ansi.Emojis.arrow}{Ansi.Styles.reset} {configInfo}" |> Terminal.writeLine)

let workspaceContent = FS.combinePath options.Workspace "WORKSPACE" |> File.ReadAllText
let workspaceConfig =
Expand Down