While running a test that launches the Tuscany runtime standalone
from a command line, I noticed that Tuscany always creates an empty
"target" subdirectory under the current directory. It isn't very
friendly to modify the user's environment in this way, and in some
cases (running from a read-only location) this would cause Tuscany
to fail.
On investigation I found that this is caused by the lines
repository = new ContributionRepositoryImpl("target", inputFactory,
monitor);
in ReallySmallRuntimeBuilder and
FileHelper.forceMkdir(rootFile);
in ContributionRepositoryImpl.
What is the purpose of this empty subdirectory? Does it need to be
placed under the current directory? I noticed that there is code in
ContributionServiceImpl to default the location of this subdirectory to
<user.home>/.tuscany/domains/local/
which seems like a friendlier location for a directory owned by the
Tuscany runtime, but this default location is being overridden by the
hard-wired "target" subdirectory passed in by ReallySmallRuntimeBuilder.
Is it possible to defer the creation of this subdirectory to when it's
really needed, rather than creating it all the time even when it's left
empty? Alternatively, can this subdirectory be created under <user.home>
so that it doesn't intrude so much on the user's runtime environment?
(Or perhaps both of the above.)
Simon