Hi Josh,If I understand correctly it is up to the plugin author to do decide of which "Nature(s)" the plugin is? Why don't we decouple this from the plugin definition and let the use decide to "tag" plugins with different "natures".
--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/fde79fa4-38f5-49f3-bfd3-2b8c33101575%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "1.0" % "publish->default")
Why strings?
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/CAFLqJkwB7K4Dz39rU9dYdYN-KSLmNqS07uemHMjcG7tTNei6ng%40mail.gmail.com.
Why strings?
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/CANpg8PBgbPMdncRFEn73XKVstRKrEkSAv%3D2tv4vhvD7xsWwx-g%40mail.gmail.com.
Hi,
I wonder if we'll primarily use the natures which are simply
equivalent to plugins. In the current code each plugin has a nature
defined based on the plugin object name.
In the third story
https://github.com/sbt/sbt/wiki/User-Stories:-Project-Natures#wiki-user-story-user-wants-to-create-an-sbt-plugin-that-enhances-play-projects
MyPlugin is simply conditional on PlayPlugin (`def select = PlayPlugin`)
In the second story I don't think there's a difference between Play
and PlayPlugin:
https://github.com/sbt/sbt/wiki/User-Stories:-Project-Natures#wiki-story-user-wants-to-aggregate-tasks-on-a-project-but-not-have-that-project-actually-have-any-behavior
the story uses Play but it could just be PlayPlugin. And Web could
just be WebPlugin (sbt-web). This removes any ambiguity (what does
"Web" mean? it means sbt-web)
For publish, what would Publish mean? It would just mean the built-in
plugin provided by sbt core which contains the publish task. Other
concepts of publish would have a different name (or live in a
different package at least).
One way to simplify then could be to remove these "virtual" or
"symlink" nature names such as Publish and Web and just say that
natures == plugins, though "plugin" here means a Plugin object
instance, not project library dependency.
If you still wanted the idea of a nature with multiple
implementations, that could be done through a Plugin instance which
just provided task keys and no task implementations or something like
that, and people would then create other plugins that depended on that
one and provided concrete implementations. Or for a nature which was
"just" conceptual with no tasks, provide an empty Plugin instance...
The main advantage here would be to drop the word/concept of a
"nature" and just have "instances of Plugin"
A remaining confusion is that "plugin" means both "Plugin object
instance" and "project library dependency as in addSbtPlugin." Though
that confusion does already exist, it isn't as visible as we'd be
making it here.
The difference between this kind of dependency and transitive ivy deps
is that it's per-project (settings dependency) rather than per-build
(classpath dependency). Also the semantics are different; in these
stories, when I add PlayPlugin explicitly to a project, then all
plugins on classpath which depend on PlayPlugin would be auto-added
unless I exclude them specifically. While in ivy deps, normally I
would figure out my leaf dependencies and that would then pull in
PlayPlugin. So we are doing "find and use all plugins which have deps
satisfied" rather than "find all deps of the plugins I've asked to
use."
One problem we don't solve is that certain plugins (e.g. PlayPlugin)
still have to be manually specified, because we don't have any
convention-over-configuration mechanism like "if the files in this
project look kinda like a Play project assume it is one" or other
heuristic. But we do greatly reduce the number of plugins which have
to be manually added per-project, e.g. there's no config for pgp
plugin anymore beyond addSbtPlugin.
Anyway thinking out loud but the short version is maybe we can drop
the word/concept "nature" by collapsing it with Plugin.
Hi Josh,
> One thing I've been debating with in sbt 1.0 is whether or not we can fragment all aspects of Defaults.scala into "plugins", enabled with default natures (besides build-level settings which would have to be defined first). I think this would be good.
That's a very good idea.> What we want to do is provide a default set of string natures that folks can useI'm not sure how well this is going to work because we might have different definitions of what "Publish" means for example (but I might be wrong we need to see that on concrete examples).Overall I'm still concerned with complexity. It appears to me that there are already mechanisms to deal with loading and dependencies in sbt: Configurations and ivy dependencies/configurations. Isn't it possible to use that to support all the user stories?addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "1.0" % "publish->default")Eric.