Class BndUtils

java.lang.Object
aQute.bnd.gradle.BndUtils

public class BndUtils extends Object
BndUtils class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.gradle.api.file.ConfigurableFileCollection
    builtBy(org.gradle.api.file.ConfigurableFileCollection collection, Object... paths)
    Set the builtBy on the collection for the specified paths.
    static <TOOL> org.gradle.api.provider.Provider<TOOL>
    defaultToolFor(org.gradle.api.Project project, BiFunction<org.gradle.jvm.toolchain.JavaToolchainService,org.gradle.jvm.toolchain.JavaToolchainSpec,org.gradle.api.provider.Provider<TOOL>> tool)
    Return a tool Provider for the specified Project.
    static org.gradle.api.file.DirectoryProperty
    distDirectory(org.gradle.api.Project project)
    Return the distDirectory property for the specified Project.
    static boolean
    isGradleCompatible(String requestedVersion)
    Return whether the current Gradle is at least the specified version.
    static void
    jarLibraryElements(org.gradle.api.Task task, String configurationName)
    Set the Library Element Attribute of the specified configuration's attributes to Jar.
    static void
    logReport(aQute.service.reporter.Report report, org.gradle.api.logging.Logger logger)
    Log the Report information.
    static org.gradle.api.tasks.SourceSetContainer
    sourceSets(org.gradle.api.Project project)
    Return the SourceSetContainer for the specified Project.
    static org.gradle.api.provider.Provider<org.gradle.api.file.Directory>
    testResultsDir(org.gradle.api.Project project)
    Return the testResultsDir property for the specified Project.
    static <T> T
    unwrap(org.gradle.api.provider.Provider<? extends T> provider)
    Return the value of the specified Provider.
    static File
    unwrapFile(org.gradle.api.file.FileSystemLocation location)
    Return the File object of the specified FileSystemLocation.
    static File
    unwrapFile(org.gradle.api.provider.Provider<? extends org.gradle.api.file.FileSystemLocation> provider)
    Return the File object of the specified Provider.
    static Optional<File>
    unwrapFileOptional(org.gradle.api.provider.Provider<? extends org.gradle.api.file.FileSystemLocation> provider)
    Return the File object of the specified Provider or null if the Provider does not have a value.
    static <T> Optional<T>
    unwrapOptional(org.gradle.api.provider.Provider<? extends T> provider)
    Return the value of the specified Provider or null if the Provider does not have a value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isGradleCompatible

      public static boolean isGradleCompatible(String requestedVersion)
      Return whether the current Gradle is at least the specified version.
      Parameters:
      requestedVersion - The requested Gradle version.
      Returns:
      Whether the current Gradle is at least the specified version.
    • logReport

      public static void logReport(aQute.service.reporter.Report report, org.gradle.api.logging.Logger logger)
      Log the Report information.
      Parameters:
      report - The Report object to check.
      logger - The Logger.
    • builtBy

      public static org.gradle.api.file.ConfigurableFileCollection builtBy(org.gradle.api.file.ConfigurableFileCollection collection, Object... paths)
      Set the builtBy on the collection for the specified paths.
      Parameters:
      collection - The ConfigurableFileCollection.
      paths - The paths to use for builtBy.
      Returns:
      The specified ConfigurableFileCollection.
    • unwrap

      public static <T> T unwrap(org.gradle.api.provider.Provider<? extends T> provider)
      Return the value of the specified Provider.
      Type Parameters:
      T - The type of the Provider's value.
      Parameters:
      provider - The Provider.
      Returns:
      The value of the specified Provider.
      Throws:
      IllegalStateException - If the Provider does not have a value.
    • unwrapOptional

      public static <T> Optional<T> unwrapOptional(org.gradle.api.provider.Provider<? extends T> provider)
      Return the value of the specified Provider or null if the Provider does not have a value.
      Type Parameters:
      T - The type of the Provider's value.
      Parameters:
      provider - The Provider.
      Returns:
      The value of the specified Provider or null if the Provider does not have a value.
    • unwrapFile

      public static File unwrapFile(org.gradle.api.file.FileSystemLocation location)
      Return the File object of the specified FileSystemLocation.
      Parameters:
      location - The FileSystemLocation.
      Returns:
      The File object of the specified FileSystemLocation.
    • unwrapFile

      public static File unwrapFile(org.gradle.api.provider.Provider<? extends org.gradle.api.file.FileSystemLocation> provider)
      Return the File object of the specified Provider.
      Parameters:
      provider - The Provider.
      Returns:
      The File object of the specified Provider.
      Throws:
      IllegalStateException - If the Provider does not have a value.
    • unwrapFileOptional

      public static Optional<File> unwrapFileOptional(org.gradle.api.provider.Provider<? extends org.gradle.api.file.FileSystemLocation> provider)
      Return the File object of the specified Provider or null if the Provider does not have a value.
      Parameters:
      provider - The Provider.
      Returns:
      The File object of the specified Provider or null if the Provider does not have a value.
    • jarLibraryElements

      public static void jarLibraryElements(org.gradle.api.Task task, String configurationName)
      Set the Library Element Attribute of the specified configuration's attributes to Jar.
      Parameters:
      task - The Task.
      configurationName - The configuration name.
    • sourceSets

      public static org.gradle.api.tasks.SourceSetContainer sourceSets(org.gradle.api.Project project)
      Return the SourceSetContainer for the specified Project.
      Parameters:
      project - The Project.
      Returns:
      The SourceSetContainer for the specified Project.
    • distDirectory

      public static org.gradle.api.file.DirectoryProperty distDirectory(org.gradle.api.Project project)
      Return the distDirectory property for the specified Project.
      Parameters:
      project - The Project.
      Returns:
      The distDirectory property for the specified Project.
    • testResultsDir

      public static org.gradle.api.provider.Provider<org.gradle.api.file.Directory> testResultsDir(org.gradle.api.Project project)
      Return the testResultsDir property for the specified Project.
      Parameters:
      project - The Project.
      Returns:
      The testResultsDir property for the specified Project.
    • defaultToolFor

      public static <TOOL> org.gradle.api.provider.Provider<TOOL> defaultToolFor(org.gradle.api.Project project, BiFunction<org.gradle.jvm.toolchain.JavaToolchainService,org.gradle.jvm.toolchain.JavaToolchainSpec,org.gradle.api.provider.Provider<TOOL>> tool)
      Return a tool Provider for the specified Project.
      Type Parameters:
      TOOL - The tool type.
      Parameters:
      project - The Project.
      tool - The function which returns the tool Provider.
      Returns:
      A tool Provider for the specified Project.