Class ExtraJavaModuleInfoPluginExtension

java.lang.Object
org.gradlex.javamodule.moduleinfo.ExtraJavaModuleInfoPluginExtension

@NullMarked public abstract class ExtraJavaModuleInfoPluginExtension extends Object
A data class to collect all the module information we want to add. Here the class is used as extension that can be configured in the build script and as input to the ExtraModuleInfoTransform that add the information to Jars.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.gradle.api.artifacts.Configuration resolvable)
    Activate the plugin's functionality for a single resolvable Configuration.
    void
    activate(org.gradle.api.NamedDomainObjectProvider<?> sourceSetOrResolvable)
    Variant of activate(SourceSet) and activate(Configuration) that accepts either a Provider of SourceSet or a Provider of Configuration.
    void
    activate(org.gradle.api.tasks.SourceSet sourceSet)
    Activate the plugin's functionality for dependencies of all scopes of the given source set (runtimeClasspath, compileClasspath, annotationProcessor).
    void
    automaticModule(String identifier, String moduleName)
    Add an Automatic-Module-Name to a given Jar file.
    void
    automaticModule(String identifier, String moduleName, org.gradle.api.Action<? super AutomaticModuleName> conf)
    Add an Automatic-Module-Name to a given Jar file.
    void
    automaticModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName)
    Add an Automatic-Module-Name to a given Jar file.
    void
    automaticModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, org.gradle.api.Action<? super AutomaticModuleName> conf)
    Add an Automatic-Module-Name to a given Jar file.
    void
    deactivate(org.gradle.api.artifacts.Configuration resolvable)
    Deactivate the plugin's functionality for a single resolvable Configuration.
    void
    deactivate(org.gradle.api.NamedDomainObjectProvider<?> sourceSetOrResolvable)
    Variant of deactivate(SourceSet) and deactivate(Configuration) that accepts either a Provider of SourceSet or a Provider of Configuration.
    void
    deactivate(org.gradle.api.tasks.SourceSet sourceSet)
    Deactivate the plugin's functionality for dependencies of all scopes of the given source set (runtimeClasspath, compileClasspath, annotationProcessor).
    protected abstract org.gradle.api.artifacts.ConfigurationContainer
     
    abstract org.gradle.api.provider.Property<Boolean>
     
    abstract org.gradle.api.provider.Property<Boolean>
     
    abstract org.gradle.api.provider.Property<Boolean>
     
    abstract org.gradle.api.provider.Property<Boolean>
     
    abstract org.gradle.api.provider.MapProperty<String,ModuleSpec>
     
    protected abstract org.gradle.api.model.ObjectFactory
     
    abstract org.gradle.api.provider.Property<Boolean>
     
    abstract org.gradle.api.provider.Property<String>
     
    void
    knownModule(String coordinates, String moduleName)
    Let the plugin know about an existing module on the module path.
    void
    knownModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName)
    Let the plugin know about an existing module on the module path.
    void
    module(String identifier, String moduleName)
    Add full module information for a given Jar file.
    void
    module(String identifier, String moduleName, String moduleVersion)
    Add full module information for a given Jar file.
    void
    module(String identifier, String moduleName, String moduleVersion, org.gradle.api.Action<? super ModuleInfo> conf)
    Add full module information for a given Jar file.
    void
    module(String identifier, String moduleName, org.gradle.api.Action<? super ModuleInfo> conf)
    Add full module information for a given Jar file.
    void
    module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName)
    Add full module information for a given Jar file.
    void
    module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, String moduleVersion)
    Add full module information for a given Jar file.
    void
    module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, String moduleVersion, org.gradle.api.Action<? super ModuleInfo> conf)
    Add full module information for a given Jar file.
    void
    module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, org.gradle.api.Action<? super ModuleInfo> conf)
    Add full module information for a given Jar file.

    Methods inherited from class java.lang.Object

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

    • ExtraJavaModuleInfoPluginExtension

      public ExtraJavaModuleInfoPluginExtension()
  • Method Details

    • getObjects

      @Inject protected abstract org.gradle.api.model.ObjectFactory getObjects()
    • getConfigurations

      @Inject protected abstract org.gradle.api.artifacts.ConfigurationContainer getConfigurations()
    • getModuleSpecs

      public abstract org.gradle.api.provider.MapProperty<String,ModuleSpec> getModuleSpecs()
    • getFailOnMissingModuleInfo

      public abstract org.gradle.api.provider.Property<Boolean> getFailOnMissingModuleInfo()
    • getFailOnAutomaticModules

      public abstract org.gradle.api.provider.Property<Boolean> getFailOnAutomaticModules()
    • getFailOnModifiedDerivedModuleNames

      public abstract org.gradle.api.provider.Property<Boolean> getFailOnModifiedDerivedModuleNames()
    • getSkipLocalJars

      public abstract org.gradle.api.provider.Property<Boolean> getSkipLocalJars()
    • getDeriveAutomaticModuleNamesFromFileNames

      public abstract org.gradle.api.provider.Property<Boolean> getDeriveAutomaticModuleNamesFromFileNames()
    • getVersionsProvidingConfiguration

      public abstract org.gradle.api.provider.Property<String> getVersionsProvidingConfiguration()
    • module

      public void module(String identifier, String moduleName)
      Add full module information for a given Jar file.
      Parameters:
      identifier - group:name coordinates _or_ Jar file name
      moduleName - the Module Name of the Module to construct
    • module

      public void module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName)
      Add full module information for a given Jar file.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module to construct
    • module

      public void module(String identifier, String moduleName, @Nullable String moduleVersion)
      Add full module information for a given Jar file.
      Parameters:
      identifier - group:name coordinates _or_ Jar file name
      moduleName - the Module Name of the Module to construct
      moduleVersion - version to write into the module-info.class
    • module

      public void module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, @Nullable String moduleVersion)
      Add full module information for a given Jar file.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module to construct
      moduleVersion - version to write into the module-info.class
    • module

      public void module(String identifier, String moduleName, @Nullable org.gradle.api.Action<? super ModuleInfo> conf)
      Add full module information for a given Jar file.
      Parameters:
      identifier - group:name coordinates _or_ Jar file name
      moduleName - the Module Name of the Module to construct
      conf - configure exported packages and dependencies, see ModuleInfo
    • module

      public void module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, @Nullable org.gradle.api.Action<? super ModuleInfo> conf)
      Add full module information for a given Jar file.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module to construct
      conf - configure exported packages and dependencies, see ModuleInfo
    • module

      public void module(String identifier, String moduleName, @Nullable String moduleVersion, @Nullable org.gradle.api.Action<? super ModuleInfo> conf)
      Add full module information for a given Jar file.
      Parameters:
      identifier - group:name coordinates _or_ Jar file name
      moduleName - the Module Name of the Module to construct
      moduleVersion - version to write into the module-info.class
      conf - configure exported packages, dependencies and Jar merging, see ModuleInfo
    • module

      public void module(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, @Nullable String moduleVersion, @Nullable org.gradle.api.Action<? super ModuleInfo> conf)
      Add full module information for a given Jar file.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module to construct
      moduleVersion - version to write into the module-info.class
      conf - configure exported packages, dependencies and Jar merging, see ModuleInfo
    • automaticModule

      public void automaticModule(String identifier, String moduleName)
      Add an Automatic-Module-Name to a given Jar file.
      Parameters:
      identifier - group:name coordinates _or_ Jar file name
      moduleName - the Module Name of the Module to construct
    • automaticModule

      public void automaticModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName)
      Add an Automatic-Module-Name to a given Jar file.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module to construct
    • automaticModule

      public void automaticModule(String identifier, String moduleName, @Nullable org.gradle.api.Action<? super AutomaticModuleName> conf)
      Add an Automatic-Module-Name to a given Jar file.
      Parameters:
      identifier - group:name coordinates _or_ Jar file name
      moduleName - the Module Name of the Module to construct
      conf - configure Jar merging, see AutomaticModuleName
    • automaticModule

      public void automaticModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, @Nullable org.gradle.api.Action<? super AutomaticModuleName> conf)
      Add an Automatic-Module-Name to a given Jar file.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module to construct
      conf - configure Jar merging, see AutomaticModuleName
    • knownModule

      public void knownModule(String coordinates, String moduleName)
      Let the plugin know about an existing module on the module path. This may be needed when 'requiresDirectivesFromMetadata(true)' is used.
      Parameters:
      coordinates - group:name coordinates
      moduleName - the Module Name of the Module referred to by the coordinates
    • knownModule

      public void knownModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName)
      Let the plugin know about an existing module on the module path. This may be needed when 'requiresDirectivesFromMetadata(true)' is used.
      Parameters:
      alias - group:name coordinates alias from version catalog
      moduleName - the Module Name of the Module referred to by the coordinates
    • activate

      public void activate(org.gradle.api.tasks.SourceSet sourceSet)
      Activate the plugin's functionality for dependencies of all scopes of the given source set (runtimeClasspath, compileClasspath, annotationProcessor). Note that the plugin activates the functionality for all source sets by default. Therefore, this method only has an effect for source sets for which a deactivate(SourceSet) has been performed.
      Parameters:
      sourceSet - the Source Set to activate (e.g. sourceSets.test)
    • activate

      public void activate(org.gradle.api.artifacts.Configuration resolvable)
      Activate the plugin's functionality for a single resolvable Configuration. This is useful to use the plugins for scopes that are not tied to a Source Set, for which the plugin does not activate automatically.
      Parameters:
      resolvable - a resolvable Configuration (e.g. configurations["customClasspath"])
    • activate

      public void activate(org.gradle.api.NamedDomainObjectProvider<?> sourceSetOrResolvable)
      Variant of activate(SourceSet) and activate(Configuration) that accepts either a Provider of SourceSet or a Provider of Configuration. This is a convenience to use notations like 'activate(sourceSets.main)' in Kotlin DSL.
      Parameters:
      sourceSetOrResolvable - the Source Set or Configuration to activate
    • deactivate

      public void deactivate(org.gradle.api.tasks.SourceSet sourceSet)
      Deactivate the plugin's functionality for dependencies of all scopes of the given source set (runtimeClasspath, compileClasspath, annotationProcessor).
      Parameters:
      sourceSet - the Source Set to deactivate (e.g. sourceSets.test)
    • deactivate

      public void deactivate(org.gradle.api.artifacts.Configuration resolvable)
      Deactivate the plugin's functionality for a single resolvable Configuration. This is useful if selected scopes do not use the Module Path and therefore module information is not required.
      Parameters:
      resolvable - a resolvable Configuration (e.g. configurations.annotationProcessor)
    • deactivate

      public void deactivate(org.gradle.api.NamedDomainObjectProvider<?> sourceSetOrResolvable)
      Variant of deactivate(SourceSet) and deactivate(Configuration) that accepts either a Provider of SourceSet or a Provider of Configuration. This is a convenience to use notations like 'deactivate(sourceSets.test)' in Kotlin DSL.
      Parameters:
      sourceSetOrResolvable - the Source Set or Configuration to activate