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

addPluginSbtFile command #4211

Merged
merged 1 commit into from Jun 19, 2018

Conversation

Projects
None yet
4 participants
@eed3si9n
Copy link
Member

eed3si9n commented Jun 18, 2018

Fixes #1502

This adds --addPluginSbtFile=<file> command, which adds the given .sbt file to the plugin build.
Using this mechanism editors or IDEs can start a build with required plugin.

$ cat /tmp/extra.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")

$ sbt --addPluginSbtFile=/tmp/extra.sbt
...
sbt:helloworld> plugins
In file:/xxxx/hellotest/
  ...
  sbtassembly.AssemblyPlugin: enabled in root

/cc @jastice

@smarter

This comment has been minimized.

Copy link
Contributor

smarter commented Jun 18, 2018

@Duhemm Looks like this could replace https://github.com/scalacenter/load-plugin for the IDE usecase.

@eed3si9n

This comment has been minimized.

Copy link
Member Author

eed3si9n commented Jun 18, 2018

--addPluginSbtFile=<file> gets to the State before project loading (reload), so it by design does not require extra reloading, and also survives reload command issued by the build user.

sbt:helloworld> reload
[info] Loading settings for project global-plugins from vimquit.sbt,pgp.sbt ...
[info] Loading settings for project global-plugins from extra.sbt ...
addPluginSbtFile command
Fixes #1502

This adds `--addPluginSbtFile=<file>` command, which adds the given .sbt file to the plugin build.
Using this mechanism editors or IDEs can start a build with required plugin.

```
$ cat /tmp/extra.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")

$ sbt --addPluginSbtFile=/tmp/extra.sbt
...
sbt:helloworld> plugins
In file:/xxxx/hellotest/
  ...
  sbtassembly.AssemblyPlugin: enabled in root
```

@eed3si9n eed3si9n force-pushed the eed3si9n:wip/loadplugin branch from 88d93ca to 932f911 Jun 18, 2018

@jastice

This comment has been minimized.

Copy link
Contributor

jastice commented Jun 18, 2018

Nice!

@eed3si9n eed3si9n added this to the 1.2.0 milestone Jun 18, 2018

@eed3si9n eed3si9n merged commit 6fbb7f0 into sbt:1.x Jun 19, 2018

3 checks passed

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

@eed3si9n eed3si9n deleted the eed3si9n:wip/loadplugin branch Jun 19, 2018

@eed3si9n eed3si9n removed the in progress label Jun 19, 2018

@nafg

This comment has been minimized.

Copy link

nafg commented Jun 19, 2018

Nice. Can it be set in .sbtopts?

@@ -96,6 +97,14 @@ $HelpCommand <regular expression>
The order is preserved between all early commands, so `sbt "early(a)" "early(b)"` executes `a` and `b` in order.
"""

def addPluginSbtFileHelp = {
val brief =
(s"--$AddPluginSbtFileCommand=<file>", "Adds the given *.sbt file to the plugin build.")

This comment has been minimized.

@nafg

nafg Jun 19, 2018

aren't most options with a single dash (at least in the help)?

This comment has been minimized.

@eed3si9n

eed3si9n Jun 20, 2018

Author Member

The single line convention comes from Java, and since Java 9 is updating to more UNIX -- style, I am following the cargo cult.

jastice added a commit to jastice/sbt that referenced this pull request Jul 20, 2018

@jastice jastice referenced this pull request Aug 14, 2018

Open

reboot loses addPluginSbtFile settings #4303

1 of 1 task complete

jastice added a commit to jastice/sbt that referenced this pull request Aug 23, 2018

eed3si9n added a commit that referenced this pull request Sep 20, 2018

Merge pull request #4368 from eed3si9n/bport/addPluginFileCommand
[0.13] port sddPluginSbtFile command from #4211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.