Skip to content

Commit

Permalink
Tools: Print build started and build success messages
Browse files Browse the repository at this point in the history
Fixes #15787
  • Loading branch information
bricelam committed Aug 23, 2019
1 parent 5197fa7 commit 10895a9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Add-Migration

# NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
$result = (EF $dteProject $dteStartupProject $params) -join "`n" | ConvertFrom-Json
Write-Output 'To undo this action, use Remove-Migration.'
Write-Host 'To undo this action, use Remove-Migration.'

$dteProject.ProjectItems.AddFromFile($result.migrationFile) | Out-Null
$DTE.ItemOperations.OpenFile($result.migrationFile) | Out-Null
Expand Down Expand Up @@ -818,7 +818,7 @@ function EF($project, $startupProject, $params, [switch] $skipBuild)

if (!$skipBuild)
{
Write-Verbose 'Build started...'
Write-Host 'Build started...'

# TODO: Only build startup project. Don't use BuildProject, you can't specify platform
$solutionBuild = $DTE.Solution.SolutionBuild
Expand All @@ -828,7 +828,7 @@ function EF($project, $startupProject, $params, [switch] $skipBuild)
throw 'Build failed.'
}

Write-Verbose 'Build succeeded.'
Write-Host 'Build succeeded.'
}

$startupProjectDir = GetProperty $startupProject.Properties 'FullPath'
Expand Down
12 changes: 12 additions & 0 deletions src/dotnet-ef/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/dotnet-ef/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,10 @@
<data name="WorkingDirDescription" xml:space="preserve">
<value>The working directory of the tool invoking this command.</value>
</data>
<data name="BuildStarted" xml:space="preserve">
<value>Build started...</value>
</data>
<data name="BuildSucceeded" xml:space="preserve">
<value>Build succeeded.</value>
</data>
</root>
2 changes: 2 additions & 0 deletions src/dotnet-ef/RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ protected override int Execute()

if (!_noBuild.HasValue())
{
Reporter.WriteInformation(Resources.BuildStarted);
startupProject.Build();
Reporter.WriteInformation(Resources.BuildSucceeded);
}

string executable;
Expand Down

0 comments on commit 10895a9

Please sign in to comment.