SBT Plugin Example

84 views
Skip to first unread message

Mads Hartmann Jensen

unread,
Jan 27, 2012, 9:02:16 AM1/27/12
to simple-b...@googlegroups.com
Hi,

Yesterday I gave a talk at PHASE (Philadelphia Scala user group) about building SBT plugins. In preparation for the talk I prepared some different SBT plugin examples to help people get started easily. In case anyone might find them useful I've pushed them to github here: https://github.com/mads379/sbt-plugin-examples

I've also attached the presentation as a pdf - It's pretty short and might not work that well when you only have the words on the slides but who knows 

/Mads
Building SBT Plugins.pdf

Doug Tangren

unread,
Jan 27, 2012, 9:35:00 AM1/27/12
to simple-b...@googlegroups.com


Very cool. What do you guys thing about posting presentations these somewhere discoverable. I helped with one [1] a while ago with Eugene and Rose. I think I saw a pres on sbt by Brian Clapper go by a while back. And then Josh Suereth did a pretty amazing talk explaining some of the theory behind the design of the new setting dsl. Mark himself has some nice video talks on sbt. It would be cool to gather these somewhere central. Maybe on the wiki or as part of this work in progress site http://www.scala-sbt.org/.

What do you guys think?

[1]: http://sbt010.lessis.me
 
/Mads

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/s2H_2ynjKhsJ.
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,
Jan 27, 2012, 10:03:40 AM1/27/12
to simple-b...@googlegroups.com
On Fri, 27 Jan 2012 09:35:00 -0500
Doug Tangren <d.ta...@gmail.com> wrote:

> On Fri, Jan 27, 2012 at 9:02 AM, Mads Hartmann Jensen <mad...@gmail.com>wrote:
>
> > Hi,
> >
> > Yesterday I gave a talk at PHASE (Philadelphia Scala user group) about
> > building SBT plugins. In preparation for the talk I prepared some different
> > SBT plugin examples to help people get started easily. In case anyone might
> > find them useful I've pushed them to github here:
> > https://github.com/mads379/sbt-plugin-examples
> >
> > I've also attached the presentation as a pdf - It's pretty short and might
> > not work that well when you only have the words on the slides but who knows
> >
> >
>
> Very cool. What do you guys thing about posting presentations these
> somewhere discoverable. I helped with one [1] a while ago with Eugene and
> Rose. I think I saw a pres on sbt by Brian Clapper go by a while back. And
> then Josh Suereth did a pretty amazing talk explaining some of the theory
> behind the design of the new setting dsl. Mark himself has some nice video
> talks on sbt. It would be cool to gather these somewhere central. Maybe on
> the wiki or as part of this work in progress site http://www.scala-sbt.org/.
>
> What do you guys think?

Yes, something on the wiki or scala-sbt.org or both would be great.

-Mark

Doug Tangren

unread,
Jan 27, 2012, 10:08:54 AM1/27/12
to simple-b...@googlegroups.com
On Fri, Jan 27, 2012 at 10:03 AM, Mark Harrah <dmha...@gmail.com> wrote:
On Fri, 27 Jan 2012 09:35:00 -0500
Doug Tangren <d.ta...@gmail.com> wrote:

> On Fri, Jan 27, 2012 at 9:02 AM, Mads Hartmann Jensen <mad...@gmail.com>wrote:
>
> > Hi,
> >
> > Yesterday I gave a talk at PHASE (Philadelphia Scala user group) about
> > building SBT plugins. In preparation for the talk I prepared some different
> > SBT plugin examples to help people get started easily. In case anyone might
> > find them useful I've pushed them to github here:
> > https://github.com/mads379/sbt-plugin-examples
> >
> > I've also attached the presentation as a pdf - It's pretty short and might
> > not work that well when you only have the words on the slides but who knows
> >
> >
>
> Very cool. What do you guys thing about posting presentations these
> somewhere discoverable. I helped with one [1] a while ago with Eugene and
> Rose. I think I saw a pres on sbt by Brian Clapper go by a while back. And
> then Josh Suereth did a pretty amazing talk explaining some of the theory
> behind the design of the new setting dsl. Mark himself has some nice video
> talks on sbt. It would be cool to gather these somewhere central. Maybe on
> the wiki or as part of this work in progress site http://www.scala-sbt.org/.
>
> What do you guys think?

Yes, something on the wiki or scala-sbt.org or both would be great.


Cool. Just a reminder for sbt'er with good doc skills or with ideas for what would make learning about sbt easier scala-sbt.org is open source https://github.com/sbt/sbt.github.com. If you just have ideas feel free to post em here https://github.com/sbt/sbt.github.com/issues. We really want to make a it a community driven project. Josh did some work to `jekyllize` it to make it easier to contribute to.

Thanks.

 

Mark Harrah

unread,
Jan 27, 2012, 10:29:26 AM1/27/12
to simple-b...@googlegroups.com
On Fri, 27 Jan 2012 06:02:16 -0800 (PST)

Mads Hartmann Jensen <mad...@gmail.com> wrote:

