-
Notifications
You must be signed in to change notification settings - Fork 928
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
Add extraProjects and derivedProjects (formerly known as buildExtras and projectExtras) #2717
Conversation
Wow knocking them out the park this week, awesome. I'm only concerned with the name buildExtras: for builds where all the projecrs are programmatically generated it sounds a bit weird. So I was thinking perhaps just "projects" (like we have projectSettings, not extraProjectSettings). projectExtras I'm not sure of either, but I don't have any better suggestions. |
|
I see the organic/synthetic project argument. But what's a project-level project? |
|
I see. Cool. On Sat, 27 Aug 2016, 12:36 eugene yokota, notifications@github.com wrote:
|
|
||
/** Definitively set the [[ProjectOrigin]] for this project. */ | ||
private[sbt] def setProjectOrigin(origin: ProjectOrigin): Project = { | ||
// TODO: for 0.14.0, use copy when it has the additional `autoPlugins` parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be additional projectOrigin
parameter, I guess.
I'm really happy to see progress, thank you. Reviewed, some minor tweaks, but generally LGTM. |
This adds support to generate synthetic subprojects from an auto plugin. In addition, a method called `projectOrigin` is added to distinguish Organic, BuildExtra, ProjectExtra, and GenericRoot.
Pushed a commit per reviews. |
Docs addressing motivation (why does this feature exist, what problems does it solve) would be helpful. |
I agree 100% with @dwijnand's first comment. The feature itself here is absolutely terrific. That said, calling these "extras" feels really under-descriptive to me. There are innumerable "extra" things that could be generated by a plugin, so, as a user, why would I assume that the "extras" would be projects? Also, @dwijnand indicates, this naming would feel kind of weird if you were in a setting where most projects were generated (maybe someone defines a plugin in the future for opinionated builds described by a JSON dependencies file, for instance). Why not just call them |
Or |
A typical build user would not see the method name when they consume a plugin. This is mostly for advanced plugin authors. I want the names that can be used as noun phrase like |
Why not just |
How about One thing I'll note now that I've thought about it is that sbt's model doesn't even really include the notion of "subprojects" unless you count aggregation (which I don't think is in play here). There are just "projects". So isn't it a bit confusing to say that these generated projects are "subprojects"? |
I do not believe it is accurate to say SBT does not support the concept of subprojects. See dependsOn in the multi-project build page. |
ok. How about: def extraProjects: Seq[Project]
def derivedProjects(proj: ProjectDefinition[_]): Seq[Project] ? |
That combo is better than any one so far. From my point of view, the bikeshedding can stop with them ;). Thanks again for this great feature. |
@mslinn That usage of "subproject" means "subproject of the build" not "subproject of another project" and is roughly synonymous with just "project". |
@clhodapp if this is going to be an ongoing source of confusion, the docs should introduce a term like "build subproject" or "subbuild" - I don't care if the b's are elided or not. |
Sent PR for the rename (#2738) |
Fixes #2532
This adds support to generate synthetic subprojects from an auto plugin.
In addition, a method called
projectOrigin
is added to distinguish Organic, BuildExtra, ProjectExtra, and GenericRoot.To generate subprojects, override
buildExtras
method as follows:
Subprojects may also be derived from an existing subproject
by overriding
projectExtras
./review @dwijnand, @Duhemm