Class ModuleInfo
java.lang.Object
org.gradlex.javamodule.moduleinfo.ModuleSpec
org.gradlex.javamodule.moduleinfo.ModuleInfo
- All Implemented Interfaces:
Serializable
Data class to hold the information that should be added as module-info.class to an existing Jar file.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidShould this be a 'module' instead of an 'open module'?voidAutomatically export all packages of the Jar.voidexportAllPackagesExcept(String... exceptions) Automatically export all packages of the Jar.voidexportAllPackagesExcept(List<String> exceptions) Automatically export all packages of the Jar.void@Nullable StringGetter for the providers map (needed for the transformation logic)voidignoreServiceProvider(String provider, String... implementations) voidCalling this method at least once automatically makes this a "closed" module: 'module' instead of 'open module'.voidAllow patching real (JARs with module-info.class) modules by overriding the existing module-info.class.voidAllow patching real (JARs with module-info.class) by extending the existing module-info.class.voidvoidAutomatically add 'requires' statements for all dependencies defined in the metadata of the component.voidvoidrequiresStatic(String requiresStatic) voidrequiresStaticTransitive(String requiresStaticTransitive) voidrequiresTransitive(String requiresTransitive) voidMethods inherited from class org.gradlex.javamodule.moduleinfo.ModuleSpec
getClassifier, getIdentifier, getMergedJars, getModuleName, getRemovedPackages, mergeJar, mergeJar, overrideModuleName, removePackage
-
Method Details
-
closeModule
public void closeModule()Should this be a 'module' instead of an 'open module'? -
opens
Calling this method at least once automatically makes this a "closed" module: 'module' instead of 'open module'.- Parameters:
opens- corresponds to the directive in a 'module-info.java' fileto- modules this package should be opened to.
-
exports
- Parameters:
exports- corresponds to the directive in a 'module-info.java' fileto- modules this package should be exported to.
-
requires
- Parameters:
requires- corresponds to the directive in a 'module-info.java' file
-
requiresTransitive
- Parameters:
requiresTransitive- corresponds to the directive in a 'module-info.java' file
-
requiresStatic
- Parameters:
requiresStatic- corresponds to the directive in a 'module-info.java' file
-
requiresStaticTransitive
- Parameters:
requiresStaticTransitive- corresponds to the directive in a 'module-info.java' file
-
provides
- Parameters:
provides- corresponds to the directive in a 'module-info.java' filewith- specifys the package(s) containing provided service classes
-
getProviders
Getter for the providers map (needed for the transformation logic)- Returns:
-
uses
- Parameters:
uses- corresponds to the directive in a 'module-info.java' file
-
ignoreServiceProvider
- Parameters:
provider- do not transfer service provider to the 'module-info.class'implementations- the array of specific implementations to skip
-
getModuleVersion
- Returns:
- configured version of the Module
-
exportAllPackages
public void exportAllPackages()Automatically export all packages of the Jar. Can be used instead of individual 'exports()' statements. -
exportAllPackagesExcept
Automatically export all packages of the Jar. Can be used instead of individual 'exports()' statements.- Parameters:
exceptions- A list of packages not to export
-
exportAllPackagesExcept
Automatically export all packages of the Jar. Can be used instead of individual 'exports()' statements.- Parameters:
exceptions- A list of packages not to export
-
requireAllDefinedDependencies
public void requireAllDefinedDependencies()Automatically add 'requires' statements for all dependencies defined in the metadata of the component. -
patchRealModule
public void patchRealModule()Allow patching real (JARs with module-info.class) modules by overriding the existing module-info.class. -
preserveExisting
public void preserveExisting()Allow patching real (JARs with module-info.class) by extending the existing module-info.class.
-