Sriram Subramanian
Sriram Subramanian

Reputation: 2753

How to generate javadoc-style documentation for Scala-only project in sbt?

I have a Scala project under sbt. I'd like to generate a javadoc for it as most of the users of the project API are Java developers. Is this possible?

Upvotes: 9

Views: 1981

Answers (2)

Randall Schulz
Randall Schulz

Reputation: 26486

% sbt doc

You'll find the results in target/scala-version/api (assuming you're using a simple SBT project that does not have multiple sub-projects).

Update:

Experimentation shows that SBT's doc command generates docs for both the Scala and Java sources in the project.

Upvotes: 5

Rüdiger Klaehn
Rüdiger Klaehn

Reputation: 12565

I assume that you want your docs in JavaDoc format in order to have something familiar to people that are used to java libraries?

There is a project from typesafe called GenJavaDoc that might be what you are looking for. It generates docs for a scala library in a format that is very similar to javadoc. It can be integrated into an sbt build.

Akka has a very complete java api, and many of the users of Akka come from the java world, so obviously they have a need for this.

The project repository

Akka japi docs generated by the tool

Blog post by Roland Kuhn describing the tool and the rationale

Upvotes: 7

Related Questions