Move execroot tree creation to its own class
Part 1 of many for #1262, rolling forward.
--
MOS_MIGRATED_REVID=125334954
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
index a07fb9d..76706bc 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
@@ -504,7 +504,12 @@
createActionLogDirectory();
// Plant the symlink forest.
- plantSymlinkForest(packageRoots);
+ try {
+ new SymlinkForest(
+ packageRoots, getExecRoot(), runtime.getProductName()).plantSymlinkForest();
+ } catch (IOException e) {
+ throw new ExecutorInitException("Source forest creation failed", e);
+ }
}
private void createToolsSymlinks() throws ExecutorInitException {
@@ -515,17 +520,6 @@
}
}
- private void plantSymlinkForest(ImmutableMap<PathFragment, Path> packageRoots)
- throws ExecutorInitException {
- try {
- FileSystemUtils.deleteTreesBelowNotPrefixed(getExecRoot(),
- new String[] { ".", "_", runtime.getProductName() + "-"});
- FileSystemUtils.plantLinkForest(packageRoots, getExecRoot(), runtime.getProductName());
- } catch (IOException e) {
- throw new ExecutorInitException("Source forest creation failed", e);
- }
- }
-
private void createActionLogDirectory() throws ExecutorInitException {
Path directory = env.getDirectories().getActionConsoleOutputDirectory();
try {