Package: org.ysb33r.grolifant.api.v4.runnable

[Groovy] Class AbstractToolExtension<T extends AbstractToolExtension>

    • Constructor Detail

      • protected AbstractToolExtension(ProjectOperations projectOperations)

        Attach this extension to a project

        Parameters:
        projectOperations - ProjectOperations instance.

      • protected AbstractToolExtension(Task task, ProjectOperations projectOperations, T projectExtension)

        Attach this extension to a task

        Parameters:
        task - Task to attach to.
        projectOperations - ProjectOperations instance.
        projectExtName - Name of the extension that is attached to the project.

    • Method Detail

      • void executableByPath(Object path)

        Locate an executable by a local path.

        Parameters:
        path - Something resolvable to a File.

      • void executableBySearchPath(Object baseName)

        Locate executable by searching the current environmental search path.

        Parameters:
        baseName - The base name of the executable

      • void executableByVersion(Object version)

        Locate an executable by version, probably downloading it if not local.

        Parameters:
        version - Something resolvable to a string.

      • protected File executablePathOrNull()

        If a path has been set instead of a version, resolve the path.

        Returns:
        Path to executable or null

      • protected File executableSearchPathOrNull()

        If a search path has been set, resolve the location by searching path

        Returns:
        Path to executable or null if search path was not set

      • protected String executableVersionOrNull()

        Resolves the version if it has been set.

        Returns:
        Version string or null.

      • protected ExecutableDownloader getDownloader()

        Gets the downloader implementation. Can throw an exception if downloading is not supported.

        Returns:
        A downloader that can be used to retrieve an executable.

      • Provider<File> getExecutable()

        A provider for a resolved executable.

        Returns:
        File provider.

      • java.util.List<String> getWindowsExtensionSearchOrder()

        The order in which extensions will be checked for locating an executable on Windows. The default is to use whatever is in the PATHEXT environmental variable.

        Returns:

      • Provider<String> resolvedExecutableVersion()

        If configured by version returns that, otherwise it might run the executable to obtain the version.

        Returns:
        Provider to a version string.

      • protected String runExecutableAndReturnVersion()

        Runs the executable and returns the version. See ExecUtils.parseVersionFromOutput as a helper to implement this method.

        throws:
        ConfigurationException if configuration is not correct or version could not be determined.
        Returns:
        Version string.

      • void setWindowsExtensionSearchOrder(Iterable<String> order)

        When searching for executables, the order in which to use check for file extensions.

        Parameters:
        order - List of extensions.

      • void setWindowsExtensionSearchOrder(String... order)