@Override public boolean isUnix() { return outer.isUnix(); }
@Override public boolean isUnix() { return outer.isUnix(); }
@Override public boolean isUnix() { return inner.isUnix(); }
if (!launcher.isUnix()) { args = args.toWindowsCommand();
@Override public boolean isUnix() { return inner.isUnix(); }
/** * {@inheritDoc} */ @Override public boolean isSupported(Launcher launcher, final TaskListener listener) { return launcher.isUnix(); }
@Override public boolean isUnix() { return outer.isUnix(); }
private String getFileSeparator(Launcher launcher) { String fileSeparator = "/"; if (!launcher.isUnix()) { fileSeparator = "\\"; } return fileSeparator; }
private String getJavaPathBuilder(String jdkBinPath, Launcher launcher) { StringBuilder javaPathBuilder = new StringBuilder(); if (StringUtils.isNotBlank(jdkBinPath)) { javaPathBuilder.append(jdkBinPath).append("/"); } javaPathBuilder.append("java"); if (!launcher.isUnix()) { javaPathBuilder.append(".exe"); } return javaPathBuilder.toString(); }
/** * Generates a ready-to-use ArgumentListBuilder for one of the Android SDK tools, based on the current context. * * @param sdkCmd The Android tool and any extra arguments for the command to run. * @return Arguments including the full path to the SDK and any extra Windows stuff required. */ public ArgumentListBuilder getToolCommand(final SdkCliCommand sdkCmd) { return Utils.getToolCommand(sdk, launcher.isUnix(), sdkCmd); }
private String getBuildFileFullPath() { StringBuilder buildFile = new StringBuilder(); if (StringUtils.isNotEmpty(rootDir)) { String pathsDelimiter = launcher.isUnix() ? "/" : "\\"; buildFile.append(rootDir); if (!StringUtils.endsWith(rootDir, pathsDelimiter)) { buildFile.append(pathsDelimiter); } } buildFile.append(this.buildFile); return buildFile.toString(); }
private String fixLoadRule(String loadRule) { if (StringUtils.isBlank(loadRule)) { return loadRule; } // Remove leading file separator, we don't need it when using add_loadrules String quotedLR = ConfigSpec.cleanLoadRule(loadRule, getLauncher().getLauncher().isUnix()); if (quotedLR.startsWith("\"") && quotedLR.endsWith("\"")) { return "\"" + quotedLR.substring(2); } else { return quotedLR.substring(1); } }
/** * Generates a ready-to-use ProcStarter for one of the Android SDK tools, based on the current context. * * @param sdkCmd The Android tool and any extra arguments for the command to run. * @return A ready ProcStarter * @throws IOException * @throws InterruptedException */ public ProcStarter getToolProcStarter(final SdkCliCommand sdkCmd) throws IOException, InterruptedException { return getProcStarter(Utils.getToolCommand(sdk, launcher.isUnix(), sdkCmd)); }
private CommandInterpreter createInterpreter(String scriptContent) { if (launcher.isUnix()) { return new Shell(scriptContent); } return new BatchFile(scriptContent); }
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new GetClassWorldsJar(mvn.getHome(),listener)); String path = classPathEntry(slaveRoot, Maven33Main.class, "maven33-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; // TODO this configurable?? path += (getLauncher().isUnix()?":":";")+mvn.getHomeDir().getPath()+"/conf/logging"; return path; }
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new Maven3ProcessFactory.GetClassWorldsJar(mvn.getHome(),listener)); String path = classPathEntry(slaveRoot, Maven32Main.class, "maven32-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; // TODO this configurable?? path += (getLauncher().isUnix()?":":";")+mvn.getHomeDir().getPath()+"/conf/logging"; return path; }
public String getCleartoolExe(Node node, TaskListener listener) throws IOException, InterruptedException { ClearCaseInstallation installation = this; installation = installation.forNode(node, listener); if (StringUtils.isNotBlank(installation.getHome())) { // If an installation is specified, use it return PathUtil.convertPathForOS(installation.getHome() + "/" + CLEARTOOL_EXE, node.createLauncher(listener).decorateFor(node).isUnix()); } else { // Otherwise, fallback to a default case where cleartool is in PATH return CLEARTOOL_EXE_FALLBACK; } }
private void prepareView(String viewTag, String stream) throws IOException, InterruptedException { String dynStorageDir = cleartool.getLauncher().getLauncher().isUnix() ? unixDynStorageDir : winDynStorageDir; if (cleartool.doesViewExist(viewTag)) { if (recreateView) { cleartool.rmviewtag(viewTag); cleartool.mkview(null, viewTag, stream, dynStorageDir); } } else { cleartool.mkview(null, viewTag, stream, dynStorageDir); } }
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new GetClassWorldsJar(mvn.getHome(),listener)); return classPathEntry(slaveRoot, Maven3Main.class, "maven3-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; }
@Override protected CheckOutAction createCheckOutAction(VariableResolver<String> variableResolver, ClearToolLauncher launcher, AbstractBuild<?, ?> build) throws IOException, InterruptedException { CheckOutAction action; String effectiveConfigSpec = Util.replaceMacro(configSpec, variableResolver); if (isUseDynamicView()) { action = new DynamicCheckoutAction(createClearTool(variableResolver, launcher), effectiveConfigSpec, doNotUpdateConfigSpec, useTimeRule, isCreateDynView(), getNormalizedWinDynStorageDir(variableResolver), getNormalizedUnixDynStorageDir(variableResolver), build); } else { action = new SnapshotCheckoutAction(createClearTool(variableResolver, launcher),new ConfigSpec(effectiveConfigSpec, launcher.getLauncher().isUnix()), getViewPaths(variableResolver, build, launcher.getLauncher()),isUseUpdate(), getViewPath(variableResolver)); } return action; }