Class AbstractJavaPlugin

java.lang.Object
build.spin.module.java.AbstractJavaPlugin
All Implemented Interfaces:
build.spin.Extension, JavaPlugin, build.spin.Plugin
Direct Known Subclasses:
Java25CompilerPlugin, Java8CompilerPlugin

public abstract class AbstractJavaPlugin extends Object implements JavaPlugin
An abstract Plugin for Java-based Projects.
Since:
Aug-2020
Author:
brian.oliver
  • Nested Class Summary

    Nested classes/interfaces inherited from interface build.spin.Plugin

    build.spin.Plugin.Comparable<P>, build.spin.Plugin.MetaClass
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected JavaPlatform
     
    protected build.spin.Project
     
    protected build.base.telemetry.TelemetryRecorder
     
    protected build.spin.module.modulesystem.ModuleVersioning
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a AbstractJavaPlugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract build.base.option.JDKVersion
    Obtains the JDKVersion for which the JavaPlugin is designed to operate.
    build.spawn.jdk.JDK
    Obtains the JDK to be used by Tasks defined by the JavaPlugin JDKVersion.
    build.codemodel.jdk.descriptor.JDKModuleDescriptor
    Obtains the JDKModuleDescriptor for the Project, as defined by the module-info.java file.
    protected Path
    Obtains the root Path for source code (including resources) for the JavaPlugin.
    build.base.version.Version
    Obtains the Version for the Project

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface build.spin.Extension

    name

    Methods inherited from interface build.spin.Plugin

    invocables
  • Field Details

    • recorder

      @Inject protected build.base.telemetry.TelemetryRecorder recorder
    • project

      @Inject protected build.spin.Project project
    • versioning

      @Inject protected build.spin.module.modulesystem.ModuleVersioning versioning
    • platform

      @Inject protected JavaPlatform platform
  • Constructor Details

  • Method Details

    • getSourceRootPath

      protected Path getSourceRootPath()
      Obtains the root Path for source code (including resources) for the JavaPlugin.
      Returns:
      the root Path
    • getJavaVersion

      @Provides public abstract build.base.option.JDKVersion getJavaVersion()
      Description copied from interface: JavaPlugin
      Obtains the JDKVersion for which the JavaPlugin is designed to operate.
      Specified by:
      getJavaVersion in interface JavaPlugin
      Returns:
      the JDKVersion
    • getJDK

      @Provides public build.spawn.jdk.JDK getJDK()
      Description copied from interface: JavaPlugin
      Obtains the JDK to be used by Tasks defined by the JavaPlugin JDKVersion.
      Specified by:
      getJDK in interface JavaPlugin
      Returns:
      the JDK
    • getModuleDescriptor

      @Provides public build.codemodel.jdk.descriptor.JDKModuleDescriptor getModuleDescriptor()
      Description copied from interface: JavaPlugin
      Obtains the JDKModuleDescriptor for the Project, as defined by the module-info.java file.

      Should the Project not define a module-info.java file, say because the source is for a non-modular version of Java (pre Java 9), an attempt will be made to create a synthetic one based on the available information.

      For example, one may be produce using information contained in a Apache Maven POM, Apache Ivy configuration or Gradle Build File.

      Specified by:
      getModuleDescriptor in interface JavaPlugin
      Returns:
      the JDKModuleDescriptor
    • getVersion

      @Provides public build.base.version.Version getVersion()
      Obtains the Version for the Project
      Returns:
      the Version