Any way not to confuse sbt-eclipse if I just want everything in the top level folder? (2.2.0 s 0.12.4)

I am a high school teacher and I use Scala to teach me the Intro programming class. It's a little scary, but I'm excited.

However, since these are newcomers, I want to give them just the project structure. At the beginning, everything will just be top- .scala , and at the very beginning, everything will probably be in the same .scala file.

Unfortunately, I cannot figure out how to convince Eclipse that I do not want src/main/scala , src/test/scala , etc., and not get errors. Here is my best crack in build.sbt:

 scalaSource in Compile <<= baseDirectory scalaSource in Test <<= baseDirectory resourceDirectory <<= baseDirectory unmanagedSourceDirectories in Compile <<= Seq(scalaSource in Compile).join unmanagedSourceDirectories in Test <<= Seq(scalaSource in Test).join 

Unfortunately, when I run eclipse and update, Eclipse complains that there are duplicate entries in the build path and that they cannot bind to the base directory, which it represents as an absolute path to the project directory, but with hyphens that replace slashes.

I can fix the Eclipse project manually, but it would be great if I can figure out how not to do this.

+6
source share
3 answers

Instead, you can go with the scala interpreter and you will start it from scratch. It will be very easy for beginners. All the best!!!

+1
source

You should not learn things so that people can later discover that this does not work in the real world. I see your point of view, they are new, but the folder structure is not complicated.

Take it step by step, the minimum level, but a real intro to the world. If they return home and try on their own, they will have to spend time on changes to build.sbt , which are more complicated than simple General → Import in Eclipse.

Adhere to the standards, if they learn anything about Scala, they will not have problems with folders. My 2 cents.

+1
source

I ran into this problem of having * .scala files in the root directory in a different context and filed this sbteclipse problem .

0
source

Source: https://habr.com/ru/post/954030/


All Articles