/** * If a subversion remote uses $VAR or ${VAR} as a parameterized build, * we expand the url. This will expand using the DEFAULT item. If there * is a choice parameter, it will expand with the FIRST item. */ public ModuleLocation getExpandedLocation(Job<?, ?> project) { String url = this.getURL(); String returnURL = url; for (JobProperty property : project.getProperties().values()) { if (property instanceof ParametersDefinitionProperty) { ParametersDefinitionProperty pdp = (ParametersDefinitionProperty) property; for (String propertyName : pdp.getParameterDefinitionNames()) { if (url.contains(propertyName)) { ParameterDefinition pd = pdp.getParameterDefinition(propertyName); ParameterValue pv = pd.getDefaultParameterValue(); String replacement = ""; if (pv != null) { replacement = String.valueOf(pv.createVariableResolver(null).resolve(propertyName)); } returnURL = returnURL.replace("${" + propertyName + "}", replacement); returnURL = returnURL.replace("$" + propertyName, replacement); } } } } return new ModuleLocation(returnURL, credentialsId, getLocalDir(), getDepthOption(), isIgnoreExternalsOption(), isCancelProcessOnExternalsFail()); }
SubversionUpdateEventHandler eventHandler = new SubversionUpdateEventHandler( listener.getLogger(), externals, local, location.getLocalDir(), quietOperation, location.isCancelProcessOnExternalsFail()); svnuc.setEventHandler(eventHandler); svnuc.setExternalsHandler(eventHandler);
SubversionUpdateEventHandler eventHandler = new SubversionUpdateEventHandler( new PrintStream(pos), externals, local, location.getLocalDir(), quietOperation, location.isCancelProcessOnExternalsFail()); svnuc.setEventHandler(eventHandler); svnuc.setExternalsHandler(eventHandler);
/** * Expand location value based on environment variables. * * @return Output ModuleLocation expanded according to specified env vars. */ public ModuleLocation getExpandedLocation(EnvVars env) { return new ModuleLocation(env.expand(remote), credentialsId, env.expand(getLocalDir()), getDepthOption(), isIgnoreExternalsOption(), isCancelProcessOnExternalsFail()); }