Class CollectedLibraries

  • All Implemented Interfaces:

    
    public final class CollectedLibraries
    
                        

    Resolves the libraries listed in a LibraryListFile as artifacts.

    The entries of the library list file are only known after the task that writes it has been executed, therefore they are added to the configuration in a Configuration.withDependencies callback, which is evaluated when the configuration is resolved. The configuration itself is created when this class is instantiated, which must happen at configuration time, so that the consuming task neither accesses the project nor creates a configuration during execution.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectedLibraries(Project project, String configurationName, Provider<RegularFile> libraryListFile) Creates the configuration that collects the libraries.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Provider<Map<String, File>> getResolvedLibraries() The resolved libraries, mapped from their target file name to the resolved artifact file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CollectedLibraries

        CollectedLibraries(Project project, String configurationName, Provider<RegularFile> libraryListFile)

        Creates the configuration that collects the libraries.

        Parameters:
        project - the project the configuration is created for, used at configuration time only
        configurationName - the name of the configuration that collects the libraries
        libraryListFile - the library list file that contains the dependency IDs of the libraries
    • Method Detail

      • getResolvedLibraries

         final Provider<Map<String, File>> getResolvedLibraries()

        The resolved libraries, mapped from their target file name to the resolved artifact file.

        The target file name is '''

        ${dependency.moduleGroup}_$

        {dependency.moduleName}_

        ${dependency.moduleVersion}.$

        {artifact.extension}'''