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 Type
    Method
    Description
    default void
    Apply workaround for https://github.com/gradle/gradle/issues/11124 (see also: https://github.com/java9-modularity/gradle-modules-plugin/issues/65)
    void
    Calling this method improves the ".classpath"-file created by Gradle's eclipse-plugin.
    default void
    mixedJavaRelease(int mainJavaRelease)
    Calling this method results in all Java classes being compiled to Java release 6-8 (as given by the mainJavaRelease parameter), with the exception of module-info.java being compiled to Java release 9.
    void
    mixedJavaRelease(int mainJavaRelease, int moduleInfoJavaRelease)
    Calling this method results in all Java classes being compiled to Java release 6-8 (as given by the mainJavaRelease parameter), with the exception of module-info.java being compiled to Java release 9+ (as given by the moduleInfoJavaRelease parameter).
    default void
     
     
    default void
    patchModule(String moduleName, String jarName)
     
    void
    standardJavaRelease(int mainJavaRelease)
    Calling this method results in all Java classes being compiled to Java release 9+ (as given by the mainJavaRelease parameter).
  • Method Details

    • standardJavaRelease

      void standardJavaRelease(int mainJavaRelease)
      Calling this method results in all Java classes being compiled to Java release 9+ (as given by the mainJavaRelease parameter).

      See details about the --release option here.

      Parameters:
      mainJavaRelease - value for the --release option of compileJava task (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 the mainJavaRelease parameter), with the exception of module-info.java being compiled to Java release 9.
      Parameters:
      mainJavaRelease - value for the --release option of compileJava task (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 the mainJavaRelease parameter), with the exception of module-info.java being compiled to Java release 9+ (as given by the moduleInfoJavaRelease parameter).

      See details about the --release option here.

      Parameters:
      mainJavaRelease - value for the --release option of compileJava task (allowed range: 6-8)
      moduleInfoJavaRelease - value for the --release option of compileModuleInfoJava task (allowed range: 9+)
    • optionContainer

      OptionContainer optionContainer()
    • patchModule

      default void patchModule(String moduleName, String jarName)
    • 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:

      1. Each "classpathentry" of kind = "con" with a path containing "JRE_CONTAINER" is moved to the module-path.
      2. Each "classpathentry" of kind = "lib" with a gradle_used_by_scope containing "main" gets an additional attribute module = "true".
      3. 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

      default void moduleVersion(String version)
    • 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)