[GRADLE-1273] Unable to reference objects in java src from scala src Created: 26/Dec/10  Updated: 04/Jan/13  Resolved: 29/Dec/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9-rc-3, 0.9
Fix Version/s: 0.9.1

Type: Bug
Reporter: Jacob Wu Assignee: Hans Dockter
Resolution: Fixed Votes: 0

Attachments: Zip Archive scala-error.zip    

 Description   

Unable to reference a java object in package a.b.c from a scala object in package x.y.z.

Output from trying to do "gradle clean assemble" with the attached sample project:

:clean
:compileJava
:compileScala
/home/jwu/projects/scala-error/src/main/scala/org/example/ThingUser.scala:3: error: thing is not a member of org.example
import org.example.thing
^
/home/jwu/projects/scala-error/src/main/scala/org/example/ThingUser.scala:5: error: not found: type Thing
class ThingUser(thing : Thing)



 Comments   
Comment by Jacob Wu [ 26/Dec/10 ]

Update to example project

Comment by Jacob Wu [ 27/Dec/10 ]

Updated sample project to have the correct import in scala src

Comment by Adam Murdoch [ 28/Dec/10 ]

A workaround is:

compileScala.classpath = sourceSets.main.compileClasspath + files(sourceSets.main.classesDir)
compileTestScala.classpath = sourceSets.test.compileClasspath + files(sourceSets.test.classesDir)
Generated at Wed Jun 30 11:51:21 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.