Added a source folder, now my "src/main/scala" folder doesn't compile

529 просмотров
Перейти к первому непрочитанному сообщению

Dan Gravell

не прочитано,
15 февр. 2017 г., 09:21:3715.02.2017
– Scala IDE User
I originally had two source folders:

src/main/scala
src/test/scala

With obvious uses :)

I realised one of my unit tests was really an integration test and shouldn't run with the others. So I created a new source folder and now I have:

src/main/scala
src/test/scala
src/integration-test/scala

It seemed to work at first, but since cleaning the project, bin/ is empty and the test source folders have compilation errors against them saying they can't find the classes in src/main/scala (nothing against the 'main' source folder).

If I remove integration-test as a source folder, main builds again into bin/ and the unit test folder builds fine.

I am also using Gradle Buildship to run the build outside of Eclipse - this generates the Eclipse config, but I'm able to edit it from there so I don't *think* it is affecting things.

Does Scala IDE support three source folders? It certainly does for non-code related folders (src/main/resources et al).

Dan

Rafał Krzewski

не прочитано,
15 февр. 2017 г., 11:58:1115.02.2017
– Scala IDE User
Hi Dan,

it definitely does support more than 2 source folders. You should check your project's Properties > Java Build Path Are there any error markers? Does anything there look amiss?
Maybe Gradle Buildship (whatever that is) fails to update .classpath file properly

Cheers,
Rafał

iulian dragos

не прочитано,
16 февр. 2017 г., 03:07:3216.02.2017
– scala-i...@googlegroups.com
Do you have any Java sources in those source paths? Sometimes Java errors are not reported by Scalac (because the Scala parser has some bugs), but that still prevents scalac from producing any bytecode.

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-user+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/fee56b44-454a-4afd-be6e-624f705d9d46%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Dan Gravell

не прочитано,
16 февр. 2017 г., 09:31:2016.02.2017
– Scala IDE User
No Java sources.

No error markers in build path.

It seems reliable - I just added the folder as a source folder again, cleaned and the same thing occurs - empty bin/ and errors against the test folders.

Nothing in the Error Log either, sorry should've said that.

On Thursday, February 16, 2017 at 8:07:32 AM UTC, Iulian Dragos wrote:
Do you have any Java sources in those source paths? Sometimes Java errors are not reported by Scalac (because the Scala parser has some bugs), but that still prevents scalac from producing any bytecode.
On Wed, Feb 15, 2017 at 5:58 PM, Rafał Krzewski <rafal.k...@gmail.com> wrote:
Hi Dan,

it definitely does support more than 2 source folders. You should check your project's Properties > Java Build Path Are there any error markers? Does anything there look amiss?
Maybe Gradle Buildship (whatever that is) fails to update .classpath file properly

Cheers,
Rafał

W dniu środa, 15 lutego 2017 15:21:37 UTC+1 użytkownik Dan Gravell napisał:
I originally had two source folders:

src/main/scala
src/test/scala

With obvious uses :)

I realised one of my unit tests was really an integration test and shouldn't run with the others. So I created a new source folder and now I have:

src/main/scala
src/test/scala
src/integration-test/scala

It seemed to work at first, but since cleaning the project, bin/ is empty and the test source folders have compilation errors against them saying they can't find the classes in src/main/scala (nothing against the 'main' source folder).

If I remove integration-test as a source folder, main builds again into bin/ and the unit test folder builds fine.

I am also using Gradle Buildship to run the build outside of Eclipse - this generates the Eclipse config, but I'm able to edit it from there so I don't *think* it is affecting things.

Does Scala IDE support three source folders? It certainly does for non-code related folders (src/main/resources et al).

Dan

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

Dan Gravell

не прочитано,
16 февр. 2017 г., 09:42:4116.02.2017
– Scala IDE User
I don't think Buildship is related because all it does is generate a .classpath file, bit like sbt does with its eclipse plugin.

The classpath generated is:

<classpath>
<classpathentry kind="src" path="src/main/scala">
<attributes>
<attribute name="FROM_GRADLE_MODEL" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/test/scala">
<attributes>
<attribute name="FROM_GRADLE_MODEL" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/integration-test/scala"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

So you can see those FROM_GRADLE_MODEL artifacts - I removed them and still the same thing happens. If I remove the src/integration-test/scala entry, same as removing it from the build path, it then all works.

Dan Gravell

не прочитано,
16 февр. 2017 г., 09:44:0816.02.2017
– Scala IDE User
I think I've worked something out. I changed the scopes setting in the Scala compiler settings. src-integration-test was set to "main", not "tests". Changing it to "tests" fixed it.

Now I need to work out how to get the Gradle scala plugin to work with Buildship to alter the scopes. Probably not possible...
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений