Interface ModularityExtension
- All Known Implementing Classes:
DefaultModularityExtension
public interface ModularityExtension
A project-wide extension that provides the most common modularity-related actions.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidApply workaround for https://github.com/gradle/gradle/issues/11124 (see also: https://github.com/java9-modularity/gradle-modules-plugin/issues/65)voidCalling this method improves the ".classpath"-file created by Gradle's eclipse-plugin.default voidmixedJavaRelease(int mainJavaRelease) Calling this method results in all Java classes being compiled to Java release 6-8 (as given by themainJavaReleaseparameter), with the exception ofmodule-info.javabeing compiled to Java release 9.voidmixedJavaRelease(int mainJavaRelease, int moduleInfoJavaRelease) Calling this method results in all Java classes being compiled to Java release 6-8 (as given by themainJavaReleaseparameter), with the exception ofmodule-info.javabeing compiled to Java release 9+ (as given by themoduleInfoJavaReleaseparameter).default voidmoduleVersion(String version) default voidpatchModule(String moduleName, String jarName) voidstandardJavaRelease(int mainJavaRelease) Calling this method results in all Java classes being compiled to Java release 9+ (as given by themainJavaReleaseparameter).
-
Method Details
-
standardJavaRelease
void standardJavaRelease(int mainJavaRelease) Calling this method results in all Java classes being compiled to Java release 9+ (as given by themainJavaReleaseparameter).See details about the
--releaseoption here.- Parameters:
mainJavaRelease- value for the--releaseoption ofcompileJavatask (allowed range: 9+)
-
mixedJavaRelease
default void mixedJavaRelease(int mainJavaRelease) Calling this method results in all Java classes being compiled to Java release 6-8 (as given by themainJavaReleaseparameter), with the exception ofmodule-info.javabeing compiled to Java release 9.- Parameters:
mainJavaRelease- value for the--releaseoption ofcompileJavatask (allowed range: 6-8)
-
mixedJavaRelease
void mixedJavaRelease(int mainJavaRelease, int moduleInfoJavaRelease) Calling this method results in all Java classes being compiled to Java release 6-8 (as given by themainJavaReleaseparameter), with the exception ofmodule-info.javabeing compiled to Java release 9+ (as given by themoduleInfoJavaReleaseparameter).See details about the
--releaseoption here.- Parameters:
mainJavaRelease- value for the--releaseoption ofcompileJavatask (allowed range: 6-8)moduleInfoJavaRelease- value for the--releaseoption ofcompileModuleInfoJavatask (allowed range: 9+)
-
optionContainer
OptionContainer optionContainer() -
patchModule
-
improveEclipseClasspathFile
void improveEclipseClasspathFile()Calling this method improves the ".classpath"-file created by Gradle's eclipse-plugin.This method configures the plugin such that the given content of a ".classpath"-file is modified in the following ways:
- Each "classpathentry" of kind = "con" with a path containing "JRE_CONTAINER" is moved to the module-path.
- Each "classpathentry" of kind = "lib" with a gradle_used_by_scope containing "main" gets an additional attribute module = "true".
- Each "classpathentry" with a gradle_used_by_scope of "test" gets an additional attribute test = "true".
For more information see Gradle's manual for the eclipse-plugin.
-
moduleVersion
-
disableEffectiveArgumentsAdjustment
default void disableEffectiveArgumentsAdjustment()Apply workaround for https://github.com/gradle/gradle/issues/11124 (see also: https://github.com/java9-modularity/gradle-modules-plugin/issues/65)
-