I have some files in my project which I don’t want to compile, for various reasons. Is there way in IntelliJ to mark certain files and dont-compile-dont-run ?
The motivation is that I am building compilable files, and along side them incorrect files which my students need to correct the errors in so they can compile.
I’ve considered creating a templates directory alongside scala and test. Do I need to invent something for this, or does a solution already exist?
Change file name extension? From e.g. *.scala to *.scala.exercise. This way they will be skipped.
I created a directory parallel to scala named templates, and put the files there. That seems to work.
IntelliJ should only compile files in directories marked as source directories.
If this is an imported SBT project, then SBT settings determine the source directories. SBT default for Scala sources is src/main/scala, plus src/test/scala for tests.
To view or directly set source directories in IntelliJ, go to menu File > Project Structure, and in the dialogue go to Project settings > Modules.