New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving loading settings messaging #4164

Merged
merged 5 commits into from May 23, 2018

Conversation

Projects
None yet
4 participants
@alodavi
Contributor

alodavi commented May 15, 2018

Improvements

Now when loading a project that has multiple build.sbt files the logger shows the path as well.
Before it was:

[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...

Now it's:

[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project baz from build.sbt ...
[info] Loading settings for project bar from build.sbt ...
[info] Loading settings for project foo from build.sbt ...

This should solve the issue: #3607

@lightbend-cla-validator

This comment has been minimized.

lightbend-cla-validator commented May 15, 2018

Hi @alodavi,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@@ -1039,7 +1039,7 @@ private[sbt] object Load {
// Grab all the settings we already loaded from sbt files
def settings(files: Seq[File]): Seq[Setting[_]] = {
if (files.nonEmpty)
log.info(s"${files.map(_.getName).mkString("Loading settings from ", ",", " ...")}")
log.info(s"${files.map(_.getPath).mkString("Loading settings from ", ",", " ...")}")

This comment has been minimized.

@eed3si9n

eed3si9n May 16, 2018

Member

The expectation set by @dwijnand says:

[info] Loading settings from build.sbt ...
[info] Loading settings from akka-actor/build.sbt ...
[info] Loading settings from akka-actor-tests/build.sbt ...
[info] Loading settings from akka-agent/build.sbt ...

so that should be relative paths from the root of the build, not the entire absolute path.

This comment has been minimized.

@dwijnand

dwijnand May 23, 2018

Member

I couldn't find a straight-forward way to wire the build root path to make it relative to it.

What do you think of this?

-            log.info(s"${files.map(_.getName).mkString("Loading settings from ", ",", " ...")}")
+            log.info(s"${files.map(_.getName).mkString(s"Loading settings for project ${p.id} from ", ",", " ...")}")

output:

[info] Loading settings for project global-plugins from idea.sbt,global-plugins.sbt ...
[info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/1.0/plugins
[info] Loading settings for project t-multi-project-build-sbts-build from plugins.sbt ...
[info] Loading project definition from /s/t-multi-project-build.sbts/project
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project baz from build.sbt ...
[info] Loading settings for project bar from build.sbt ...
[info] Loading settings for project foo from build.sbt ...
[info] Set current project to root (in build file:/s/t-multi-project-build.sbts/)

This comment has been minimized.

@eed3si9n

eed3si9n May 23, 2018

Member

@dwijnand Sounds like a good middle ground.

This comment has been minimized.

@alodavi

alodavi May 23, 2018

Contributor

thanks for the hint @dwijnand

@lightbend-cla-validator

This comment has been minimized.

lightbend-cla-validator commented May 23, 2018

Hi @alodavi,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@lightbend-cla-validator

This comment has been minimized.

lightbend-cla-validator commented May 23, 2018

Hi @alodavi,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@dwijnand

LGTM! Thank you @alodavi!

@eed3si9n eed3si9n merged commit 7f808bd into sbt:1.x May 23, 2018

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dwijnand dwijnand added this to the 1.2.0 milestone Jun 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment