java.lang.Object
com.synopsys.arc.jenkinsci.plugins.extratoolinstallers.utils.EnvStringParseHelper

public class EnvStringParseHelper extends Object
Provides parsing of environment variables in input string.
Since:
0.3
Author:
Oleg Nenashev
  • Method Details

    • substituteEnvVars

      public static String substituteEnvVars(String macroString, EnvVars environment)
      Resolves tools installation directory using global variables.
      Parameters:
      environment - Collection of environment variables
      macroString - Input path with macro calls
      Returns:
      Raw string
      Since:
      0.3
    • substituteNodeVariables

      @Nullable public static String substituteNodeVariables(@CheckForNull String macroString, @NonNull Node node)
      Substitutes string according to all node properties.
      Parameters:
      macroString - String to be substituted
      node - Node whose properties provide available substitution
      Returns:
      Substituted string
    • substituteNodeProperty

      public static String substituteNodeProperty(String macroString, NodeProperty<?> property)
      Substitutes string according to node property.
      Parameters:
      macroString - String to be substituted
      property - Node property
      Returns:
      Substituted string
      Since:
      0.3
    • checkStringForMacro

      public static void checkStringForMacro(ToolInstaller installer, String stringName, String macroString) throws ExtraToolInstallersException
      Checks that all variables have been resolved.
      Parameters:
      installer - The installer that's doing the checking.
      stringName - The human-friendly name of the string being checked.
      macroString - The string contents that should be checked.
      Throws:
      ExtraToolInstallersException - String validation failed (there are unresolved variables)
      Since:
      0.3