Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm a high school teacher, and I'm using Scala to teach my Intro to Programming class. It's a little scary, but I'm excited.

However, since these are beginners, I want to give them as simple a project structure as possible. In the beginning, everything will just be at the top level, and at the very beginning, everything will probably be in one .scala file.

Unfortunately, I can't figure out how to convince Eclipse that I don't want src/main/scala, src/test/scala, etc. and not get errors. Here's my best crack at build.sbt so far:

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 refresh, Eclipse complains that there are duplicate entries in the build path and that it can't link to the base directory--which it represents as the absolute path to the project directory, but with hyphens substituted for slashes.

I can fix up the Eclipse project manually, but it'd be great if I could figure out how not to have to do that.

like image 419
Todd O'Bryan Avatar asked Sep 18 '13 03:09

Todd O'Bryan


2 Answers

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

like image 92
Santhosh Avatar answered Nov 19 '22 19:11

Santhosh


You shouldn't teach things one way for people to later discover it doesn't work in the real world. I see your point, they are beginners, but a folder structure is not the hard part.

Do a step by step, minimum level, but real world intro into things. If they go home and try on their own they have to waste time with build.sbt changes that are for more difficult than a simple General -> Import in Eclipse.

Stick with the standards, if they will learn anything about Scala, they won't have a problem with the folders. My 2 cents.

like image 34
flavian Avatar answered Nov 19 '22 19:11

flavian