Package aQute.bnd.gradle
Class BndUtils
java.lang.Object
aQute.bnd.gradle.BndUtils
BndUtils class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.gradle.api.file.ConfigurableFileCollectionSet 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.DirectoryPropertydistDirectory(org.gradle.api.Project project) Return the distDirectory property for the specified Project.static booleanisGradleCompatible(String requestedVersion) Return whether the current Gradle is at least the specified version.static voidjarLibraryElements(org.gradle.api.Task task, String configurationName) Set the Library Element Attribute of the specified configuration's attributes to Jar.static voidlogReport(aQute.service.reporter.Report report, org.gradle.api.logging.Logger logger) Log the Report information.static org.gradle.api.tasks.SourceSetContainersourceSets(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> Tunwrap(org.gradle.api.provider.Provider<? extends T> provider) Return the value of the specified Provider.static FileunwrapFile(org.gradle.api.file.FileSystemLocation location) Return the File object of the specified FileSystemLocation.static FileunwrapFile(org.gradle.api.provider.Provider<? extends org.gradle.api.file.FileSystemLocation> provider) Return the File object of the specified Provider.unwrapFileOptional(org.gradle.api.provider.Provider<? extends org.gradle.api.file.FileSystemLocation> provider) Return the File object of the specified Provider ornullif 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 ornullif the Provider does not have a value.
-
Method Details
-
isGradleCompatible
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 ornullif 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
nullif the Provider does not have a value.
-
unwrapFile
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 ornullif the Provider does not have a value.- Parameters:
provider- The Provider.- Returns:
- The File object of the specified Provider or
nullif the Provider does not have a value.
-
jarLibraryElements
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.
-