提交 a631eb94 编写于 作者: J jglick

Backing out 17901; CommandInstaller.toolHome can in fact be distinct (even a relative path).


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@18099 71c3de6d-444a-0410-be80-ed276b4c234a
上级 b3665f7a
......@@ -46,16 +46,26 @@ public class CommandInstaller extends ToolInstaller {
*/
private final String command;
/**
* Resulting tool home directory.
*/
private final String toolHome;
@DataBoundConstructor
public CommandInstaller(String label, String command) {
public CommandInstaller(String label, String command, String toolHome) {
super(label);
this.command = command;
this.toolHome = toolHome;
}
public String getCommand() {
return command;
}
public String getToolHome() {
return toolHome;
}
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
FilePath tools = node.getRootPath().child("tools");
// XXX support Windows batch scripts, Unix scripts with interpreter line, etc. (see CommandInterpreter subclasses)
......@@ -70,7 +80,7 @@ public class CommandInstaller extends ToolInstaller {
} finally {
script.delete();
}
return node.createPath(tool.getHome());
return tools.child(toolHome);
}
@Extension
......@@ -87,6 +97,15 @@ public class CommandInstaller extends ToolInstaller {
return FormValidation.error(Messages.CommandInstaller_no_command());
}
}
public FormValidation doCheckToolHome(@QueryParameter String value) {
if (value.length() > 0) {
return FormValidation.ok();
} else {
return FormValidation.error(Messages.CommandInstaller_no_toolHome());
}
}
}
}
......@@ -26,4 +26,7 @@ THE SOFTWARE.
<f:entry title="${%Command}" field="command">
<f:textarea/>
</f:entry>
<f:entry title="${%Tool Home}" field="toolHome">
<f:textbox/>
</f:entry>
</j:jelly>
<div>
Resulting home directory of the tool.
(May be a relative path if the command unpacked a tool in place.)
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册