Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single documentation for mixed (Scala/Java) project?

For a project with modules in Scala and Java (side by side), how to combine scaladoc with javadoc to provide a single view of the documentation for the project?

(this could be using maven, or ant, or sbt, more a general question).

Any thoughts and experiences appreciated.

like image 618
Michael Neale Avatar asked Jan 12 '10 03:01

Michael Neale


People also ask

Can you mix Scala and Java?

Is it possible to mix Scala and Java code? Yes, there is the ability to mix both types of code. It is possible to create an SBT project, put Scala code in src/main/scala and java code in src/main/java in the same project and make it work.

Can you use Maven with Scala?

If you're familiar with Maven, you can go ahead with the Scala Maven Plugin.

Can Java use Scala libraries?

Scala is designed to work smoothly with Java and Java libraries like JMSL. This is clearly evident in how Scala picks up the same CLASSPATH environment variable Java uses, so if the Java library you wish to use is already there in the CLASSPATH, then you're good to go.


1 Answers

With Scala 2.8's new scaladoc that will replace the one used with Scala 2.7, the differences will be even more striking. However, there was a request that a function be provided that translated scaladoc into javadoc format, for use by IDEs when displaying help.

If this function becomes available, then something that generates javadocs from scaladocs would be theoretically feasible.

But for any of that to become true, the people who have interest in such a thing would have to speak up at the appropriate fora. And, of course, if they are too small a group, it is likely nothing happens unless they do it for themselves.

like image 177
Daniel C. Sobral Avatar answered Oct 01 '22 17:10

Daniel C. Sobral