Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zinc invokes scalac to compile java mistakenly or I misconfigured something? #59

Open
vmlinz opened this issue Apr 30, 2015 · 2 comments
Assignees
Labels

Comments

@vmlinz
Copy link

vmlinz commented Apr 30, 2015

Hi, I'm converting a sbt android project to use gradle android scala. The source code contains java and scala.

For my working repo

  1. Here's the link to the working branch: https://github.com/vmlinz/shadowsocks-android/tree/gradle-dev
  2. And the log for ./gradlew compileDebugJava --debug:https://gist.github.com/vmlinz/0438a7301a24ca820a49
  3. From what I can tell from the debug log, the zinc compiler is compiling one of the java files with scalac, which causes the error.

Experimenting repo

  1. My cloned repo: https://github.com/vmlinz/hello-scaloid-gradle, cloned from https://github.com/pocorall/hello-scaloid-gradle and add a directory of java sources.
  2. Log for the same command ./gradlew compileDebugJava --debug: https://gist.github.com/vmlinz/278b2ac854700f107bd6
  3. This time the compilation is correct

The only difference between build.gralde and build.sbt

sbt enable the user to set zinc compiling order to javaThenScala but in gradle I cannot find a place to set the zinc compiling order so it is forced Mixed as we can see in the log.

And I'm not sure if the the sourceset for java will only be compiled with javac as expected and the sourceset for scala will be compiled with only scalac.

Thanks for the reading.

Br,
Nick

@celestialmachines
Copy link

Temporary workaround for me was to add this to app/build.gradle

tasks.withType(ScalaCompile) {
scalaCompileOptions.useAnt = true
}

@saturday06 saturday06 added the bug label May 3, 2015
@saturday06 saturday06 self-assigned this May 3, 2015
@vmlinz
Copy link
Author

vmlinz commented May 4, 2015

@bitcubate Thanks, I will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants