sbt-unidoc

119 views
Skip to first unread message

eugene yokota

unread,
May 16, 2013, 3:26:01 AM5/16/13
to simple-b...@googlegroups.com
Hi guys,

I wrote a new plugin called sbt-unidoc.

The original implementation of `unidoc` command was written by [@pvlugter](https://github.com/pvlugter) for Akka's build definition.
I turned it into a plugin, and refactored it some more.

The basic use case of sbt-unidoc is to unify Scaladoc generation across all projects in a build. This is useful for builds that modularizes its parts into subprojects like Akka. After setting it up, you just run `unidoc` task from the root project.

Another interesting use case is to unify Javadoc generation, except plain Javadoc won't know your Scala code. So they wrote [a compiler plugin](https://github.com/typesafehub/genjavadoc) that generates Scala-equivalent Java code, so you can generate Javadoc. See [sbt-unidoc](https://github.com/sbt/sbt-unidoc) for the details.

-eugene

Jason Zaugg

unread,
May 16, 2013, 9:36:23 AM5/16/13
to simple-b...@googlegroups.com
Great work!

You might like to document / demonstrate the use of  -Ymacro-no-expand, which would be needed if one of the modules defines macros. Macros currently can't be used in the same module as they are defined (more accurately, in the same compilation run.) So this setting just disabled expansion altogether, which for some projects (e.g. SBT itself) is a good workaround.

I actually noticed that this option has been lost in 71fb0b83a7 [1], I've raised SI-7487 [2] to resurrect it.

-jason

eugene yokota

unread,
May 16, 2013, 11:41:21 AM5/16/13
to simple-b...@googlegroups.com
Interesting. Didn't think about the macro situation.
I had hidden scalacOptions inside compileInputs, but now I am exposing it back out for easier rewiring,
and releasing it as 0.1.1.

From the readme:

> If one of your subprojects is defining def macros, add `scalacOptions in (ScalaUnidoc, unidoc) += "-Ymacro-no-expand"` to the root project's setting to temporary halt the macro expansion.

-eugene

On Thu, May 16, 2013 at 9:36 AM, Jason Zaugg <jza...@gmail.com> wrote:
You might like to document / demonstrate the use of  -Ymacro-no-expand, which would be needed if one of the modules defines macros. Macros currently can't be used in the same module as they are defined (more accurately, in the same compilation run.) So this setting just disabled expansion altogether, which for some projects (e.g. SBT itself) is a good workaround.

I actually noticed that this option has been lost in 71fb0b83a7 [1], I've raised SI-7487 [2] to resurrect it.

-jason

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

Doug Tangren

unread,
May 16, 2013, 12:22:37 PM5/16/13
to simple-b...@googlegroups.com
very cool eugene!

-Doug Tangren
http://lessis.me

Jeff Olson

unread,
May 16, 2013, 12:25:19 PM5/16/13
to simple-b...@googlegroups.com
That's awesome. Thanks!! I had been wanting to do this myself, but you have saved me the trouble.

On a related note, does anyone know how to get sbt to generate the fancy new scaladoc as seen in www.scala-lang.org/api/current/index.html, with the type hierarchy graphs and the implicitly available methods? Are there some options I need to provide in 'scaladocOptions' or is there a new version I need to specify? Ironically, the documentation for scaladoc seems lacking.

-Jeff

Mark Harrah

unread,
May 16, 2013, 3:26:17 PM5/16/13
to simple-b...@googlegroups.com
On 5/16/13, Jeff Olson <jeff.d...@gmail.com> wrote:
> That's awesome. Thanks!! I had been wanting to do this myself, but you have
>
> saved me the trouble.
>
> On a related note, does anyone know how to get sbt to generate the fancy
> new scaladoc as seen in www.scala-lang.org/api/current/index.html, with the
>
> type hierarchy graphs and the implicitly available methods? Are there some
> options I need to provide in 'scaladocOptions' or is there a new version I
> need to specify? Ironically, the documentation for scaladoc seems lacking.

sbt doesn't have a great way to show the options of scaladoc, but
you'll find them in the output of `scaladoc -help`.

-Mark

> -Jeff
>
> On Thursday, May 16, 2013 2:26:01 AM UTC-5, eugene yokota wrote:
>>
>> Hi guys,
>>
>> I wrote a new plugin called sbt-unidoc.
>>
>> The original implementation of `unidoc` command was written by
>> [@pvlugter](
>> https://github.com/pvlugter) for Akka's build definition.
>> I turned it into a plugin, and refactored it some more.
>>
>> The basic use case of sbt-unidoc is to unify Scaladoc generation across
>> all projects in a build. This is useful for builds that modularizes its
>> parts into subprojects like Akka. After setting it up, you just run
>> `unidoc` task from the root project.
>>
>> Another interesting use case is to unify Javadoc generation, except plain
>>
>> Javadoc won't know your Scala code. So they wrote [a compiler plugin](
>> https://github.com/typesafehub/genjavadoc) that generates
>> Scala-equivalent Java code, so you can generate Javadoc. See
>> [sbt-unidoc](
>> https://github.com/sbt/sbt-unidoc) for the details.
>>
>> -eugene
>>
>>
>

Peter Vlugter

unread,
May 16, 2013, 7:15:50 PM5/16/13
to simple-b...@googlegroups.com
Very cool. Great work!

- Peter
Reply all
Reply to author
Forward
0 new messages