Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change all SBT target directories to the outside of the source

Tags:

scala

sbt

I am having a hard time running SBT in a "read-only" directory (directory I have permissions but I cannot/shouldn't write).

I want basically to move all the target directories to another location.

Half the problem is solved with:

target := file("</full/path/to/new/location>")

but it is still creating target directories inside the project/* directory.

I would also like this to be done in the run command, not by changing the sbt files. The current command I am using is:

sbt 'set target := file("</full/path/to/new/location>")' compile

Adding some kind of system wide sbt configuration would be a possibility, but I also could not make it work.

Any ideas how to accomplish this?

like image 378
rtfpessoa Avatar asked Apr 01 '16 16:04

rtfpessoa


1 Answers

So here is my suggestion using symlinks:

$ mkdir -p have_access/project
$ ln -sr read_only/src have_access/
$ ln -sr read_only/build.sbt have_access/
$ ln -sr read_only/project/build.properties have_access/project/
$ cd have_access
$ sbt test
like image 81
0__ Avatar answered Nov 16 '22 09:11

0__