rtfpessoa
rtfpessoa

Reputation: 541

Change all SBT target directories to the outside of the source

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?

Upvotes: 15

Views: 2173

Answers (1)

0__
0__

Reputation: 67330

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

Upvotes: 1

Related Questions