Class GenerateSerialCodecsTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
dev.gmitch215.bytebox.gradle.GenerateSerialCodecsTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class GenerateSerialCodecsTask extends org.gradle.api.DefaultTask
Writes a codec for every type annotated @SerialType, in Java's own serialization format.

The identifier, the field list and its order all come from the class as the specification reads it, so a stream written by a generated codec is the stream a JVM writes. What the format needs and reflection cannot give is whether a class has a static initializer, which is read out of the class file.

Anything the format cannot express here is refused with the reason, at build time, rather than written as an approximation.

Since:
1.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The package the generated codecs live in.
    static final String
    The class that registers every generated codec.

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Writes the codecs.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Returns everything needed to resolve those classes, including bytebox itself.
    abstract org.gradle.api.file.DirectoryProperty
    Returns where the generated source goes.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Returns the project's own compiled classes, which are the ones scanned.
    abstract org.gradle.api.provider.ListProperty<String>
    Returns types to generate codecs for that the scan would not find.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Field Details

  • Constructor Details

    • GenerateSerialCodecsTask

      public GenerateSerialCodecsTask()
  • Method Details

    • getTypes

      @Input public abstract org.gradle.api.provider.ListProperty<String> getTypes()
      Returns types to generate codecs for that the scan would not find.
      Returns:
      types to generate codecs for that the scan would not find
    • getScanned

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getScanned()
      Returns the project's own compiled classes, which are the ones scanned.
      Returns:
      the project's own compiled classes, which are the ones scanned
    • getClasspath

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getClasspath()
      Returns everything needed to resolve those classes, including bytebox itself.
      Returns:
      everything needed to resolve those classes, including bytebox itself
    • getOutputDirectory

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()
      Returns where the generated source goes.
      Returns:
      where the generated source goes
    • generate

      public void generate()
      Writes the codecs.