Hi, think about it, how would you expect this to work? The env variables depend on (not only): - the system of execution - the user the process runs with - parameters - scripts … Most of these information is not available until the process really started, so therefore no there is no reliable way to do this during form validation. /Domi
On 22.03.2013, at 21:43, [email protected] wrote: > Hi everyone. I have a build step descriptor with the following code: > > /** > * Called automatically by Jenkins whenever the "projectFile" > * field is modified by the user. > * @param value the new path. > */ > public FormValidation doCheckProjectFile(@AncestorInPath > AbstractProject project, @QueryParameter String value) throws IOException { > if (value == null || value.trim().isEmpty()) { > return FormValidation.error("Project directory is required."); > } else { > // Make sure the directory exists. > return FilePath.validateFileMask(project.getSomeWorkspace(), > value); > } > } > > This works as expected, until the user tries to input a path containing > ${WORKSPACE}, at which point the validation promptly fails. I know I can > expand environment variables during the actual build, using the build's > EnvVars object, but I couldn't find any way to get an EnvVars instance from > the validation method. > > Is there a way to do this? Any help would be appreciated. > > -- Matt > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
