Class DefaultModularityExtension

java.lang.Object
org.javamodularity.moduleplugin.extensions.DefaultModularityExtension
All Implemented Interfaces:
ModularityExtension

public class DefaultModularityExtension extends Object implements ModularityExtension
  • Constructor Details

    • DefaultModularityExtension

      public DefaultModularityExtension(org.gradle.api.Project project)
  • Method Details

    • standardJavaRelease

      public void standardJavaRelease(int mainJavaRelease)
      Description copied from interface: ModularityExtension
      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.

      Specified by:
      standardJavaRelease in interface ModularityExtension
      Parameters:
      mainJavaRelease - value for the --release option of compileJava task (allowed range: 9+)
    • mixedJavaRelease

      public void mixedJavaRelease(int mainJavaRelease, int moduleInfoJavaRelease)
      Description copied from interface: ModularityExtension
      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.

      Specified by:
      mixedJavaRelease in interface ModularityExtension
      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

      public OptionContainer optionContainer()
      Specified by:
      optionContainer in interface ModularityExtension
    • improveEclipseClasspathFile

      public void improveEclipseClasspathFile()
      Description copied from interface: ModularityExtension
      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.

      Specified by:
      improveEclipseClasspathFile in interface ModularityExtension