On Thu, 28 Mar 2013 19:06:06 -0700 (PDT)
DiveInto <
diveinto...@gmail.com> wrote:
> In my project, I have Java code generated by probuf.
>
> while when I try to package my project(using twitter's sbt-package-dist<
https://github.com/twitter/sbt-package-dist>
I assume you have Scala sources defined in the same project as these generated Java sources. The way a mixed Java and Scala project is compiled is configured by the compileOrder setting:
http://www.scala-sbt.org/release/docs/Detailed-Topics/Java-Sources.html
By default, sbt assumes you might have dependencies between Scala and Java sources and therefore it needs to pass both Scala and Java sources to scalac first. scalac processes enough of the Java sources to compile the Scala sources and generate class files for the Scala sources only. Then, javac compiles the Java sources, which can succeed because the classfiles for the Scala sources are now available.
In your case, I assume the error is coming from the Scala compiler processing the Java sources incorrectly. If your Java sources have no dependencies on the Scala sources, you can set compileOrder to compile Java sources first with javac and then Scala sources only second with scalac:
compileOrder := CompilerOrder.JavaThenScala
-Mark
>
> --
> 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.
>
>