Class GenerateEntryPointTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
dev.gmitch215.bytebox.gradle.GenerateEntryPointTask
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 GenerateEntryPointTask extends org.gradle.api.DefaultTask
Writes the Java class the compiled module exports its handlers from.

A separate class rather than a member of the handler, because a static method exported as fetch cannot sit beside the instance fetch that Worker declares. Keeping the generated glue out of the handler also leaves the handler a plain Java class with no annotations on it.

Each exported method hands JavaScript a promise straight away and starts the handler on a fiber. That shape is what makes a blocking handler possible: a promise executor cannot suspend, and an entry point returning a value would return before the handler's suspensions finished.

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 generated class's simple name.
    static final String
    The package the generated entry point lives in.

    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 entry point.
    abstract org.gradle.api.provider.ListProperty<String>
    Returns the Java classes exposed as Durable Objects.
    abstract org.gradle.api.provider.Property<String>
    Returns the handler class to route to.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Returns where to find the handler, so its interfaces can be read.
    abstract org.gradle.api.file.DirectoryProperty
    Returns where the generated source goes.

    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

    • GenerateEntryPointTask

      public GenerateEntryPointTask()
  • Method Details

    • getHandlerClass

      @Input public abstract org.gradle.api.provider.Property<String> getHandlerClass()
      Returns the handler class to route to.
      Returns:
      the handler class to route to
    • getDurableObjectClasses

      @Input public abstract org.gradle.api.provider.ListProperty<String> getDurableObjectClasses()
      Returns the Java classes exposed as Durable Objects.
      Returns:
      the Java classes exposed as Durable Objects
    • getHandlerClasspath

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getHandlerClasspath()
      Returns where to find the handler, so its interfaces can be read.
      Returns:
      where to find the handler, so its interfaces can be read
    • 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 entry point.