Class MsBuildInstaller

java.lang.Object
hudson.tools.ToolInstaller
hudson.plugins.msbuild.MsBuildInstaller
All Implemented Interfaces:
ExtensionPoint, Describable<ToolInstaller>

public class MsBuildInstaller extends ToolInstaller
  • Constructor Details

    • MsBuildInstaller

      @DataBoundConstructor public MsBuildInstaller(String label)
  • Method Details

    • getSelectedVersion

      public String getSelectedVersion()
    • setSelectedVersion

      @DataBoundSetter public void setSelectedVersion(String selectedVersion)
    • getAdditionalArguments

      public String getAdditionalArguments()
    • setAdditionalArguments

      @DataBoundSetter public void setAdditionalArguments(String additionalArguments)
    • setVsconfig

      @DataBoundSetter public void setVsconfig(String vsconfig)
    • getVsconfig

      public String getVsconfig()
    • performInstallation

      public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException
      Perform the installation of the Visual Studio Build Tools
      Specified by:
      performInstallation in class ToolInstaller
      Parameters:
      tool - ToolInstallation
      node - Node
      log - TaskListener
      Returns:
      FilePath
      Throws:
      IOException
      InterruptedException
    • isInstallerRunning

      public static boolean isInstallerRunning(String processName) throws IOException
      Check if the installer is running
      Parameters:
      processName - String
      Returns:
      boolean
      Throws:
      IOException
    • buildToolsInstallPath

      public static FilePath buildToolsInstallPath(Node node, String selectedVersion, String givenInstallPath)
      Get the path to the Build Tools Install Path
      Parameters:
      node - Node
      selectedVersion - String
      givenInstallPath - String
      Returns:
      FilePath
    • msBuildBinPath

      public static FilePath msBuildBinPath(Node node, String selectedVersion, String givenInstallPath)
      Get the path to the MSBuild Bin folder
      Parameters:
      node - Node
      selectedVersion - String
      givenInstallPath - String
      Returns:
      FilePath
    • getVs_BuildToolsExePath

      public static FilePath getVs_BuildToolsExePath(FilePath expected)
      Get the path to the vs_BuildTools.exe
      Parameters:
      expected - FilePath
      Returns:
      FilePath
    • extractInstallPath

      public static String extractInstallPath(String givenArguments)
      Extract the installPath from the given arguments
      Parameters:
      givenArguments - String
      Returns:
      String
    • checkIfOsIsWindows

      public static boolean checkIfOsIsWindows(Node node) throws IOException, InterruptedException
      Check if the OS is Windows.
      Parameters:
      node - Node
      Returns:
      boolean
      Throws:
      IOException
      InterruptedException
    • useConfigFile

      public static boolean useConfigFile(String vsconfig, FilePath expected) throws IOException, InterruptedException
      Use the .vsconfig file to install the Visual Studio Build Tools
      Parameters:
      vsconfig - String
      expected - FilePath
      Returns:
      boolean
      Throws:
      IOException
      InterruptedException
    • needsUpdate

      public static boolean needsUpdate(FilePath expected)
      Check if the installer needs to be updated
      Parameters:
      expected - FilePath
      Returns:
      boolean
    • needsModify

      public static boolean needsModify(FilePath expected) throws IOException, InterruptedException
      Check if the installer needs to be modified
      Parameters:
      expected - FilePath
      Returns:
      boolean
      Throws:
      IOException
      InterruptedException
    • downloadFile

      public static void downloadFile(URI uri, FilePath targetPath) throws IOException, InterruptedException
      Download a file from a URI to a target path
      Parameters:
      uri - URI
      targetPath - FilePath
      Throws:
      IOException
      InterruptedException
    • ensureArguments

      public static String ensureArguments(String givenArguments, String[] argsToAdd)
      Ensures that the specified arguments are present in the given argument string. If an argument is missing, it is appended to the string.
      Parameters:
      givenArguments - the initial argument string
      argsToAdd - array of arguments to ensure presence
      Returns:
      the modified argument string with all specified arguments included