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

[Groovy] Class AbstractBaseToolExtension<T extends AbstractBaseToolExtension>

    • Field Detail

      • @Internal protected boolean noGlobalExecSearch

    • Constructor Detail

      • protected AbstractBaseToolExtension(ProjectOperations projectOperations)

        Attach this extension to a project

        Parameters:
        projectOperations - ProjectOperations instance.

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

        Attach this extension to a task

        Parameters:
        task - Task to attach to.
        projectOperations - ProjectOperations instance.
        projectExtName - Extension that is attached to the project. Pass {@Link #noProjectExtension} is project extension is available or required.

    • 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

      • 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 void failNoExecConfig()

        Call this when there is no preset way to local the 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. @return

      • @Internal protected T noProjectExtension()

        Pass to the task constructor when no project extension will be available or required.

      • protected File resolveExecutable()

        Resolves an executable to a physical local file location.

        Returns:
        Local location.

      • 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 abstract String runExecutableAndReturnVersion()

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

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

      • protected void setExecutableVersionProvider(Provider<String> provider)

        Overrides the default way or determining what the version is of a tool.

        Parameters:
        provider - Provider of the version.

      • 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)

      • protected void unsetNonPaths()

        This is used when path or search path is set to unset other search mechanisms. This is primarily intended to be used within Grolifant itself as part of its base classes and MUST be overridden in those. The default operation is NOOP.

      • protected void unsetPaths()

        Unset both the fixed path and search path. THis can be used by derived classes to ensure that paths are not included in exectuble resolution