Exclude packages in doc task

263 views
Skip to first unread message

Joe Barnes

unread,
Feb 7, 2013, 5:10:50 PM2/7/13
to simple-b...@googlegroups.com
Does anyone know a way I can exclude a set of packages in the doc task?  While I've found that this can be used exclude packages, it doesn't work if the excluded package are referenced from the included packages.  The doc task fails in this case because the compiler is unable to resolve internal references to the excluded packages.

I want to do this because I am developing OSGi bundles, and I only want to publish documentation for the exported packages.  The private packages don't need to be documented as they are implementation details and distract the consumer from the pertinent information.  

Thanks,
Joe

Eugene Vigdorchik

unread,
Feb 8, 2013, 3:28:15 AM2/8/13
to simple-b...@googlegroups.com
On Fri, Feb 8, 2013 at 2:10 AM, Joe Barnes <barn...@gmail.com> wrote:
> Does anyone know a way I can exclude a set of packages in the doc task?
> While I've found that this can be used exclude packages, it doesn't work if
> the excluded package are referenced from the included packages. The doc
> task fails in this case because the compiler is unable to resolve internal
> references to the excluded packages.
Scaladoc has '-skip-packages' option that does exactly that.

hth,
Eugene.
>
> I want to do this because I am developing OSGi bundles, and I only want to
> publish documentation for the exported packages. The private packages don't
> need to be documented as they are implementation details and distract the
> consumer from the pertinent information.
>
> Thanks,
> Joe
>
> --
> 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.
>
>

Joe Barnes

unread,
Feb 8, 2013, 11:06:41 AM2/8/13
to simple-b...@googlegroups.com
Thanks Eugene.  It looks promising.  Unfortunately I've not figured out how to correctly configure this option in SBT.  The following is what I came up with:

scalacOptions in (Compile, doc) += "-skip-packages com.private"

But SBT says it's a bad option:
[error] bad option: '-skip-packages com.private'

Eugene Vigdorchik

unread,
Feb 8, 2013, 12:01:22 PM2/8/13
to simple-b...@googlegroups.com
On Fri, Feb 8, 2013 at 8:06 PM, Joe Barnes <barn...@gmail.com> wrote:
> Thanks Eugene. It looks promising. Unfortunately I've not figured out how
> to correctly configure this option in SBT. The following is what I came up
> with:
>
> scalacOptions in (Compile, doc) += "-skip-packages com.private"

Right, this option is only available in scala 2.10.
The following works for me with scalaVersion := "2.10.0"
scalacOptions in (Compile, doc) := List("-skip-packages", "com.private")

Eugene.

Joe Barnes

unread,
Feb 8, 2013, 12:03:50 PM2/8/13
to simple-b...@googlegroups.com
Ah, ok.  I'll have to add that to my list of things to improve once I get around to migrating to 2.10.

Thanks!
Joe
Reply all
Reply to author
Forward
0 new messages