> Hi,
>
> Yesterday I gave a talk at PHASE (Philadelphia Scala user group) about
> building SBT plugins. In preparation for the talk I prepared some different
> SBT plugin examples to help people get started easily. In case anyone might
> find them useful I've pushed them to github
> here: https://github.com/mads379/sbt-plugin-examples

Nice examples, Mads.

A question/comment on flatMap... Generally, use flatMap if you want the output of one parser to determine the next parser to use. The example given is:

Space ~> nameParser flatMap { name =>
Space ~> questionParser map { (name,_) }
}

'name' isn't used to determine the next parser, so it looks like it could just be:

(Space ~> nameParser) ~ (Space ~> questionParser)

An example of a use case for flatMap would be:

Space ~> nameParser flatMap { name =>
val questionParser = if(hasMoney(name)) buyBeer else weather
Space ~> questionParser map { (name,_) }
}

> I've also attached the presentation as a pdf - It's pretty short and might
> not work that well when you only have the words on the slides but who knows

Looks like it was a good talk!

-Mark

> /Mads
>

Josh Suereth

unread,
Jan 27, 2012, 10:57:42 AM1/27/12
to simple-b...@googlegroups.com
Who wants to volunteer to add a "Talks" page with links to talks to the scala-sbt.org site?   If you generate the content as a pull request, I'll link it in and push :)

NO PATCHES WILL BE DENIED (unless of course, they insult my mother).

- Josh

Mads Hartmann Jensen

unread,
Jan 27, 2012, 11:19:13 AM1/27/12
to simple-b...@googlegroups.com, simple-b...@googlegroups.com
Ah, thanks for the hint :) a small thing though: I had to move the token() calls up otherwise it would mess with the tab completion (it would add two spaces after ask-phase). The code now is

token(Space ~> nameParser) ~ token(Space ~> questionParser)

Which is still a vast improvement :)

(I obviously removed the other calls to token).

I will push the changes when I have wifi on my mac.

Sent from my iPhone

Mads Hartmann Jensen

unread,
Jan 27, 2012, 11:29:49 AM1/27/12
to simple-b...@googlegroups.com, simple-b...@googlegroups.com
PICK ME PICK ME

Sent from my iPhone

Mads Hartmann Jensen

unread,
Jan 27, 2012, 1:11:16 PM1/27/12
to simple-b...@googlegroups.com
Pull request sent! 

It doesn't seem that the site uses any static page generation so I just edited the raw html - was that wrong? 

/Mads

Doug Tangren

unread,
Jan 27, 2012, 2:13:49 PM1/27/12
to simple-b...@googlegroups.com
On Fri, Jan 27, 2012 at 1:11 PM, Mads Hartmann Jensen <mad...@gmail.com> wrote:
Pull request sent! 

It doesn't seem that the site uses any static page generation so I just edited the raw html - was that wrong? 


Checkout the gen-master branch. It originally wasn't jekyllified so the source branch is on gen-master.
 
/Mads

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/vkx0hgd2sQMJ.

Josh Suereth

unread,
Jan 27, 2012, 3:03:52 PM1/27/12
to simple-b...@googlegroups.com
That's actually a freaking bug with github that they didn't acknowledge when I chatted with them (I wasn't too persistent though).

"master" is the default branch, and since we're using a <username>.github.com repository the default branch is the one gh-pages picks up.   Hence you have to look at gen-master all the time.

Sorry guys, I'm trying to make it as easy as possible for submissions, really!

- Josh

Mads Hartmann Jensen

unread,
Jan 27, 2012, 3:14:06 PM1/27/12
to simple-b...@googlegroups.com, simple-b...@googlegroups.com
Okay, I'll fix the commit when I get back to my computer (in 2h or so)

Sent from my iPhone

Mads Hartmann Jensen

unread,
Jan 27, 2012, 3:14:50 PM1/27/12
to simple-b...@googlegroups.com, simple-b...@googlegroups.com
I think I'll also add a READMD for the next guy ;)

Sent from my iPhone

On 27/01/2012, at 15.03, Josh Suereth <joshua....@gmail.com> wrote:

Josh Suereth

unread,
Jan 27, 2012, 3:30:48 PM1/27/12
to simple-b...@googlegroups.com
Good idea! :)

Mads Hartmann Jensen

unread,
Jan 27, 2012, 4:44:48 PM1/27/12
to simple-b...@googlegroups.com
Do I need to have jekyll installed seperately or something? I get the following error when I try to 
'make-site'. 

 {file:/Users/Mads/dev/projects/sbt.github.com/}default-028870/*:mappings(for make-site): java.io.IOException: Cannot run program "jekyll" (in directory "/Users/Mads/dev/projects/sbt.github.com/src/jekyll"): error=2, No such file or directory

Mads Hartmann Jensen

unread,
Jan 27, 2012, 4:53:00 PM1/27/12
to simple-b...@googlegroups.com
Turns out you do need to have jekyll installed ;) Updating the readme to reflect this

On Jan 27, 2012, at 3:30 PM, Josh Suereth wrote:

Josh Suereth

unread,
Jan 28, 2012, 7:47:53 AM1/28/12
to simple-b...@googlegroups.com

Yep, sorry.  I didn't have time to use scalate or any scala-only templating bit, so it forks to Jekyll.

Reply all
Reply to author
Forward
0 new messages