any way to force rebuilding of plugins?

13 views
Skip to first unread message

James Strachan

unread,
Feb 4, 2010, 2:27:07 PM2/4/10
to simple-build-tool
I'm experimenting hacking up an sbt plugin (to render nice HTML output
for test results with hyperlinks in the stack traces which when
clicked should open the file at that line in your IDE as per this
thread... http://groups.google.com/group/simple-build-tool/msg/3d5feb82569840e0

So I'm building the sbt plugin, then trying to use it in another
project. I'm finding that to refresh the plugin whenever I've done a
'publish-local' in the plugin build, I've gotta manually delete all
the directories in project/plugins/* in the project I want to use the
plugin in - otherwise it doesn't bother to detect its changed or
rebuild the source code.

I wondered if there was a cunning feature in sbt to force the rebuild
of plugins when they've changed (tried all the clean-* goals and doing
"update" and "reload" to no avail). I guess I should hack a new action
- but just wondered if I was missing something first..

Stefan Langer

unread,
Feb 4, 2010, 2:57:52 PM2/4/10
to simple-b...@googlegroups.com
I didn't find a way so I wrote my own task
lazy val cleanPlugins = task {
    Console.println(info.pluginsPath)
    val paths = info.pluginsPath / "target" ::
      info.pluginsPath / "src_managed" ::
      info.pluginsPath / "lib_managed" ::
      info.pluginsPath / "project" :: Nil
    FileUtilities.clean(paths, true, log)
    None
  }
Put this in your project file and then call it via cleanPlugins in sbt console.

-Stefan

2010/2/4 James Strachan <james.s...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.


Mark Harrah

unread,
Feb 4, 2010, 6:09:13 PM2/4/10
to simple-b...@googlegroups.com
This should probably go on Project or something. Agree?

-Mark

>> simple-build-t...@googlegroups.com<simple-build-tool%2Bunsu...@googlegroups.com>

Stefan Langer

unread,
Feb 5, 2010, 3:49:27 AM2/5/10
to simple-b...@googlegroups.com
Yes you need to put it in your Project

2010/2/5 Mark Harrah <dmha...@gmail.com>

James Strachan

unread,
Feb 5, 2010, 4:51:21 AM2/5/10
to simple-build-tool
Many thanks!

We should add this into the sbt Project class or one if its base
classes or traits shouldn't we?

On Feb 4, 7:57 pm, Stefan Langer <mailtolan...@googlemail.com> wrote:
> I didn't find a way so I wrote my own task
> lazy val cleanPlugins = task {
>     Console.println(info.pluginsPath)
>     val paths = info.pluginsPath / "target" ::
>       info.pluginsPath / "src_managed" ::
>       info.pluginsPath / "lib_managed" ::
>       info.pluginsPath / "project" :: Nil
>     FileUtilities.clean(paths, true, log)
>     None
>   }
> Put this in your project file and then call it via cleanPlugins in sbt
> console.
>
> -Stefan
>

> 2010/2/4 James Strachan <james.strac...@gmail.com>


>
>
>
> > I'm experimenting hacking up an sbt plugin (to render nice HTML output
> > for test results with hyperlinks in the stack traces which when
> > clicked should open the file at that line in your IDE as per this
> > thread...
> >http://groups.google.com/group/simple-build-tool/msg/3d5feb82569840e0
>
> > So I'm building the sbt plugin, then trying to use it in another
> > project. I'm finding that to refresh the plugin whenever I've done a
> > 'publish-local' in the plugin build, I've gotta manually delete all
> > the directories in project/plugins/* in the project I want to use the
> > plugin in - otherwise it doesn't bother to detect its changed or
> > rebuild the source code.
>
> > I wondered if there was a cunning feature in sbt to force the rebuild
> > of plugins when they've changed (tried all the clean-* goals and doing
> > "update" and "reload" to no avail). I guess I should hack a new action
> > - but just wondered if I was missing something first..
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "simple-build-tool" group.
> > To post to this group, send email to simple-b...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > simple-build-t...@googlegroups.com<simple-build-tool%2Bunsubscr i...@googlegroups.com>

Mark Harrah

unread,
Feb 5, 2010, 9:44:07 AM2/5/10
to simple-b...@googlegroups.com
I meant sbt.Project itself, as James suggests.

-Mark

>> <simple-build-tool%2Bunsu...@googlegroups.com<simple-build-tool%252Buns...@googlegroups.com>

Stefan Langer

unread,
Feb 5, 2010, 10:00:16 AM2/5/10
to simple-b...@googlegroups.com
Oh I see then I'm +1 for it as the only reason why I created that task is because I didn't find a way to do it with provided tools.

2010/2/5 Mark Harrah <dmha...@gmail.com>
Reply all
Reply to author
Forward
0 new messages