Skip to content

Commit

Permalink
Merge pull request #51 from jglick/serialization
Browse files Browse the repository at this point in the history
Do not try to serialize CustomTool over Remoting
  • Loading branch information
oleg-nenashev committed Mar 10, 2021
2 parents a636bdb + e9c1b26 commit 91c6b19
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,17 @@ public List<? extends ToolInstaller> getDefaultInstallers() {
}
final List<LabelSpecifics> specs = getAppliedSpecifics(node);

PathsList pathsFound = homePath.act(new MasterToSlaveFileCallable<PathsList>() {
return homePath.act(new GetPaths(specs, exportedPaths, getHome()));
}
private static class GetPaths extends MasterToSlaveFileCallable<PathsList> {
private final List<LabelSpecifics> specs;
private final @CheckForNull String exportedPaths;
private final @CheckForNull String toolHome;
GetPaths(List<LabelSpecifics> specs, String exportedPaths, String toolHome) {
this.specs = specs;
this.exportedPaths = exportedPaths;
this.toolHome = toolHome;
}
private void parseLists(String pathList, List<String> target) {
String[] items = pathList.split("\\s*,\\s*");
for (String item : items) {
Expand Down Expand Up @@ -299,7 +309,7 @@ public PathsList invoke(File f, VirtualChannel channel)
for (String item : items) {
File file = new File(item);
if (!file.isAbsolute()) {
file = new File (getHome(), item);
file = new File(toolHome, item);
}

// Check if directory exists
Expand All @@ -310,16 +320,12 @@ public PathsList invoke(File f, VirtualChannel channel)
}

// Resolve home dir
final String toolHome = getHome();
if (toolHome == null) {
throw new IOException("Cannot retrieve Tool home directory. Should never happen ant this stage, please file a bug");
}
final File homeDir = new File(toolHome);
return new PathsList(outList, homeDir.getAbsolutePath());
}
});

return pathsFound;
}
}

}

0 comments on commit 91c6b19

Please sign in to comment.