Package groovy.grape

Interface GrapeEngine


public interface GrapeEngine
Contract for Grape dependency resolution engines.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Argument key for the caller depth.
    static final int
    Default caller depth used by the static facade.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a resolver to this engine.
    Enumerates locally available grapes.
    grab(String endorsedModule)
    Grabs a dependency expressed using the endorsed module shorthand.
    grab(Map args)
    Grabs a single dependency.
    grab(Map args, Map... dependencies)
    Grabs one or more dependencies using the supplied arguments.
    Map[]
    Lists dependencies associated with the supplied class loader.
    URI[]
    resolve(Map args, List depsInfo, Map... dependencies)
    Resolves dependency coordinates to artifact URIs while optionally collecting dependency information.
    URI[]
    resolve(Map args, Map... dependencies)
    Resolves dependency coordinates to artifact URIs.
    default void
    setLoggingLevel(int level)
    Sets the logging level for the grape engine.
  • Field Details

    • CALLEE_DEPTH

      static final String CALLEE_DEPTH
      Argument key for the caller depth.
      See Also:
    • DEFAULT_CALLEE_DEPTH

      static final int DEFAULT_CALLEE_DEPTH
      Default caller depth used by the static facade.
      See Also:
  • Method Details

    • grab

      Object grab(String endorsedModule)
      Grabs a dependency expressed using the endorsed module shorthand.
      Parameters:
      endorsedModule - the endorsed module notation
      Returns:
      an engine-specific result
    • grab

      Object grab(Map args)
      Grabs a single dependency.
      Parameters:
      args - the dependency descriptor
      Returns:
      an engine-specific result
    • grab

      Object grab(Map args, Map... dependencies)
      Grabs one or more dependencies using the supplied arguments.
      Parameters:
      args - grab arguments
      dependencies - dependency descriptors
      Returns:
      an engine-specific result
    • enumerateGrapes

      Map<String,Map<String,List<String>>> enumerateGrapes()
      Enumerates locally available grapes.
      Returns:
      grapes grouped by organization and module
    • resolve

      URI[] resolve(Map args, Map... dependencies)
      Resolves dependency coordinates to artifact URIs.
      Parameters:
      args - resolve arguments
      dependencies - dependency descriptors
      Returns:
      the resolved artifact URIs
    • resolve

      URI[] resolve(Map args, List depsInfo, Map... dependencies)
      Resolves dependency coordinates to artifact URIs while optionally collecting dependency information.
      Parameters:
      args - resolve arguments
      depsInfo - optional dependency metadata sink
      dependencies - dependency descriptors
      Returns:
      the resolved artifact URIs
    • listDependencies

      Map[] listDependencies(ClassLoader classLoader)
      Lists dependencies associated with the supplied class loader.
      Parameters:
      classLoader - the class loader to inspect
      Returns:
      the dependency descriptors
    • addResolver

      void addResolver(Map<String,Object> args)
      Adds a resolver to this engine.
      Parameters:
      args - the resolver descriptor
    • setLoggingLevel

      default void setLoggingLevel(int level)
      Sets the logging level for the grape engine.
      Parameters:
      level - the logging level (0=quiet/errors only, 1=warn, 2=info, 3=verbose, 4=debug)
      Since:
      6.0.0