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
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
FieldsModifier and TypeFieldDescriptionprotected JavaPlatformprotected build.spin.Projectprotected build.base.telemetry.TelemetryRecorderprotected build.spin.module.modulesystem.ModuleVersioning -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract build.base.option.JDKVersionObtains theJDKVersionfor which theJavaPluginis designed to operate.build.spawn.jdk.JDKgetJDK()build.codemodel.jdk.descriptor.JDKModuleDescriptorObtains theJDKModuleDescriptorfor theProject, as defined by themodule-info.javafile.protected PathObtains the rootPathfor source code (including resources) for theJavaPlugin.build.base.version.VersionObtains theVersionfor theProjectMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface build.spin.Extension
nameMethods 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
-
-
Constructor Details
-
AbstractJavaPlugin
public AbstractJavaPlugin()Constructs aAbstractJavaPlugin.
-
-
Method Details
-
getSourceRootPath
Obtains the rootPathfor source code (including resources) for theJavaPlugin.- Returns:
- the root
Path
-
getJavaVersion
@Provides public abstract build.base.option.JDKVersion getJavaVersion()Description copied from interface:JavaPluginObtains theJDKVersionfor which theJavaPluginis designed to operate.- Specified by:
getJavaVersionin interfaceJavaPlugin- Returns:
- the
JDKVersion
-
getJDK
@Provides public build.spawn.jdk.JDK getJDK()Description copied from interface:JavaPlugin- Specified by:
getJDKin interfaceJavaPlugin- Returns:
- the
JDK
-
getModuleDescriptor
@Provides public build.codemodel.jdk.descriptor.JDKModuleDescriptor getModuleDescriptor()Description copied from interface:JavaPluginObtains theJDKModuleDescriptorfor theProject, as defined by themodule-info.javafile.Should the
Projectnot define amodule-info.javafile, 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:
getModuleDescriptorin interfaceJavaPlugin- Returns:
- the
JDKModuleDescriptor
-
getVersion
@Provides public build.base.version.Version getVersion()Obtains theVersionfor theProject- Returns:
- the
Version
-