Skip to content
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

Feature request: flag to identify default project #2789

Open
cunei opened this issue Oct 18, 2016 · 2 comments
Open

Feature request: flag to identify default project #2789

cunei opened this issue Oct 18, 2016 · 2 comments
Labels
uncategorized Used for Waffle integration

Comments

@cunei
Copy link

cunei commented Oct 18, 2016

problem

When sbt creates a default project, the project name is derived by using a rather complex algorithm that involve the containing directory name, a number of suffixes, the string "root", and so on. That makes it very difficult to guess whether, by looking at the list of projects, a given project is the default one or not. For instance, if the project is checked out into two directories that have different names, the default project name may change.
At present dbuild uses a heuristic to try and guess whether a project is the default one, in order to let the user refer to it by a conventional name even though within sbt its actual name may vary. This approach works in many cases, but it is not very satisfactory.

expectation

As a feature request, it would be useful to have a new flag in the project description, which gets set in case the project was automatically generated and received its name automatically. There is currently no certain way to identify the default project post facto.

notes

The related code in sbt involves defaultID and autoID, in sbt/internal/Load.scala.

@dwijnand
Copy link
Member

By "default project" do you mean the build's root project?

Isn't that https://github.com/sbt/sbt/blob/v0.13.12/main/src/main/scala/sbt/BuildStructure.scala#L16 ?

Also this is mildly related to #2405

@cunei
Copy link
Author

cunei commented Oct 20, 2016

My description was not adequately clear. The line that you refer to allows one to identify the root project; however, there is no way to determine whether the name of the project was explicitly chosen by the user, in which case within dbuild we can refer to the root project by its proper name, or rather whether the root project received an automatically assigned name by default, in which case the name may morph and within dbuild there would be no way to refer to it by using a fixed name. A flag would be needed to determine whether the root project received its name automatically or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
uncategorized Used for Waffle integration
Projects
None yet
Development

No branches or pull requests

3 participants