Class ExtraJavaModuleInfoPluginExtension
java.lang.Object
org.gradlex.javamodule.moduleinfo.ExtraJavaModuleInfoPluginExtension
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.gradle.api.artifacts.Configuration resolvable) Activate the plugin's functionality for a single resolvable Configuration.voidactivate(org.gradle.api.NamedDomainObjectProvider<?> sourceSetOrResolvable) Variant ofactivate(SourceSet)andactivate(Configuration)that accepts either a Provider ofSourceSetor a Provider ofConfiguration.voidactivate(org.gradle.api.tasks.SourceSet sourceSet) Activate the plugin's functionality for dependencies of all scopes of the given source set (runtimeClasspath, compileClasspath, annotationProcessor).voidautomaticModule(String identifier, String moduleName) Add an Automatic-Module-Name to a given Jar file.voidautomaticModule(String identifier, String moduleName, org.gradle.api.Action<? super AutomaticModuleName> conf) Add an Automatic-Module-Name to a given Jar file.voidautomaticModule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName) Add an Automatic-Module-Name to a given Jar file.voidautomaticModule(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.voiddeactivate(org.gradle.api.artifacts.Configuration resolvable) Deactivate the plugin's functionality for a single resolvable Configuration.voiddeactivate(org.gradle.api.NamedDomainObjectProvider<?> sourceSetOrResolvable) Variant ofdeactivate(SourceSet)anddeactivate(Configuration)that accepts either a Provider ofSourceSetor a Provider ofConfiguration.voiddeactivate(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.ConfigurationContainerabstract 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.ObjectFactoryabstract org.gradle.api.provider.Property<Boolean>abstract org.gradle.api.provider.Property<String>voidknownModule(String coordinates, String moduleName) Let the plugin know about an existing module on the module path.voidknownModule(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.voidAdd full module information for a given Jar file.voidAdd full module information for a given Jar file.voidmodule(String identifier, String moduleName, String moduleVersion, org.gradle.api.Action<? super ModuleInfo> conf) Add full module information for a given Jar file.voidmodule(String identifier, String moduleName, org.gradle.api.Action<? super ModuleInfo> conf) Add full module information for a given Jar file.voidmodule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName) Add full module information for a given Jar file.voidmodule(org.gradle.api.provider.Provider<org.gradle.api.artifacts.MinimalExternalModuleDependency> alias, String moduleName, String moduleVersion) Add full module information for a given Jar file.voidmodule(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.voidmodule(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.
-
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
-
getFailOnMissingModuleInfo
-
getFailOnAutomaticModules
-
getFailOnModifiedDerivedModuleNames
-
getSkipLocalJars
-
getDeriveAutomaticModuleNamesFromFileNames
public abstract org.gradle.api.provider.Property<Boolean> getDeriveAutomaticModuleNamesFromFileNames() -
getVersionsProvidingConfiguration
-
module
Add full module information for a given Jar file.- Parameters:
identifier- group:name coordinates _or_ Jar file namemoduleName- 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 catalogmoduleName- the Module Name of the Module to construct
-
module
Add full module information for a given Jar file.- Parameters:
identifier- group:name coordinates _or_ Jar file namemoduleName- the Module Name of the Module to constructmoduleVersion- 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 catalogmoduleName- the Module Name of the Module to constructmoduleVersion- 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 namemoduleName- the Module Name of the Module to constructconf- configure exported packages and dependencies, seeModuleInfo
-
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 catalogmoduleName- the Module Name of the Module to constructconf- configure exported packages and dependencies, seeModuleInfo
-
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 namemoduleName- the Module Name of the Module to constructmoduleVersion- version to write into the module-info.classconf- configure exported packages, dependencies and Jar merging, seeModuleInfo
-
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 catalogmoduleName- the Module Name of the Module to constructmoduleVersion- version to write into the module-info.classconf- configure exported packages, dependencies and Jar merging, seeModuleInfo
-
automaticModule
Add an Automatic-Module-Name to a given Jar file.- Parameters:
identifier- group:name coordinates _or_ Jar file namemoduleName- 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 catalogmoduleName- 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 namemoduleName- the Module Name of the Module to constructconf- configure Jar merging, seeAutomaticModuleName
-
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 catalogmoduleName- the Module Name of the Module to constructconf- configure Jar merging, seeAutomaticModuleName
-
knownModule
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 coordinatesmoduleName- 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 catalogmoduleName- 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 adeactivate(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 ofactivate(SourceSet)andactivate(Configuration)that accepts either a Provider ofSourceSetor a Provider ofConfiguration. 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 ofdeactivate(SourceSet)anddeactivate(Configuration)that accepts either a Provider ofSourceSetor a Provider ofConfiguration. This is a convenience to use notations like 'deactivate(sourceSets.test)' in Kotlin DSL.- Parameters:
sourceSetOrResolvable- the Source Set or Configuration to activate
-